diff --git a/mps/code/config.h b/mps/code/config.h index 3e6158c1c7c..d68d1b52361 100644 --- a/mps/code/config.h +++ b/mps/code/config.h @@ -147,7 +147,9 @@ * cc -O2 -c -DCONFIG_PLINTH_NONE mps.c */ -#if defined(CONFIG_PLINTH_NONE) +#if !defined(CONFIG_PLINTH_NONE) +#define PLINTH +#else #define PLINTH_NONE #endif @@ -172,7 +174,9 @@ */ #if defined(CONFIG_THREAD_SINGLE) -#define DISABLE_LOCKS +#define LOCK +#else +#define LOCK_NONE #endif @@ -190,8 +194,11 @@ #if !defined(CONFIG_THREAD_SINGLE) #error "CONFIG_POLL_NONE without CONFIG_THREAD_SINGLE" #endif -#define DISABLE_REMEMBERED_SET -#define DISABLE_SHIELD +#define REMEMBERED_SET +#define SHIELD +#else +#define REMEMBERED_SET_NONE +#define SHIELD_NONE #endif diff --git a/mps/code/lock.h b/mps/code/lock.h index 5f0cadd7065..4fcd591a0f2 100644 --- a/mps/code/lock.h +++ b/mps/code/lock.h @@ -195,8 +195,9 @@ extern void LockClaimGlobal(void); extern void LockReleaseGlobal(void); -#ifdef DISABLE_LOCKS - +#if defined(LOCK) +/* Nothing to do: functions declared in all lock configurations. */ +#elif defined(LOCK_NONE) #define LockSize() MPS_PF_ALIGN #define LockInit(lock) UNUSED(lock) #define LockFinish(lock) UNUSED(lock) @@ -209,8 +210,9 @@ extern void LockReleaseGlobal(void); #define LockReleaseGlobalRecursive() #define LockClaimGlobal() #define LockReleaseGlobal() - -#endif /* DISABLE_LOCKS */ +#else +#error "No lock configuration." +#endif /* LOCK */ #endif /* lock_h */ diff --git a/mps/code/mpm.h b/mps/code/mpm.h index 7876330de65..8c030acaa77 100644 --- a/mps/code/mpm.h +++ b/mps/code/mpm.h @@ -524,14 +524,16 @@ extern void (ArenaEnter)(Arena arena); extern void (ArenaLeave)(Arena arena); extern void (ArenaPoll)(Globals globals); -#ifdef DISABLE_SHIELD +#if defined(SHIELD) #define ArenaEnter(arena) UNUSED(arena) #define ArenaLeave(arena) AVER(arena->busyTraces == TraceSetEMPTY) #define ArenaPoll(globals) UNUSED(globals) -#else +#elif defined(SHIELD_NONE) #define ArenaEnter(arena) ArenaEnterLock(arena, FALSE) #define ArenaLeave(arena) ArenaLeaveLock(arena, FALSE) -#endif +#else +#error "No shield configuration." +#endif /* SHIELD */ extern void ArenaEnterRecursive(Arena arena); extern void ArenaLeaveRecursive(Arena arena); @@ -892,7 +894,9 @@ extern void (ShieldSuspend)(Arena arena); extern void (ShieldResume)(Arena arena); extern void (ShieldFlush)(Arena arena); -#ifdef DISABLE_SHIELD +#if defined(SHIELD) +/* Nothing to do: functions declared in all shield configurations. */ +#elif defined(SHIELD_NONE) #define ShieldRaise(arena, seg, mode) \ BEGIN UNUSED(arena); UNUSED(seg); UNUSED(mode); END #define ShieldLower(arena, seg, mode) \ @@ -906,7 +910,9 @@ extern void (ShieldFlush)(Arena arena); #define ShieldSuspend(arena) BEGIN UNUSED(arena); END #define ShieldResume(arena) BEGIN UNUSED(arena); END #define ShieldFlush(arena) BEGIN UNUSED(arena); END -#endif /* DISABLE_SHIELD */ +#else +#error "No shield configuration." +#endif /* SHIELD */ /* Protection Interface diff --git a/mps/code/mps.c b/mps/code/mps.c index 2125d2d4a3c..200f63e894c 100644 --- a/mps/code/mps.c +++ b/mps/code/mps.c @@ -91,7 +91,7 @@ /* ANSI Plinth */ -#if !defined(PLINTH_NONE) /* see CONFIG_PLINTH_NONE in config.h */ +#if defined(PLINTH) /* see CONFIG_PLINTH_NONE in config.h */ #include "mpsliban.c" #include "mpsioan.c" #endif diff --git a/mps/code/seg.c b/mps/code/seg.c index dea2b7d7ff7..62a7397dfeb 100644 --- a/mps/code/seg.c +++ b/mps/code/seg.c @@ -309,12 +309,17 @@ void SegSetSummary(Seg seg, RefSet summary) AVERT(Seg, seg); AVER(summary == RefSetEMPTY || SegRankSet(seg) != RankSetEMPTY); -#ifdef DISABLE_REMEMBERED_SET +#if defined(REMEMBERED_SET) +/* Nothing to do. */ +#elif defined(REMEMBERED_SET_NONE) /* Without protection, we can't maintain the remembered set because there are writes we don't know about. TODO: rethink this when implementating control. */ summary = RefSetUNIV; -#endif +#else +#error "No remembered set configuration." +#endif /* REMEMBERED_SET */ + if (summary != SegSummary(seg)) seg->class->setSummary(seg, summary); }