mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-18 06:31:23 +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];
|
MemoryBlock physical[8];
|
||||||
} LogicalToPhysicalTable;
|
} 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,
|
static inline OSErr GetPhysical(LogicalToPhysicalTable *addresses,
|
||||||
unsigned long *physicalEntryCount)
|
unsigned long *physicalEntryCount)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user