mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-21 18:30:20 +00:00
Add LockMemory() and LockMemoryContiguous()
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
a2de5774fe
commit
f71ae4b6d0
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user