54 |
|
NATIVE_DISABLE_INTERRUPT, |
55 |
|
NATIVE_ENABLE_INTERRUPT, |
56 |
|
NATIVE_MAKE_EXECUTABLE, |
57 |
+ |
NATIVE_CHECK_LOAD_INVOC, |
58 |
+ |
NATIVE_SYNC_HOOK, |
59 |
+ |
NATIVE_BITBLT_HOOK, |
60 |
+ |
NATIVE_FILLRECT_HOOK, |
61 |
+ |
NATIVE_BITBLT, |
62 |
+ |
NATIVE_INVRECT, |
63 |
+ |
NATIVE_FILLRECT, |
64 |
|
NATIVE_OP_MAX |
65 |
|
}; |
66 |
|
|
67 |
|
// Initialize the thunks system |
68 |
|
extern bool ThunksInit(void); |
69 |
|
|
70 |
+ |
// Exit the thunks system |
71 |
+ |
extern void ThunksExit(void); |
72 |
+ |
|
73 |
|
// Return the fake PowerPC opcode to handle specified native code |
74 |
|
#if EMULATED_PPC |
75 |
|
extern uint32 NativeOpcode(int selector); |
81 |
|
// Return the native function address |
82 |
|
extern uint32 NativeFunction(int selector); |
83 |
|
|
84 |
+ |
// Return the routine descriptor address of the native function |
85 |
+ |
extern uint32 NativeRoutineDescriptor(int selector); |
86 |
+ |
|
87 |
|
|
88 |
|
/* |
89 |
|
* Helpers to share 32-bit addressable data with MacOS |
92 |
|
class SheepMem { |
93 |
|
static uint32 align(uint32 size); |
94 |
|
protected: |
95 |
+ |
static uint32 page_size; |
96 |
|
static uintptr zero_page; |
97 |
|
static uintptr base; |
98 |
|
static uintptr top; |
99 |
< |
static const uint32 size = 0x40000; |
99 |
> |
static const uint32 size = 0x40000; // 256 KB |
100 |
|
public: |
101 |
|
static bool Init(void); |
102 |
|
static void Exit(void); |
103 |
+ |
static uint32 PageSize(); |
104 |
|
static uintptr ZeroPage(); |
105 |
|
static uintptr Reserve(uint32 size); |
106 |
|
static void Release(uint32 size); |
113 |
|
return (size + 3) & -4; |
114 |
|
} |
115 |
|
|
116 |
+ |
inline uint32 SheepMem::PageSize() |
117 |
+ |
{ |
118 |
+ |
return page_size; |
119 |
+ |
} |
120 |
+ |
|
121 |
|
inline uintptr SheepMem::ZeroPage() |
122 |
|
{ |
123 |
|
return zero_page; |