home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / Memory.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  17.1 KB  |  659 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Memory.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __MEMORY__
  18. #define __MEMORY__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __MIXEDMODE__
  27. #include <MixedMode.h>
  28. #endif
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. #if GENERATINGPOWERPC
  35. #pragma options align=mac68k
  36. #endif
  37.  
  38. #ifdef __CFM68K__
  39. #pragma lib_export on
  40. #endif
  41.  
  42.  
  43. enum {
  44.     maxSize                        = 0x800000,                        /*Max data block size is 8 megabytes*/
  45.     defaultPhysicalEntryCount    = 8,
  46. /* values returned from the GetPageState function */
  47.     kPageInMemory                = 0,
  48.     kPageOnDisk                    = 1,
  49.     kNotPaged                    = 2
  50. };
  51.  
  52. enum {
  53. /* masks for Zone->heapType field */
  54.     k32BitHeap                    = 1,                            /* valid in all Memory Managers */
  55.     kNewStyleHeap                = 2,                            /* true if new Heap Manager is present */
  56.     kNewDebugHeap                = 4                                /* true if new Heap Manager is running in debug mode on this heap */
  57. };
  58.  
  59. /* size of a block in bytes */
  60. typedef long Size;
  61.  
  62. typedef pascal long (*GrowZoneProcPtr)(Size cbNeeded);
  63. typedef pascal void (*PurgeProcPtr)(Handle blockToPurge);
  64. /*
  65.         UserFnProcPtr uses register based parameters on the 68k and cannot
  66.         be written in or called from a high-level language without the help of
  67.         mixed mode or assembly glue.
  68.  
  69.         In:
  70.          => *parameter      A0.L
  71. */
  72.  
  73. #if GENERATINGCFM
  74. typedef UniversalProcPtr GrowZoneUPP;
  75. typedef UniversalProcPtr PurgeUPP;
  76. typedef UniversalProcPtr UserFnUPP;
  77. #else
  78. typedef GrowZoneProcPtr GrowZoneUPP;
  79. typedef PurgeProcPtr PurgeUPP;
  80. typedef Register68kProcPtr UserFnUPP;
  81. #endif
  82.  
  83. typedef struct Zone Zone, *THz;
  84.  
  85. struct Zone {
  86.     Ptr                                bkLim;
  87.     Ptr                                purgePtr;
  88.     Ptr                                hFstFree;
  89.     long                            zcbFree;
  90.     GrowZoneUPP                        gzProc;
  91.     short                            moreMast;
  92.     short                            flags;
  93.     short                            cntRel;
  94.     short                            maxRel;
  95.     short                            cntNRel;
  96.     Byte                            heapType;
  97.     Byte                            unused;
  98.     short                            cntEmpty;
  99.     short                            cntHandles;
  100.     long                            minCBFree;
  101.     PurgeUPP                        purgeProc;
  102.     Ptr                                sparePtr;
  103.     Ptr                                allocPtr;
  104.     short                            heapData;
  105. };
  106. struct MemoryBlock {
  107.     void                            *address;
  108.     unsigned long                    count;
  109. };
  110. typedef struct MemoryBlock MemoryBlock;
  111.  
  112. struct LogicalToPhysicalTable {
  113.     MemoryBlock                        logical;
  114.     MemoryBlock                        physical[defaultPhysicalEntryCount];
  115. };
  116. typedef struct LogicalToPhysicalTable LogicalToPhysicalTable;
  117.  
  118. typedef short PageState;
  119.  
  120. typedef short StatusRegisterContents;
  121.  
  122. enum {
  123.     uppGrowZoneProcInfo = kPascalStackBased
  124.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  125.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Size))),
  126.     uppPurgeProcInfo = kPascalStackBased
  127.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle))),
  128.     uppUserFnProcInfo = kRegisterBased
  129.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(void*)))
  130. };
  131.  
  132. #if GENERATINGCFM
  133. #define NewGrowZoneProc(userRoutine)        \
  134.         (GrowZoneUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppGrowZoneProcInfo, GetCurrentArchitecture())
  135. #define NewPurgeProc(userRoutine)        \
  136.         (PurgeUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppPurgeProcInfo, GetCurrentArchitecture())
  137. #define NewUserFnProc(userRoutine)        \
  138.         (UserFnUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserFnProcInfo, GetCurrentArchitecture())
  139. #else
  140. #define NewGrowZoneProc(userRoutine)        \
  141.         ((GrowZoneUPP) (userRoutine))
  142. #define NewPurgeProc(userRoutine)        \
  143.         ((PurgeUPP) (userRoutine))
  144. #define NewUserFnProc(userRoutine)        \
  145.         ((UserFnUPP) (userRoutine))
  146. #endif
  147.  
  148. #if GENERATINGCFM
  149. #define CallGrowZoneProc(userRoutine, cbNeeded)        \
  150.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppGrowZoneProcInfo, (cbNeeded))
  151. #define CallPurgeProc(userRoutine, blockToPurge)        \
  152.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppPurgeProcInfo, (blockToPurge))
  153. #define CallUserFnProc(userRoutine, parameter)        \
  154.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppUserFnProcInfo, (parameter))
  155. #else
  156. #define CallGrowZoneProc(userRoutine, cbNeeded)        \
  157.         (*(userRoutine))((cbNeeded))
  158. #define CallPurgeProc(userRoutine, blockToPurge)        \
  159.         (*(userRoutine))((blockToPurge))
  160. /* (*UserFnProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  161. #endif
  162.  
  163. extern pascal Ptr GetApplLimit( void )
  164.     TWOWORDINLINE( 0x2EB8, 0x0130 ); /* MOVE.L $0130,(SP) */
  165. extern pascal THz SystemZone( void )
  166.     TWOWORDINLINE( 0x2EB8, 0x02A6 ); /* MOVE.L $02A6,(SP) */
  167. extern pascal THz ApplicationZone( void )
  168.     TWOWORDINLINE( 0x2EB8, 0x02AA ); /* MOVE.L $02AA,(SP) */
  169. extern pascal Handle GZSaveHnd( void )
  170.     TWOWORDINLINE( 0x2EB8, 0x0328 ); /* MOVE.L $0328,(SP) */
  171. extern pascal Ptr TopMem( void )
  172.     TWOWORDINLINE( 0x2EB8, 0x0108 ); /* MOVE.L $0108,(SP) */
  173. extern pascal OSErr MemError( void )
  174.     TWOWORDINLINE( 0x3EB8, 0x0220 ); /* MOVE.W $0220,(SP) */
  175.  
  176. #if !GENERATINGCFM
  177. #pragma parameter __A0 GetZone
  178. #endif
  179. extern pascal THz GetZone(void)
  180.  ONEWORDINLINE(0xA11A);
  181.  
  182. #if !GENERATINGCFM
  183. #pragma parameter __A0 NewHandle(__D0)
  184. #endif
  185. extern pascal Handle NewHandle(Size byteCount)
  186.  ONEWORDINLINE(0xA122);
  187.  
  188. #if !GENERATINGCFM
  189. #pragma parameter __A0 NewHandleSys(__D0)
  190. #endif
  191. extern pascal Handle NewHandleSys(Size byteCount)
  192.  ONEWORDINLINE(0xA522);
  193.  
  194. #if !GENERATINGCFM
  195. #pragma parameter __A0 NewHandleClear(__D0)
  196. #endif
  197. extern pascal Handle NewHandleClear(Size byteCount)
  198.  ONEWORDINLINE(0xA322);
  199.  
  200. #if !GENERATINGCFM
  201. #pragma parameter __A0 NewHandleSysClear(__D0)
  202. #endif
  203. extern pascal Handle NewHandleSysClear(Size byteCount)
  204.  ONEWORDINLINE(0xA722);
  205.  
  206. #if !GENERATINGCFM
  207. #pragma parameter __A0 HandleZone(__A0)
  208. #endif
  209. extern pascal THz HandleZone(Handle h)
  210.  ONEWORDINLINE(0xA126);
  211.  
  212. #if !GENERATINGCFM
  213. #pragma parameter __A0 RecoverHandle(__A0)
  214. #endif
  215. extern pascal Handle RecoverHandle(Ptr p)
  216.  ONEWORDINLINE(0xA128);
  217.  
  218. #if !GENERATINGCFM
  219. #pragma parameter __A0 RecoverHandleSys(__A0)
  220. #endif
  221. extern pascal Handle RecoverHandleSys(Ptr p)
  222.  ONEWORDINLINE(0xA528);
  223.  
  224. #if !GENERATINGCFM
  225. #pragma parameter __A0 NewPtr(__D0)
  226. #endif
  227. extern pascal Ptr NewPtr(Size byteCount)
  228.  ONEWORDINLINE(0xA11E);
  229.  
  230. #if !GENERATINGCFM
  231. #pragma parameter __A0 NewPtrSys(__D0)
  232. #endif
  233. extern pascal Ptr NewPtrSys(Size byteCount)
  234.  ONEWORDINLINE(0xA51E);
  235.  
  236. #if !GENERATINGCFM
  237. #pragma parameter __A0 NewPtrClear(__D0)
  238. #endif
  239. extern pascal Ptr NewPtrClear(Size byteCount)
  240.  ONEWORDINLINE(0xA31E);
  241.  
  242. #if !GENERATINGCFM
  243. #pragma parameter __A0 NewPtrSysClear(__D0)
  244. #endif
  245. extern pascal Ptr NewPtrSysClear(Size byteCount)
  246.  ONEWORDINLINE(0xA71E);
  247.  
  248. #if !GENERATINGCFM
  249. #pragma parameter __A0 PtrZone(__A0)
  250. #endif
  251. extern pascal THz PtrZone(Ptr p)
  252.  ONEWORDINLINE(0xA148);
  253.  
  254. #if !GENERATINGCFM
  255. #pragma parameter __D0 MaxBlock
  256. #endif
  257. extern pascal long MaxBlock(void)
  258.  ONEWORDINLINE(0xA061);
  259.  
  260. #if !GENERATINGCFM
  261. #pragma parameter __D0 MaxBlockSys
  262. #endif
  263. extern pascal long MaxBlockSys(void)
  264.  ONEWORDINLINE(0xA461);
  265.  
  266. #if !GENERATINGCFM
  267. #pragma parameter __D0 StackSpace
  268. #endif
  269. extern pascal long StackSpace(void)
  270.  ONEWORDINLINE(0xA065);
  271.  
  272. #if !GENERATINGCFM
  273. #pragma parameter __A0 NewEmptyHandle
  274. #endif
  275. extern pascal Handle NewEmptyHandle(void)
  276.  ONEWORDINLINE(0xA166);
  277.  
  278. #if !GENERATINGCFM
  279. #pragma parameter __A0 NewEmptyHandleSys
  280. #endif
  281. extern pascal Handle NewEmptyHandleSys(void)
  282.  ONEWORDINLINE(0xA566);
  283.  
  284. #if !GENERATINGCFM
  285. #pragma parameter HLock(__A0)
  286. #endif
  287. extern pascal void HLock(Handle h)
  288.  ONEWORDINLINE(0xA029);
  289.  
  290. #if !GENERATINGCFM
  291. #pragma parameter HUnlock(__A0)
  292. #endif
  293. extern pascal void HUnlock(Handle h)
  294.  ONEWORDINLINE(0xA02A);
  295.  
  296. #if !GENERATINGCFM
  297. #pragma parameter HPurge(__A0)
  298. #endif
  299. extern pascal void HPurge(Handle h)
  300.  ONEWORDINLINE(0xA049);
  301.  
  302. #if !GENERATINGCFM
  303. #pragma parameter HNoPurge(__A0)
  304. #endif
  305. extern pascal void HNoPurge(Handle h)
  306.  ONEWORDINLINE(0xA04A);
  307.  
  308. #if !GENERATINGCFM
  309. #pragma parameter HLockHi(__A0)
  310. #endif
  311. extern pascal void HLockHi(Handle h)
  312.  TWOWORDINLINE(0xA064, 0xA029);
  313. extern pascal Handle TempNewHandle(Size logicalSize, OSErr *resultCode)
  314.  THREEWORDINLINE(0x3F3C, 0x001D, 0xA88F);
  315. extern pascal Size TempMaxMem(Size *grow)
  316.  THREEWORDINLINE(0x3F3C, 0x0015, 0xA88F);
  317. extern pascal long TempFreeMem(void)
  318.  THREEWORDINLINE(0x3F3C, 0x0018, 0xA88F);
  319. /*  Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  */
  320. extern pascal void TempHLock(Handle h, OSErr *resultCode)
  321.  THREEWORDINLINE(0x3F3C, 0x001E, 0xA88F);
  322. extern pascal void TempHUnlock(Handle h, OSErr *resultCode)
  323.  THREEWORDINLINE(0x3F3C, 0x001F, 0xA88F);
  324. extern pascal void TempDisposeHandle(Handle h, OSErr *resultCode)
  325.  THREEWORDINLINE(0x3F3C, 0x0020, 0xA88F);
  326. extern pascal Ptr TempTopMem(void)
  327.  THREEWORDINLINE(0x3F3C, 0x0016, 0xA88F);
  328. extern pascal void InitApplZone(void)
  329.  ONEWORDINLINE(0xA02C);
  330. extern pascal void InitZone(GrowZoneUPP pgrowZone, short cmoreMasters, void *limitPtr, void *startPtr);
  331.  
  332. #if !GENERATINGCFM
  333. #pragma parameter SetZone(__A0)
  334. #endif
  335. extern pascal void SetZone(THz hz)
  336.  ONEWORDINLINE(0xA01B);
  337.  
  338. #if !GENERATINGCFM
  339. #pragma parameter __D0 CompactMem(__D0)
  340. #endif
  341. extern pascal Size CompactMem(Size cbNeeded)
  342.  ONEWORDINLINE(0xA04C);
  343.  
  344. #if !GENERATINGCFM
  345. #pragma parameter __D0 CompactMemSys(__D0)
  346. #endif
  347. extern pascal Size CompactMemSys(Size cbNeeded)
  348.  ONEWORDINLINE(0xA44C);
  349.  
  350. #if !GENERATINGCFM
  351. #pragma parameter PurgeMem(__D0)
  352. #endif
  353. extern pascal void PurgeMem(Size cbNeeded)
  354.  ONEWORDINLINE(0xA04D);
  355.  
  356. #if !GENERATINGCFM
  357. #pragma parameter PurgeMemSys(__D0)
  358. #endif
  359. extern pascal void PurgeMemSys(Size cbNeeded)
  360.  ONEWORDINLINE(0xA44D);
  361.  
  362. #if !GENERATINGCFM
  363. #pragma parameter __D0 FreeMem
  364. #endif
  365. extern pascal long FreeMem(void)
  366.  ONEWORDINLINE(0xA01C);
  367.  
  368. #if !GENERATINGCFM
  369. #pragma parameter __D0 FreeMemSys
  370. #endif
  371. extern pascal long FreeMemSys(void)
  372.  ONEWORDINLINE(0xA41C);
  373.  
  374. #if !GENERATINGCFM
  375. #pragma parameter ReserveMem(__D0)
  376. #endif
  377. extern pascal void ReserveMem(Size cbNeeded)
  378.  ONEWORDINLINE(0xA040);
  379.  
  380. #if !GENERATINGCFM
  381. #pragma parameter ReserveMemSys(__D0)
  382. #endif
  383. extern pascal void ReserveMemSys(Size cbNeeded)
  384.  ONEWORDINLINE(0xA440);
  385.  
  386. #if !GENERATINGCFM
  387. #pragma parameter __D0 MaxMem(__A1)
  388. #endif
  389. extern pascal Size MaxMem(Size *grow)
  390.  TWOWORDINLINE(0xA11D, 0x2288);
  391.  
  392. #if !GENERATINGCFM
  393. #pragma parameter __D0 MaxMemSys(__A1)
  394. #endif
  395. extern pascal Size MaxMemSys(Size *grow)
  396.  TWOWORDINLINE(0xA51D, 0x2288);
  397.  
  398. #if !GENERATINGCFM
  399. #pragma parameter SetGrowZone(__A0)
  400. #endif
  401. extern pascal void SetGrowZone(GrowZoneUPP growZone)
  402.  ONEWORDINLINE(0xA04B);
  403.  
  404. #if !GENERATINGCFM
  405. #pragma parameter SetApplLimit(__A0)
  406. #endif
  407. extern pascal void SetApplLimit(void *zoneLimit)
  408.  ONEWORDINLINE(0xA02D);
  409.  
  410. #if !GENERATINGCFM
  411. #pragma parameter MoveHHi(__A0)
  412. #endif
  413. extern pascal void MoveHHi(Handle h)
  414.  ONEWORDINLINE(0xA064);
  415.  
  416. #if !GENERATINGCFM
  417. #pragma parameter DisposePtr(__A0)
  418. #endif
  419. extern pascal void DisposePtr(Ptr p)
  420.  ONEWORDINLINE(0xA01F);
  421. extern pascal Size GetPtrSize(Ptr p);
  422.  
  423. #if !GENERATINGCFM
  424. #pragma parameter SetPtrSize(__A0, __D0)
  425. #endif
  426. extern pascal void SetPtrSize(Ptr p, Size newSize)
  427.  ONEWORDINLINE(0xA020);
  428.  
  429. #if !GENERATINGCFM
  430. #pragma parameter DisposeHandle(__A0)
  431. #endif
  432. extern pascal void DisposeHandle(Handle h)
  433.  ONEWORDINLINE(0xA023);
  434.  
  435. #if !GENERATINGCFM
  436. #pragma parameter SetHandleSize(__A0, __D0)
  437. #endif
  438. extern pascal void SetHandleSize(Handle h, Size newSize)
  439.  ONEWORDINLINE(0xA024);
  440. extern pascal Size GetHandleSize(Handle h);
  441.  
  442. #if !GENERATINGCFM
  443. #pragma parameter __D0 InlineGetHandleSize(__A0)
  444. #endif
  445. extern pascal Size InlineGetHandleSize(Handle h)
  446.  ONEWORDINLINE(0xA025);
  447.  
  448. #if !GENERATINGCFM
  449. #pragma parameter ReallocateHandle(__A0, __D0)
  450. #endif
  451. extern pascal void ReallocateHandle(Handle h, Size byteCount)
  452.  ONEWORDINLINE(0xA027);
  453.  
  454. #if !GENERATINGCFM
  455. #pragma parameter EmptyHandle(__A0)
  456. #endif
  457. extern pascal void EmptyHandle(Handle h)
  458.  ONEWORDINLINE(0xA02B);
  459.  
  460. #if !GENERATINGCFM
  461. #pragma parameter HSetRBit(__A0)
  462. #endif
  463. extern pascal void HSetRBit(Handle h)
  464.  ONEWORDINLINE(0xA067);
  465.  
  466. #if !GENERATINGCFM
  467. #pragma parameter HClrRBit(__A0)
  468. #endif
  469. extern pascal void HClrRBit(Handle h)
  470.  ONEWORDINLINE(0xA068);
  471. extern pascal void MoreMasters(void)
  472.  ONEWORDINLINE(0xA036);
  473.  
  474. #if !GENERATINGCFM
  475. #pragma parameter BlockMove(__A0, __A1, __D0)
  476. #endif
  477. extern pascal void BlockMove(const void *srcPtr, void *destPtr, Size byteCount)
  478.  ONEWORDINLINE(0xA02E);
  479.  
  480. #if !GENERATINGCFM
  481. #pragma parameter BlockMoveData(__A0, __A1, __D0)
  482. #endif
  483. extern pascal void BlockMoveData(const void *srcPtr, void *destPtr, Size byteCount)
  484.  ONEWORDINLINE(0xA22E);
  485. extern pascal void PurgeSpace(long *total, long *contig);
  486.  
  487. #if !GENERATINGCFM
  488. #pragma parameter __D0 HGetState(__A0)
  489. #endif
  490. extern pascal SInt8 HGetState(Handle h)
  491.  ONEWORDINLINE(0xA069);
  492.  
  493. #if !GENERATINGCFM
  494. #pragma parameter HSetState(__A0, __D0)
  495. #endif
  496. extern pascal void HSetState(Handle h, SInt8 flags)
  497.  ONEWORDINLINE(0xA06A);
  498.  
  499. #if !GENERATINGCFM
  500. #pragma parameter SetApplBase(__A0)
  501. #endif
  502. extern pascal void SetApplBase(void *startPtr)
  503.  ONEWORDINLINE(0xA057);
  504. extern pascal void MaxApplZone(void)
  505.  ONEWORDINLINE(0xA063);
  506.  
  507. #if !GENERATINGCFM
  508. #pragma parameter __D0 HoldMemory(__A0, __A1)
  509. #endif
  510. extern pascal OSErr HoldMemory(void *address, unsigned long count)
  511.  TWOWORDINLINE(0x7000, 0xA05C);
  512.  
  513. #if !GENERATINGCFM
  514. #pragma parameter __D0 UnholdMemory(__A0, __A1)
  515. #endif
  516. extern pascal OSErr UnholdMemory(void *address, unsigned long count)
  517.  TWOWORDINLINE(0x7001, 0xA05C);
  518.  
  519. #if !GENERATINGCFM
  520. #pragma parameter __D0 LockMemory(__A0, __A1)
  521. #endif
  522. extern pascal OSErr LockMemory(void *address, unsigned long count)
  523.  TWOWORDINLINE(0x7002, 0xA05C);
  524.  
  525. #if !GENERATINGCFM
  526. #pragma parameter __D0 LockMemoryContiguous(__A0, __A1)
  527. #endif
  528. extern pascal OSErr LockMemoryContiguous(void *address, unsigned long count)
  529.  TWOWORDINLINE(0x7004, 0xA05C);
  530.  
  531. #if !GENERATINGCFM
  532. #pragma parameter __D0 UnlockMemory(__A0, __A1)
  533. #endif
  534. extern pascal OSErr UnlockMemory(void *address, unsigned long count)
  535.  TWOWORDINLINE(0x7003, 0xA05C);
  536. extern pascal OSErr GetPhysical(LogicalToPhysicalTable *addresses, unsigned long *physicalEntryCount);
  537.  
  538. #if !GENERATINGCFM
  539. #pragma parameter __D0 DeferUserFn(__A0, __D0)
  540. #endif
  541. extern pascal OSErr DeferUserFn(UserFnUPP userFunction, void *argument)
  542.  ONEWORDINLINE(0xA08F);
  543.  
  544. #if !GENERATINGCFM
  545. #pragma parameter __D0 DebuggerGetMax
  546. #endif
  547. extern pascal long DebuggerGetMax(void)
  548.  TWOWORDINLINE(0x7000, 0xA08D);
  549. extern pascal void DebuggerEnter(void)
  550.  TWOWORDINLINE(0x7001, 0xA08D);
  551. extern pascal void DebuggerExit(void)
  552.  TWOWORDINLINE(0x7002, 0xA08D);
  553. extern pascal void DebuggerPoll(void)
  554.  TWOWORDINLINE(0x7003, 0xA08D);
  555.  
  556. #if !GENERATINGCFM
  557. #pragma parameter __D0 GetPageState(__A0)
  558. #endif
  559. extern pascal PageState GetPageState(const void *address)
  560.  TWOWORDINLINE(0x7004, 0xA08D);
  561.  
  562. #if !GENERATINGCFM
  563. #pragma parameter __D0 PageFaultFatal
  564. #endif
  565. extern pascal Boolean PageFaultFatal(void)
  566.  TWOWORDINLINE(0x7005, 0xA08D);
  567.  
  568. #if !GENERATINGCFM
  569. #pragma parameter __D0 DebuggerLockMemory(__A0, __A1)
  570. #endif
  571. extern pascal OSErr DebuggerLockMemory(void *address, unsigned long count)
  572.  TWOWORDINLINE(0x7006, 0xA08D);
  573.  
  574. #if !GENERATINGCFM
  575. #pragma parameter __D0 DebuggerUnlockMemory(__A0, __A1)
  576. #endif
  577. extern pascal OSErr DebuggerUnlockMemory(void *address, unsigned long count)
  578.  TWOWORDINLINE(0x7007, 0xA08D);
  579.  
  580. #if !GENERATINGCFM
  581. #pragma parameter __D0 EnterSupervisorMode
  582. #endif
  583. extern pascal StatusRegisterContents EnterSupervisorMode(void)
  584.  TWOWORDINLINE(0x7008, 0xA08D);
  585. /* StripAddress and Translate24To32 macro to nothing on PowerPC
  586.    StripAddress is implemented as a trap in System 6 or later */
  587. #if !GENERATINGPOWERPC
  588. #if SystemSixOrLater
  589.  
  590. #if !GENERATINGCFM
  591. #pragma parameter __D0 StripAddress(__D0)
  592. #endif
  593. extern pascal Ptr StripAddress(void *theAddress)
  594.  ONEWORDINLINE(0xA055);
  595. #else
  596. extern pascal Ptr StripAddress(void *theAddress);
  597. #endif
  598. #else
  599. #define StripAddress(x) ((Ptr)(x))
  600. #endif
  601. #if !GENERATINGPOWERPC
  602.  
  603. #if !GENERATINGCFM
  604. #pragma parameter __D0 Translate24To32(__D0)
  605. #endif
  606. extern pascal Ptr Translate24To32(void *addr24)
  607.  ONEWORDINLINE(0xA091);
  608. #else
  609. #define Translate24To32(x) ((Ptr)(x))
  610. #endif
  611. extern pascal OSErr HandToHand(Handle *theHndl);
  612.  
  613. #if !GENERATINGCFM
  614. #pragma parameter __D0 PtrToXHand(__A0, __A1, __D0)
  615. #endif
  616. extern pascal OSErr PtrToXHand(const void *srcPtr, Handle dstHndl, long size)
  617.  ONEWORDINLINE(0xA9E2);
  618. extern pascal OSErr PtrToHand(const void *srcPtr, Handle *dstHndl, long size);
  619.  
  620. #if !GENERATINGCFM
  621. #pragma parameter __D0 HandAndHand(__A0, __A1)
  622. #endif
  623. extern pascal OSErr HandAndHand(Handle hand1, Handle hand2)
  624.  ONEWORDINLINE(0xA9E4);
  625.  
  626. #if !GENERATINGCFM
  627. #pragma parameter __D0 PtrAndHand(__A0, __A1, __D0)
  628. #endif
  629. extern pascal OSErr PtrAndHand(const void *ptr1, Handle hand2, long size)
  630.  ONEWORDINLINE(0xA9EF);
  631. #if OLDROUTINENAMES
  632. #define ApplicZone() ApplicationZone()
  633. #define MFTempNewHandle(logicalSize, resultCode) TempNewHandle(logicalSize, resultCode)
  634. #define MFMaxMem(grow) TempMaxMem(grow)
  635. #define MFFreeMem() TempFreeMem()
  636. #define MFTempHLock(h, resultCode) TempHLock(h, resultCode)
  637. #define MFTempHUnlock(h, resultCode) TempHUnlock(h, resultCode)
  638. #define MFTempDisposHandle(h, resultCode) TempDisposeHandle(h, resultCode)
  639. #define MFTopMem() TempTopMem()
  640. #define ResrvMem(cbNeeded) ReserveMem(cbNeeded)
  641. #define DisposPtr(p) DisposePtr(p)
  642. #define DisposHandle(h) DisposeHandle(h)
  643. #define ReallocHandle(h, byteCount) ReallocateHandle(h, byteCount)
  644. #endif
  645.  
  646. #ifdef __CFM68K__
  647. #pragma lib_export off
  648. #endif
  649.  
  650. #if GENERATINGPOWERPC
  651. #pragma options align=reset
  652. #endif
  653.  
  654. #ifdef __cplusplus
  655. }
  656. #endif
  657.  
  658. #endif /* __MEMORY__ */
  659.