--- SheepShaver/src/include/thunks.h 2003/12/05 12:36:11 1.2 +++ SheepShaver/src/include/thunks.h 2004/04/18 23:03:52 1.6 @@ -54,12 +54,23 @@ enum { NATIVE_DISABLE_INTERRUPT, NATIVE_ENABLE_INTERRUPT, NATIVE_MAKE_EXECUTABLE, + NATIVE_CHECK_LOAD_INVOC, + NATIVE_SYNC_HOOK, + NATIVE_BITBLT_HOOK, + NATIVE_FILLRECT_HOOK, + NATIVE_BITBLT, + NATIVE_INVRECT, + NATIVE_FILLRECT_8, + NATIVE_FILLRECT_32, NATIVE_OP_MAX }; // Initialize the thunks system extern bool ThunksInit(void); +// Exit the thunks system +extern void ThunksExit(void); + // Return the fake PowerPC opcode to handle specified native code #if EMULATED_PPC extern uint32 NativeOpcode(int selector); @@ -71,6 +82,9 @@ extern uint32 NativeTVECT(int selector); // Return the native function address extern uint32 NativeFunction(int selector); +// Return the routine descriptor address of the native function +extern uint32 NativeRoutineDescriptor(int selector); + /* * Helpers to share 32-bit addressable data with MacOS @@ -79,13 +93,15 @@ extern uint32 NativeFunction(int selecto class SheepMem { static uint32 align(uint32 size); protected: + static uint32 page_size; static uintptr zero_page; static uintptr base; static uintptr top; - static const uint32 size = 0x40000; + static const uint32 size = 0x40000; // 256 KB public: static bool Init(void); static void Exit(void); + static uint32 PageSize(); static uintptr ZeroPage(); static uintptr Reserve(uint32 size); static void Release(uint32 size); @@ -98,6 +114,11 @@ inline uint32 SheepMem::align(uint32 siz return (size + 3) & -4; } +inline uint32 SheepMem::PageSize() +{ + return page_size; +} + inline uintptr SheepMem::ZeroPage() { return zero_page;