Add EnterSupervisorMode()

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Laurent Vivier 2009-06-19 00:25:11 +02:00
parent efcadd06c5
commit 9bd17c1bd9
2 changed files with 34 additions and 0 deletions

View File

@ -41,6 +41,9 @@ typedef struct LogicalToPhysicalTable {
MemoryBlock physical[8];
} LogicalToPhysicalTable;
typedef short PageState;
typedef short StatusRegisterContents;
static inline OSErr LockMemory(void *address, unsigned long count)
{
register OSErr ret asm("%%d0");
@ -81,5 +84,15 @@ static inline OSErr GetPhysical(LogicalToPhysicalTable *addresses,
return ret;
}
static inline StatusRegisterContents EnterSupervisorMode(void)
{
register StatusRegisterContents ret asm("%%d0");
asm(DebugUtil(_EnterSupervisorMode)
: "=d" (ret) : : UNPRESERVED_REGS );
return ret;
}
#endif /* __mc68000__ */
#endif /* __MACOS_MEMORY_H__ */

View File

@ -27,6 +27,7 @@
#define _ReadXPRam 0xA051
#define _MemoryDispatch 0xA05C
#define _SlotManager 0xA06E
#define _DebugUtil 0xA08D
#define _HWPriv 0xA098
#define _SCSIDispatch 0xA815
#define _SysError 0xA9C9
@ -131,4 +132,24 @@
MemoryDispatchSelector(selector)" /* "#selector" */\n" \
Trap(_MemoryDispatch)
/*
* DebugUtil selectors
*
*/
#define _DebuggerGetMax 0x0000
#define _DebuggerEnter 0x0001
#define _DebuggerExit 0x0002
#define _GetPageState 0x0004
#define _PageFaultFatal 0x0005
#define _DebuggerLockMemory 0x0006
#define _DebuggerUnlockMemory 0x0007
#define _EnterSupervisorMode 0x0008
#define DebugUtilSelector(a) " move.l #"#a", %%d0"
#define DebugUtil(selector) \
DebugUtilSelector(selector)" /* "#selector" */\n" \
Trap(_DebugUtil)
#endif /* __MACOS_TRAPS_H__ */