220 |
|
|
221 |
|
static void *sig_stack = NULL; // Stack for signal handlers |
222 |
|
static void *extra_stack = NULL; // Stack for SIGSEGV inside interrupt handler |
223 |
< |
static uintptr SheepMem::base; // Address of SheepShaver data |
224 |
< |
static uintptr SheepMem::top; // Top of SheepShaver data (stack like storage) |
223 |
> |
uintptr SheepMem::zero_page = 0; // Address of ro page filled in with zeros |
224 |
> |
uintptr SheepMem::base; // Address of SheepShaver data |
225 |
> |
uintptr SheepMem::top; // Top of SheepShaver data (stack like storage) |
226 |
|
static area_id SheepMemArea; // SheepShaver data area ID |
227 |
|
|
228 |
|
|
579 |
|
WriteMacInt32(XLM_PVR, PVR); // Theoretical PVR |
580 |
|
WriteMacInt32(XLM_BUS_CLOCK, BusClockSpeed); // For DriverServicesLib patch |
581 |
|
WriteMacInt16(XLM_EXEC_RETURN_OPCODE, M68K_EXEC_RETURN); // For Execute68k() (RTS from the executed 68k code will jump here and end 68k mode) |
582 |
+ |
WriteMacInt32(XLM_ZERO_PAGE, SheepMem::ZeroPage()); // Pointer to read-only page with all bits set to 0 |
583 |
|
#if !EMULATED_PPC |
584 |
|
WriteMacInt32(XLM_TOC, (uint32)TOC); // TOC pointer of emulator |
585 |
|
WriteMacInt32(XLM_ETHER_INIT, *(uint32 *)InitStreamModule); // DLPI ethernet driver functions |
2081 |
|
if (SheepMemArea < 0) |
2082 |
|
return false; |
2083 |
|
|
2084 |
+ |
// Create read-only area with all bits set to 0 |
2085 |
+ |
static const uint8 const_zero_page[4096] = {0,}; |
2086 |
+ |
zero_page = const_zero_page; |
2087 |
+ |
|
2088 |
|
D(bug("SheepShaver area %ld at %p\n", SheepMemArea, base)); |
2089 |
|
top = base + size; |
2090 |
|
return true; |