54 |
|
NATIVE_DISABLE_INTERRUPT, |
55 |
|
NATIVE_ENABLE_INTERRUPT, |
56 |
|
NATIVE_MAKE_EXECUTABLE, |
57 |
+ |
NATIVE_CHECK_LOAD_INVOC, |
58 |
|
NATIVE_OP_MAX |
59 |
|
}; |
60 |
|
|
61 |
|
// Initialize the thunks system |
62 |
|
extern bool ThunksInit(void); |
63 |
|
|
64 |
+ |
// Exit the thunks system |
65 |
+ |
extern void ThunksExit(void); |
66 |
+ |
|
67 |
|
// Return the fake PowerPC opcode to handle specified native code |
68 |
|
#if EMULATED_PPC |
69 |
|
extern uint32 NativeOpcode(int selector); |
75 |
|
// Return the native function address |
76 |
|
extern uint32 NativeFunction(int selector); |
77 |
|
|
78 |
+ |
// Return the routine descriptor address of the native function |
79 |
+ |
extern uint32 NativeRoutineDescriptor(int selector); |
80 |
+ |
|
81 |
|
|
82 |
|
/* |
83 |
|
* Helpers to share 32-bit addressable data with MacOS |
86 |
|
class SheepMem { |
87 |
|
static uint32 align(uint32 size); |
88 |
|
protected: |
89 |
+ |
static uint32 page_size; |
90 |
|
static uintptr zero_page; |
91 |
|
static uintptr base; |
92 |
|
static uintptr top; |
93 |
< |
static const uint32 size = 0x40000; |
93 |
> |
static const uint32 size = 0x40000; // 256 KB |
94 |
|
public: |
95 |
|
static bool Init(void); |
96 |
|
static void Exit(void); |
97 |
+ |
static uint32 PageSize(); |
98 |
|
static uintptr ZeroPage(); |
99 |
|
static uintptr Reserve(uint32 size); |
100 |
|
static void Release(uint32 size); |
107 |
|
return (size + 3) & -4; |
108 |
|
} |
109 |
|
|
110 |
+ |
inline uint32 SheepMem::PageSize() |
111 |
+ |
{ |
112 |
+ |
return page_size; |
113 |
+ |
} |
114 |
+ |
|
115 |
|
inline uintptr SheepMem::ZeroPage() |
116 |
|
{ |
117 |
|
return zero_page; |