Add FlushInstructionCache(), FlushDataCache(), DisableExtCache(), FlushExtCache() and FlushCodeCacheRange()

This commit is contained in:
Laurent Vivier 2007-11-03 20:37:55 +00:00
parent 1ee27546a1
commit 90b8e2db0b

View File

@ -45,5 +45,54 @@ static inline void ReadLocation(MachineLocation * loc)
XPRam(_ReadLocation)
:: "g" (loc) : "%%d0", UNPRESERVED_REGS);
}
static inline OSErr FlushInstructionCache(void)
{
register OSErr ret asm("d0");
asm(HWPriv(_FlushInstructionCache) ::: UNPRESERVED_REGS);
return ret;
}
static inline OSErr FlushDataCache(void)
{
register OSErr ret asm("d0");
asm(HWPriv(_FlushDataCache) ::: UNPRESERVED_REGS);
return ret;
}
static inline OSErr DisableExtCache(void)
{
register OSErr ret asm("d0");
asm(HWPriv(_DisableExtCache) ::: UNPRESERVED_REGS);
return ret;
}
static inline OSErr FlushExtCache(void)
{
register OSErr ret asm("d0");
asm(HWPriv(_FlushExtCache) ::: UNPRESERVED_REGS);
return ret;
}
static inline OSErr FlushCodeCacheRange(void *address, unsigned long count)
{
register OSErr ret asm("d0");
asm("move.l %0, %%a0\n"
"move.l %1, %%a1\n"
HWPriv(_FlushCodeCacheRange)
:: "g" (address), "g" (count) : UNPRESERVED_REGS);
return ret;
}
#endif /* __mc68000__ */
#endif /* __MACOS_OSUTILS_H__ */