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 uintptr zero_page; |
90 |
|
static uintptr base; |
91 |
|
static uintptr top; |
92 |
< |
static const uint32 size = 0x40000; |
92 |
> |
static const uint32 size = 0x40000; // 256 KB |
93 |
|
public: |
94 |
|
static bool Init(void); |
95 |
|
static void Exit(void); |
96 |
+ |
static uintptr ZeroPage(); |
97 |
|
static uintptr Reserve(uint32 size); |
98 |
|
static void Release(uint32 size); |
99 |
|
friend class SheepVar; |
105 |
|
return (size + 3) & -4; |
106 |
|
} |
107 |
|
|
108 |
+ |
inline uintptr SheepMem::ZeroPage() |
109 |
+ |
{ |
110 |
+ |
return zero_page; |
111 |
+ |
} |
112 |
+ |
|
113 |
|
inline uintptr SheepMem::Reserve(uint32 size) |
114 |
|
{ |
115 |
|
top -= align(size); |