diff options
| author | Nick Barnes | 2001-10-31 14:40:56 +0000 |
|---|---|---|
| committer | Nick Barnes | 2001-10-31 14:40:56 +0000 |
| commit | 7acfca905d76140f4cc0b09c9a12de237de364cd (patch) | |
| tree | 3ed8babfa3a73d30f29e08ca5d5adcda4ca4e826 /mps/code/mpmtypes.h | |
| parent | b7ce4893f9902d57cd67ac9a92fa6c3d5a8fc833 (diff) | |
| download | emacs-7acfca905d76140f4cc0b09c9a12de237de364cd.tar.gz emacs-7acfca905d76140f4cc0b09c9a12de237de364cd.zip | |
Branch imports for masters.
Copied from Perforce
Change: 23678
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code/mpmtypes.h')
| -rw-r--r-- | mps/code/mpmtypes.h | 439 |
1 files changed, 439 insertions, 0 deletions
diff --git a/mps/code/mpmtypes.h b/mps/code/mpmtypes.h new file mode 100644 index 00000000000..abf12d6b7b0 --- /dev/null +++ b/mps/code/mpmtypes.h | |||
| @@ -0,0 +1,439 @@ | |||
| 1 | /* impl.h.mpmtypes: MEMORY POOL MANAGER TYPES | ||
| 2 | * | ||
| 3 | * $HopeName: MMsrc!mpmtypes.h(trunk.89) $ | ||
| 4 | * Copyright (C) 2001 Harlequin Limited. All rights reserved. | ||
| 5 | * | ||
| 6 | * .design: design.mps.type | ||
| 7 | * | ||
| 8 | * .rationale: Types and type constants are almost all defined | ||
| 9 | * in this header, in advance of any declarations of prototypes | ||
| 10 | * or structures. This avoids difficulties in defining recursive | ||
| 11 | * data structures. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef mpmtypes_h | ||
| 15 | #define mpmtypes_h | ||
| 16 | |||
| 17 | #include "config.h" /* this must come first: it defines target options */ | ||
| 18 | #include "misc.h" /* miscellaneous non-specific bits and bobs */ | ||
| 19 | #include "mpslib.h" | ||
| 20 | |||
| 21 | #include <stdarg.h> | ||
| 22 | #include <stddef.h> | ||
| 23 | |||
| 24 | |||
| 25 | /* TYPES */ | ||
| 26 | |||
| 27 | typedef unsigned long Sig; /* design.mps.sig */ | ||
| 28 | typedef int Res; /* design.mps.type.res */ | ||
| 29 | |||
| 30 | typedef void (*Fun)(void); /* design.mps.type.fun */ | ||
| 31 | typedef MPS_T_WORD Word; /* design.mps.type.word */ | ||
| 32 | typedef unsigned char Byte; /* design.mps.type.byte */ | ||
| 33 | typedef struct AddrStruct *Addr; /* design.mps.type.addr */ | ||
| 34 | typedef Word Size; /* design.mps.type.size */ | ||
| 35 | typedef Word Count; /* design.mps.type.count */ | ||
| 36 | typedef Word Index; /* design.mps.type.index */ | ||
| 37 | typedef Word Align; /* design.mps.type.align */ | ||
| 38 | typedef unsigned Shift; /* design.mps.type.shift */ | ||
| 39 | typedef unsigned Serial; /* design.mps.type.serial */ | ||
| 40 | typedef Addr Ref; /* design.mps.type.ref */ | ||
| 41 | typedef void *Pointer; /* design.mps.type.pointer */ | ||
| 42 | |||
| 43 | typedef Word RefSet; /* design.mps.refset */ | ||
| 44 | typedef Word ZoneSet; /* design.mps.refset */ | ||
| 45 | typedef unsigned Rank; | ||
| 46 | typedef unsigned RankSet; | ||
| 47 | typedef unsigned RootMode; | ||
| 48 | typedef Size Epoch; /* design.mps.ld */ | ||
| 49 | typedef unsigned TraceId; /* design.mps.trace */ | ||
| 50 | typedef unsigned TraceSet; /* design.mps.trace */ | ||
| 51 | typedef unsigned TraceState; /* design.mps.trace */ | ||
| 52 | typedef unsigned AccessSet; /* design.mps.type.access-set */ | ||
| 53 | typedef unsigned Attr; /* design.mps.type.attr */ | ||
| 54 | typedef unsigned FormatVariety; | ||
| 55 | typedef int RootVar; /* design.mps.type.rootvar */ | ||
| 56 | |||
| 57 | typedef Word *BT; /* design.mps.bt */ | ||
| 58 | typedef struct BootBlockStruct *BootBlock; /* impl.c.boot */ | ||
| 59 | typedef struct BufferStruct *Buffer; /* design.mps.buffer */ | ||
| 60 | typedef struct SegBufStruct *SegBuf; /* design.mps.buffer */ | ||
| 61 | typedef struct BufferClassStruct *BufferClass; /* design.mps.buffer */ | ||
| 62 | typedef BufferClass SegBufClass; /* design.mps.buffer */ | ||
| 63 | typedef BufferClass RankBufClass; /* design.mps.buffer */ | ||
| 64 | typedef unsigned BufferMode; /* design.mps.buffer */ | ||
| 65 | typedef unsigned FrameState; /* design.mps.alloc-frame */ | ||
| 66 | typedef struct APStruct *AP; /* design.mps.buffer */ | ||
| 67 | typedef struct FormatStruct *Format; /* design.mps.format */ | ||
| 68 | typedef struct LDStruct *LD; /* design.mps.ld */ | ||
| 69 | typedef struct LockStruct *Lock; /* impl.c.lock* */ | ||
| 70 | typedef struct PoolStruct *Pool; /* design.mps.pool */ | ||
| 71 | typedef struct PoolClassStruct *PoolClass; /* impl.c.poolclas */ | ||
| 72 | typedef PoolClass AbstractPoolClass; /* impl.c.poolabs */ | ||
| 73 | typedef PoolClass AbstractAllocFreePoolClass; /* impl.c.poolabs */ | ||
| 74 | typedef PoolClass AbstractBufferPoolClass; /* impl.c.poolabs */ | ||
| 75 | typedef PoolClass AbstractSegBufPoolClass; /* impl.c.poolabs */ | ||
| 76 | typedef PoolClass AbstractScanPoolClass; /* impl.c.poolabs */ | ||
| 77 | typedef PoolClass AbstractCollectPoolClass; /* impl.c.poolabs */ | ||
| 78 | typedef struct TraceStruct *Trace; /* design.mps.trace */ | ||
| 79 | typedef struct ScanStateStruct *ScanState; /* design.mps.trace */ | ||
| 80 | typedef struct ChainStruct *Chain; /* design.mps.trace */ | ||
| 81 | typedef struct TractStruct *Tract; /* design.mps.arena */ | ||
| 82 | typedef struct ChunkStruct *Chunk; /* impl.c.tract */ | ||
| 83 | typedef struct ChunkCacheEntryStruct *ChunkCacheEntry; /* impl.c.tract */ | ||
| 84 | typedef struct PageStruct *Page; /* impl.c.tract */ | ||
| 85 | typedef struct SegStruct *Seg; /* impl.c.seg */ | ||
| 86 | typedef struct GCSegStruct *GCSeg; /* impl.c.seg */ | ||
| 87 | typedef struct SegClassStruct *SegClass; /* impl.c.seg */ | ||
| 88 | typedef SegClass GCSegClass; /* impl.c.seg */ | ||
| 89 | typedef struct SegPrefStruct *SegPref; /* design.mps.pref, impl.c.locus */ | ||
| 90 | typedef int SegPrefKind; /* design.mps.pref, impl.c.locus */ | ||
| 91 | typedef struct ArenaClassStruct *ArenaClass; /* design.mps.arena */ | ||
| 92 | typedef ArenaClass AbstractArenaClass; /* impl.c.arena */ | ||
| 93 | typedef struct ArenaStruct *Arena; /* design.mps.arena */ | ||
| 94 | typedef struct GlobalsStruct *Globals; /* design.mps.arena */ | ||
| 95 | typedef struct VMStruct *VM; /* impl.c.vm* */ | ||
| 96 | typedef struct RootStruct *Root; /* impl.c.root */ | ||
| 97 | typedef struct ThreadStruct *Thread; /* impl.c.th* */ | ||
| 98 | typedef struct MutatorFaultContextStruct | ||
| 99 | *MutatorFaultContext; /* design.mps.prot */ | ||
| 100 | typedef struct PoolDebugMixinStruct *PoolDebugMixin; | ||
| 101 | typedef struct AllocPatternStruct *AllocPattern; | ||
| 102 | typedef struct AllocFrameStruct *AllocFrame; /* design.mps.alloc-frame */ | ||
| 103 | typedef struct ReservoirStruct *Reservoir; /* design.mps.reservoir */ | ||
| 104 | |||
| 105 | |||
| 106 | /* Arena*Method -- see impl.h.mpmst.ArenaClassStruct */ | ||
| 107 | |||
| 108 | typedef Res (*ArenaInitMethod)(Arena *arenaReturn, | ||
| 109 | ArenaClass class, va_list args); | ||
| 110 | typedef void (*ArenaFinishMethod)(Arena arena); | ||
| 111 | typedef Size (*ArenaReservedMethod)(Arena arena); | ||
| 112 | typedef void (*ArenaSpareCommitExceededMethod)(Arena arena); | ||
| 113 | typedef Res (*ArenaExtendMethod)(Arena arena, Addr base, Size size); | ||
| 114 | typedef Res (*ArenaAllocMethod)(Addr *baseReturn, Tract *baseTractReturn, | ||
| 115 | SegPref pref, Size size, Pool pool); | ||
| 116 | typedef void (*ArenaFreeMethod)(Addr base, Size size, Pool pool); | ||
| 117 | typedef Res (*ArenaChunkInitMethod)(Chunk chunk, BootBlock boot); | ||
| 118 | typedef void (*ArenaChunkFinishMethod)(Chunk chunk); | ||
| 119 | typedef Res (*ArenaDescribeMethod)(Arena arena, mps_lib_FILE *stream); | ||
| 120 | |||
| 121 | |||
| 122 | /* Messages | ||
| 123 | * | ||
| 124 | * See design.mps.message | ||
| 125 | */ | ||
| 126 | |||
| 127 | typedef unsigned MessageType; | ||
| 128 | typedef struct MessageStruct *Message; | ||
| 129 | typedef struct MessageClassStruct *MessageClass; | ||
| 130 | |||
| 131 | |||
| 132 | /* TraceFixMethod */ | ||
| 133 | |||
| 134 | typedef Res (*TraceFixMethod)(ScanState ss, Ref *refIO); | ||
| 135 | |||
| 136 | |||
| 137 | /* Heap Walker */ | ||
| 138 | |||
| 139 | /* This type is used by the PoolClass method Walk */ | ||
| 140 | typedef void (*FormattedObjectsStepMethod)(Addr, Format, Pool, | ||
| 141 | void *, Size); | ||
| 142 | |||
| 143 | /* Seg*Method -- see design.mps.seg */ | ||
| 144 | |||
| 145 | typedef Res (*SegInitMethod)(Seg seg, Pool pool, Addr base, Size size, | ||
| 146 | Bool withReservoirPermit, va_list args); | ||
| 147 | typedef void (*SegFinishMethod)(Seg seg); | ||
| 148 | typedef void (*SegSetGreyMethod)(Seg seg, TraceSet grey); | ||
| 149 | typedef void (*SegSetWhiteMethod)(Seg seg, TraceSet white); | ||
| 150 | typedef void (*SegSetRankSetMethod)(Seg seg, RankSet rankSet); | ||
| 151 | typedef void (*SegSetRankSummaryMethod)(Seg seg, RankSet rankSet, | ||
| 152 | RefSet summary); | ||
| 153 | typedef void (*SegSetSummaryMethod)(Seg seg, RefSet summary); | ||
| 154 | typedef Buffer (*SegBufferMethod)(Seg seg); | ||
| 155 | typedef void (*SegSetBufferMethod)(Seg seg, Buffer buffer); | ||
| 156 | typedef Res (*SegDescribeMethod)(Seg seg, mps_lib_FILE *stream); | ||
| 157 | typedef Res (*SegMergeMethod)(Seg seg, Seg segHi, | ||
| 158 | Addr base, Addr mid, Addr limit, | ||
| 159 | Bool withReservoirPermit, va_list args); | ||
| 160 | typedef Res (*SegSplitMethod)(Seg seg, Seg segHi, | ||
| 161 | Addr base, Addr mid, Addr limit, | ||
| 162 | Bool withReservoirPermit, va_list args); | ||
| 163 | |||
| 164 | /* Buffer*Method -- see design.mps.buffer */ | ||
| 165 | |||
| 166 | typedef Res (*BufferInitMethod)(Buffer buffer, Pool pool, va_list args); | ||
| 167 | typedef void (*BufferFinishMethod)(Buffer buffer); | ||
| 168 | typedef void (*BufferAttachMethod)(Buffer buffer, Addr base, Addr limit, | ||
| 169 | Addr init, Size size); | ||
| 170 | typedef void (*BufferDetachMethod)(Buffer buffer); | ||
| 171 | typedef Seg (*BufferSegMethod)(Buffer buffer); | ||
| 172 | typedef RankSet (*BufferRankSetMethod)(Buffer buffer); | ||
| 173 | typedef void (*BufferSetRankSetMethod)(Buffer buffer, RankSet rankSet); | ||
| 174 | typedef void (*BufferReassignSegMethod)(Buffer buffer, Seg seg); | ||
| 175 | typedef Res (*BufferDescribeMethod)(Buffer buffer, mps_lib_FILE *stream); | ||
| 176 | |||
| 177 | |||
| 178 | /* Pool*Method -- see design.mps.class-interface */ | ||
| 179 | |||
| 180 | /* Order of types corresponds to PoolClassStruct in impl.h.mpmst */ | ||
| 181 | |||
| 182 | typedef Res (*PoolInitMethod)(Pool pool, va_list args); | ||
| 183 | typedef void (*PoolFinishMethod)(Pool pool); | ||
| 184 | typedef Res (*PoolAllocMethod)(Addr *pReturn, Pool pool, Size size, | ||
| 185 | Bool withReservoirPermit); | ||
| 186 | typedef void (*PoolFreeMethod)(Pool pool, Addr old, Size size); | ||
| 187 | typedef Res (*PoolBufferFillMethod)(Addr *baseReturn, Addr *limitReturn, | ||
| 188 | Pool pool, Buffer buffer, Size size, | ||
| 189 | Bool withReservoirPermit); | ||
| 190 | typedef void (*PoolBufferEmptyMethod)(Pool pool, Buffer buffer, | ||
| 191 | Addr init, Addr limit); | ||
| 192 | typedef Res (*PoolTraceBeginMethod)(Pool pool, Trace trace); | ||
| 193 | typedef Res (*PoolAccessMethod)(Pool pool, Seg seg, Addr addr, | ||
| 194 | AccessSet mode, MutatorFaultContext context); | ||
| 195 | typedef Res (*PoolWhitenMethod)(Pool pool, Trace trace, Seg seg); | ||
| 196 | typedef void (*PoolGreyMethod)(Pool pool, Trace trace, Seg seg); | ||
| 197 | typedef void (*PoolBlackenMethod)(Pool pool, TraceSet traceSet, Seg seg); | ||
| 198 | typedef Res (*PoolScanMethod)(Bool *totalReturn, ScanState ss, | ||
| 199 | Pool pool, Seg seg); | ||
| 200 | typedef Res (*PoolFixMethod)(Pool pool, ScanState ss, Seg seg, | ||
| 201 | Ref *refIO); | ||
| 202 | typedef Res (*PoolFixEmergencyMethod)(Pool pool, ScanState ss, | ||
| 203 | Seg seg, Ref *refIO); | ||
| 204 | typedef void (*PoolReclaimMethod)(Pool pool, Trace trace, Seg seg); | ||
| 205 | typedef void (*PoolRampBeginMethod)(Pool pool, Buffer buf, Bool collectAll); | ||
| 206 | typedef void (*PoolRampEndMethod)(Pool pool, Buffer buf); | ||
| 207 | typedef Res (*PoolFramePushMethod)(AllocFrame *frameReturn, | ||
| 208 | Pool pool, Buffer buf); | ||
| 209 | typedef Res (*PoolFramePopMethod)(Pool pool, Buffer buf, | ||
| 210 | AllocFrame frame); | ||
| 211 | typedef void (*PoolFramePopPendingMethod)(Pool pool, Buffer buf, | ||
| 212 | AllocFrame frame); | ||
| 213 | typedef void (*PoolWalkMethod)(Pool pool, Seg seg, | ||
| 214 | FormattedObjectsStepMethod f, | ||
| 215 | void *p, unsigned long s); | ||
| 216 | typedef BufferClass (*PoolBufferClassMethod)(void); | ||
| 217 | typedef Res (*PoolDescribeMethod)(Pool pool, mps_lib_FILE *stream); | ||
| 218 | typedef PoolDebugMixin (*PoolDebugMixinMethod)(Pool pool); | ||
| 219 | |||
| 220 | |||
| 221 | /* Message*Method -- design.mps.message */ | ||
| 222 | |||
| 223 | typedef void (*MessageDeleteMethod)(Message message); | ||
| 224 | typedef void (*MessageFinalizationRefMethod) | ||
| 225 | (Ref *refReturn, Arena arena, Message message); | ||
| 226 | typedef Size (*MessageGCLiveSizeMethod)(Message message); | ||
| 227 | typedef Size (*MessageGCCondemnedSizeMethod)(Message message); | ||
| 228 | typedef Size (*MessageGCNotCondemnedSizeMethod)(Message message); | ||
| 229 | |||
| 230 | |||
| 231 | /* Message Types -- design.mps.message and elsewhere */ | ||
| 232 | |||
| 233 | typedef struct MessageFinalizationStruct *MessageFinalization; | ||
| 234 | |||
| 235 | |||
| 236 | /* Format*Method -- see design.mps.format-interface */ | ||
| 237 | /* .fmt-methods: These methods must match those defined in the */ | ||
| 238 | /* MPS C Interface. (See impl.h.mps.fmt-methods.) */ | ||
| 239 | |||
| 240 | typedef Res (*FormatScanMethod)(ScanState ss, Addr base, Addr limit); | ||
| 241 | typedef Addr (*FormatSkipMethod)(Addr object); | ||
| 242 | typedef void (*FormatMoveMethod)(Addr object, Addr to); | ||
| 243 | typedef Addr (*FormatIsMovedMethod)(Addr object); | ||
| 244 | typedef void (*FormatCopyMethod)(Addr object, Addr to); | ||
| 245 | typedef void (*FormatPadMethod)(Addr base, Size size); | ||
| 246 | typedef Addr (*FormatClassMethod)(Addr object); | ||
| 247 | |||
| 248 | |||
| 249 | /* Root*Method -- see design.mps.root-interface */ | ||
| 250 | /* .root-methods: These methods must match those defined in the */ | ||
| 251 | /* MPS C Interface. (See impl.h.mps.root-methods.) */ | ||
| 252 | |||
| 253 | typedef Res (*RootScanMethod)(ScanState ss, void *p, size_t s); | ||
| 254 | typedef Res (*RootScanRegMethod)(ScanState ss, Thread thread, void *p, size_t s); | ||
| 255 | |||
| 256 | |||
| 257 | /* CONSTANTS */ | ||
| 258 | |||
| 259 | |||
| 260 | /* design.mps.sig SIGnature IS BAD */ | ||
| 261 | #define SigInvalid ((Sig)0x51915BAD) | ||
| 262 | |||
| 263 | #define SizeMAX ((Size)-1) | ||
| 264 | #define AccessSetEMPTY ((AccessSet)0) /* design.mps.type.access-set */ | ||
| 265 | #define AccessREAD ((AccessSet)(1<<0)) | ||
| 266 | #define AccessWRITE ((AccessSet)(1<<1)) | ||
| 267 | #define AccessSetWIDTH (2) | ||
| 268 | #define RefSetEMPTY BS_EMPTY(RefSet) | ||
| 269 | #define RefSetUNIV BS_UNIV(RefSet) | ||
| 270 | #define ZoneSetEMPTY BS_EMPTY(ZoneSet) | ||
| 271 | #define ZoneSetUNIV BS_UNIV(ZoneSet) | ||
| 272 | #define TraceSetEMPTY BS_EMPTY(TraceSet) | ||
| 273 | #define TraceSetUNIV ((TraceSet)((1u << TraceLIMIT) - 1)) | ||
| 274 | #define RankSetEMPTY BS_EMPTY(RankSet) | ||
| 275 | #define RankSetUNIV ((RankSet)((1u << RankLIMIT) - 1)) | ||
| 276 | #define AttrFMT ((Attr)(1<<0)) /* design.mps.type.attr */ | ||
| 277 | #define AttrSCAN ((Attr)(1<<1)) | ||
| 278 | #define AttrPM_NO_READ ((Attr)(1<<2)) | ||
| 279 | #define AttrPM_NO_WRITE ((Attr)(1<<3)) | ||
| 280 | #define AttrALLOC ((Attr)(1<<4)) | ||
| 281 | #define AttrFREE ((Attr)(1<<5)) | ||
| 282 | #define AttrBUF ((Attr)(1<<6)) | ||
| 283 | #define AttrBUF_RESERVE ((Attr)(1<<7)) | ||
| 284 | #define AttrBUF_ALLOC ((Attr)(1<<8)) | ||
| 285 | #define AttrGC ((Attr)(1<<9)) | ||
| 286 | #define AttrINCR_RB ((Attr)(1<<10)) | ||
| 287 | #define AttrINCR_WB ((Attr)(1<<11)) | ||
| 288 | #define AttrMOVINGGC ((Attr)(1<<12)) | ||
| 289 | #define AttrMASK (AttrFMT | AttrSCAN | AttrPM_NO_READ | \ | ||
| 290 | AttrPM_NO_WRITE | AttrALLOC | AttrFREE | \ | ||
| 291 | AttrBUF | AttrBUF_RESERVE | AttrBUF_ALLOC | \ | ||
| 292 | AttrGC | AttrINCR_RB | AttrINCR_WB | AttrMOVINGGC) | ||
| 293 | |||
| 294 | |||
| 295 | /* Format varieties */ | ||
| 296 | enum { | ||
| 297 | FormatVarietyA = 1, | ||
| 298 | FormatVarietyB, | ||
| 299 | FormatVarietyAutoHeader, | ||
| 300 | FormatVarietyLIMIT | ||
| 301 | }; | ||
| 302 | |||
| 303 | |||
| 304 | /* Segment preferences */ | ||
| 305 | enum { | ||
| 306 | SegPrefHigh = 1, | ||
| 307 | SegPrefLow, | ||
| 308 | SegPrefZoneSet, | ||
| 309 | SegPrefGen, | ||
| 310 | SegPrefCollected, | ||
| 311 | SegPrefLIMIT | ||
| 312 | }; | ||
| 313 | |||
| 314 | |||
| 315 | /* Buffer modes */ | ||
| 316 | #define BufferModeATTACHED ((BufferMode)(1<<0)) | ||
| 317 | #define BufferModeFLIPPED ((BufferMode)(1<<1)) | ||
| 318 | #define BufferModeLOGGED ((BufferMode)(1<<2)) | ||
| 319 | #define BufferModeTRANSITION ((BufferMode)(1<<3)) | ||
| 320 | |||
| 321 | |||
| 322 | /* Buffer frame states. See design.mps.alloc-frame.lw-frame.states */ | ||
| 323 | enum { | ||
| 324 | BufferFrameVALID = 1, | ||
| 325 | BufferFramePOP_PENDING, | ||
| 326 | BufferFrameDISABLED | ||
| 327 | }; | ||
| 328 | |||
| 329 | |||
| 330 | /* Rank constants -- see design.mps.type.rank */ | ||
| 331 | /* These definitions must match impl.h.mps.rank. */ | ||
| 332 | /* This is checked by impl.c.mpsi.check. */ | ||
| 333 | |||
| 334 | enum { | ||
| 335 | RankAMBIG = 0, | ||
| 336 | RankEXACT = 1, | ||
| 337 | RankFINAL = 2, | ||
| 338 | RankWEAK = 3, | ||
| 339 | RankLIMIT | ||
| 340 | }; | ||
| 341 | |||
| 342 | |||
| 343 | /* Root Modes -- not implemented */ | ||
| 344 | /* .rm: Synchronize with impl.h.mps.rm. */ | ||
| 345 | /* This comment exists as a placeholder for when root modes are */ | ||
| 346 | /* implemented. */ | ||
| 347 | |||
| 348 | #define RootModeCONSTANT ((RootMode)1<<0) | ||
| 349 | #define RootModePROTECTABLE ((RootMode)1<<1) | ||
| 350 | #define RootModePROTECTABLE_INNER ((RootMode)1<<2) | ||
| 351 | |||
| 352 | |||
| 353 | /* Root Variants -- see design.mps.type.rootvar | ||
| 354 | * | ||
| 355 | * .rootvar: Synchonize with impl.c.root.rootvarcheck | ||
| 356 | */ | ||
| 357 | |||
| 358 | enum { | ||
| 359 | RootFUN, | ||
| 360 | RootTABLE, | ||
| 361 | RootTABLE_MASKED, | ||
| 362 | RootREG, | ||
| 363 | RootFMT, | ||
| 364 | RootLIMIT | ||
| 365 | }; | ||
| 366 | |||
| 367 | |||
| 368 | /* .result-codes: Result Codes -- see design.mps.type.res */ | ||
| 369 | /* These definitions must match impl.h.mps.result-codes. */ | ||
| 370 | /* This is checked by impl.c.mpsi.check.rc. */ | ||
| 371 | /* Changing this list entails changing the list in */ | ||
| 372 | /* impl.h.mps.result-codes and the check in impl.c.mpsi.check.rc */ | ||
| 373 | |||
| 374 | enum { | ||
| 375 | ResOK = 0, | ||
| 376 | ResFAIL, | ||
| 377 | ResRESOURCE, | ||
| 378 | ResMEMORY, | ||
| 379 | ResLIMIT, | ||
| 380 | ResUNIMPL, | ||
| 381 | ResIO, | ||
| 382 | ResCOMMIT_LIMIT, | ||
| 383 | ResPARAM | ||
| 384 | }; | ||
| 385 | |||
| 386 | |||
| 387 | /* TraceStates -- see design.mps.trace */ | ||
| 388 | |||
| 389 | enum { | ||
| 390 | TraceINIT = 1, | ||
| 391 | TraceUNFLIPPED, | ||
| 392 | TraceFLIPPED, | ||
| 393 | TraceRECLAIM, | ||
| 394 | TraceFINISHED | ||
| 395 | }; | ||
| 396 | |||
| 397 | |||
| 398 | /* MessageTypes -- see design.mps.message */ | ||
| 399 | /* .message.types: Keep in sync with impl.h.mps.message.types */ | ||
| 400 | |||
| 401 | enum { | ||
| 402 | MessageTypeFINALIZATION, | ||
| 403 | MessageTypeGC, | ||
| 404 | MessageTypeLIMIT | ||
| 405 | }; | ||
| 406 | |||
| 407 | |||
| 408 | /* Types for WriteF formats */ | ||
| 409 | /* These should be used with calls to WriteF. */ | ||
| 410 | /* These must be unpromotable types. */ | ||
| 411 | |||
| 412 | typedef Addr WriteFA; | ||
| 413 | typedef Pointer WriteFP; | ||
| 414 | typedef const char *WriteFS; | ||
| 415 | typedef Word WriteFW; | ||
| 416 | typedef unsigned long WriteFU; | ||
| 417 | typedef unsigned long WriteFB; | ||
| 418 | typedef void *(*WriteFF)(void); | ||
| 419 | typedef int WriteFC; /* Promoted */ | ||
| 420 | typedef double WriteFD; | ||
| 421 | |||
| 422 | |||
| 423 | /* STATISTIC_DECL -- declare a field to accumulate statistics in | ||
| 424 | * | ||
| 425 | * The argument is a field declaration (a struct-declaration minus the | ||
| 426 | * semicolon) for a single field (no commas). Currently, we always | ||
| 427 | * leave them in, see design.mps.metrics. | ||
| 428 | */ | ||
| 429 | |||
| 430 | #if defined(DIAGNOSTICS) | ||
| 431 | #define STATISTIC_DECL(field) field | ||
| 432 | #elif defined(DIAGNOSTICS_NONE) | ||
| 433 | #define STATISTIC_DECL(field) field | ||
| 434 | #else | ||
| 435 | #error "No diagnostics configured." | ||
| 436 | #endif | ||
| 437 | |||
| 438 | |||
| 439 | #endif /* mpmtypes_h */ | ||