From 8cd260690c4099ed164a7b78ebedc930ecb08c12 Mon Sep 17 00:00:00 2001 From: kanjitalk755 Date: Sat, 4 Jun 2022 16:41:12 +0900 Subject: [PATCH] SS: Apple Silicon Mac: without shared memory --- SheepShaver/src/MacOSX/config/config-macosx-aarch64.h | 2 +- SheepShaver/src/Unix/main_unix.cpp | 4 ++-- SheepShaver/src/kpx_cpu/src/cpu/vm.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SheepShaver/src/MacOSX/config/config-macosx-aarch64.h b/SheepShaver/src/MacOSX/config/config-macosx-aarch64.h index c904f671..dd37d293 100644 --- a/SheepShaver/src/MacOSX/config/config-macosx-aarch64.h +++ b/SheepShaver/src/MacOSX/config/config-macosx-aarch64.h @@ -428,7 +428,7 @@ /* Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system. */ -/* #define PAGEZERO_HACK 1 */ +#define PAGEZERO_HACK 1 /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void diff --git a/SheepShaver/src/Unix/main_unix.cpp b/SheepShaver/src/Unix/main_unix.cpp index c39015b6..cccd6713 100755 --- a/SheepShaver/src/Unix/main_unix.cpp +++ b/SheepShaver/src/Unix/main_unix.cpp @@ -196,7 +196,7 @@ uint8 *RAMBaseHost; // Base address of Mac RAM (host address space) uint8 *ROMBaseHost; // Base address of Mac ROM (host address space) uint32 ROMEnd; -#if defined(__APPLE__) && defined(__x86_64__) +#ifdef __APPLE__ uint8 gZeroPage[0x3000], gKernelData[0x2000]; #endif @@ -921,7 +921,7 @@ int main(int argc, char **argv) goto quit; } -#if !defined(__APPLE__) || !defined(__x86_64__) +#ifndef __APPLE__ // Create areas for Kernel Data if (!kernel_data_init()) goto quit; diff --git a/SheepShaver/src/kpx_cpu/src/cpu/vm.hpp b/SheepShaver/src/kpx_cpu/src/cpu/vm.hpp index c01dc6ac..48119904 100755 --- a/SheepShaver/src/kpx_cpu/src/cpu/vm.hpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/vm.hpp @@ -206,7 +206,7 @@ const uintptr VMBaseDiff = NATMEM_OFFSET; static inline uint8 * vm_do_get_real_address(vm_addr_t addr) { uintptr a = vm_wrap_address(addr); -#if defined(__APPLE__) && defined(__x86_64__) +#ifdef __APPLE__ extern uint8 gZeroPage[0x3000], gKernelData[0x2000]; if (a < 0x3000) return &gZeroPage[a]; else if ((a & ~0x1fff) == 0x68ffe000 || (a & ~0x1fff) == 0x5fffe000) return &gKernelData[a & 0x1fff];