Add LockMemory() and LockMemoryContiguous()

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Laurent Vivier 2009-06-18 22:11:03 +02:00
parent a2de5774fe
commit f71ae4b6d0

View File

@ -40,6 +40,32 @@ typedef struct LogicalToPhysicalTable {
MemoryBlock physical[8];
} LogicalToPhysicalTable;
static inline OSErr LockMemory(void *address, unsigned long count)
{
register OSErr ret asm("%%d0");
asm("move.l %1, %%a0\n"
"move.l %2, %%a1\n"
MemoryDispatch(_LockMemory)
: "=d" (ret) : "a" (address), "a" (count)
: UNPRESERVED_REGS );
return ret;
}
static inline OSErr LockMemoryContiguous(void *address, unsigned long count)
{
register OSErr ret asm("%%d0");
asm("move.l %1, %%a0\n"
"move.l %2, %%a1\n"
MemoryDispatch(_LockMemoryContiguous)
: "=d" (ret) : "a" (address), "a" (count)
: UNPRESERVED_REGS );
return ret;
}
static inline OSErr GetPhysical(LogicalToPhysicalTable *addresses,
unsigned long *physicalEntryCount)
{