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