diff --git a/BasiliskII/src/CrossPlatform/sigsegv.cpp b/BasiliskII/src/CrossPlatform/sigsegv.cpp index 003f20cf..645ac73a 100644 --- a/BasiliskII/src/CrossPlatform/sigsegv.cpp +++ b/BasiliskII/src/CrossPlatform/sigsegv.cpp @@ -302,6 +302,12 @@ static void powerpc_decode_instruction(instruction_t *instruction, unsigned int #define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[_REG_EIP] #define SIGSEGV_REGISTER_FILE (SIGSEGV_REGISTER_TYPE *)SIGSEGV_CONTEXT_REGS #define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction +#elif (defined(__x86_64__) || defined(x86_64)) +#include +#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.__gregs) +#define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[_REG_RIP] +#define SIGSEGV_REGISTER_FILE (SIGSEGV_REGISTER_TYPE *)SIGSEGV_CONTEXT_REGS +#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction #endif #if (defined(powerpc) || defined(__powerpc__)) #include @@ -799,6 +805,24 @@ enum { X86_REG_EBP = _REG_EBP, X86_REG_ESI = _REG_ESI, X86_REG_EDI = _REG_EDI +#elif (defined(__x86_64__) || defined(x86_64)) + X86_REG_EIP = _REG_RIP, + X86_REG_EAX = _REG_RAX, + X86_REG_ECX = _REG_RCX, + X86_REG_EDX = _REG_RDX, + X86_REG_EBX = _REG_RBX, + X86_REG_ESP = _REG_RSP, + X86_REG_EBP = _REG_RBP, + X86_REG_ESI = _REG_RSI, + X86_REG_EDI = _REG_RDI, + X86_REG_R8 = _REG_R8, + X86_REG_R9 = _REG_R9, + X86_REG_R10 = _REG_R10, + X86_REG_R11 = _REG_R11, + X86_REG_R12 = _REG_R12, + X86_REG_R13 = _REG_R13, + X86_REG_R14 = _REG_R14, + X86_REG_R15 = _REG_R15 #endif }; #endif diff --git a/BasiliskII/src/CrossPlatform/vm_alloc.cpp b/BasiliskII/src/CrossPlatform/vm_alloc.cpp index 2f52f8f7..cb869034 100755 --- a/BasiliskII/src/CrossPlatform/vm_alloc.cpp +++ b/BasiliskII/src/CrossPlatform/vm_alloc.cpp @@ -71,7 +71,7 @@ typedef unsigned long vm_uintptr_t; #ifndef MAP_32BIT #define MAP_32BIT 0 #endif -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__NetBSD__) #define FORCE_MAP_32BIT MAP_FIXED #else #define FORCE_MAP_32BIT MAP_32BIT @@ -86,7 +86,7 @@ typedef unsigned long vm_uintptr_t; #define MAP_EXTRA_FLAGS (MAP_32BIT) #ifdef HAVE_MMAP_VM -#if (defined(__linux__) && defined(__i386__)) || defined(__FreeBSD__) || HAVE_LINKER_SCRIPT +#if (defined(__linux__) && defined(__i386__)) || defined(__FreeBSD__) || defined(__NetBSD__) || HAVE_LINKER_SCRIPT /* Force a reasonnable address below 0x80000000 on x86 so that we don't get addresses above when the program is run on AMD64. NOTE: this is empirically determined on Linux/x86. */ diff --git a/BasiliskII/src/Unix/configure.ac b/BasiliskII/src/Unix/configure.ac index ac7a58fb..0791cb46 100755 --- a/BasiliskII/src/Unix/configure.ac +++ b/BasiliskII/src/Unix/configure.ac @@ -618,6 +618,9 @@ mips-sony-bsd|mips-sony-newsos4) *-*-freebsd*) no_dev_ptmx=1 ;; +*-*-netbsd*) + no_dev_ptmx=1 + ;; esac if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then diff --git a/BasiliskII/src/Unix/sshpty.c b/BasiliskII/src/Unix/sshpty.c index 351f7c8b..fc0bf2ea 100644 --- a/BasiliskII/src/Unix/sshpty.c +++ b/BasiliskII/src/Unix/sshpty.c @@ -22,6 +22,11 @@ RCSID("$OpenBSD: sshpty.c,v 1.4 2001/12/19 07:18:56 deraadt Exp $"); #include #include #include /* For O_NONBLOCK */ + +#ifdef HAVE_SYS_STAT_H +#include +#endif + #include #include #include diff --git a/SheepShaver/src/CrossPlatform/sigsegv.cpp b/SheepShaver/src/CrossPlatform/sigsegv.cpp index 5353cd52..b1ed17eb 100644 --- a/SheepShaver/src/CrossPlatform/sigsegv.cpp +++ b/SheepShaver/src/CrossPlatform/sigsegv.cpp @@ -302,6 +302,12 @@ static void powerpc_decode_instruction(instruction_t *instruction, unsigned int #define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[_REG_EIP] #define SIGSEGV_REGISTER_FILE (SIGSEGV_REGISTER_TYPE *)SIGSEGV_CONTEXT_REGS #define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction +#elif (defined(__x86_64__) || defined(x86_64)) +#include +#define SIGSEGV_CONTEXT_REGS (((ucontext_t *)scp)->uc_mcontext.__gregs) +#define SIGSEGV_FAULT_INSTRUCTION SIGSEGV_CONTEXT_REGS[_REG_RIP] +#define SIGSEGV_REGISTER_FILE (SIGSEGV_REGISTER_TYPE *)SIGSEGV_CONTEXT_REGS +#define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction #endif #if (defined(powerpc) || defined(__powerpc__)) #include @@ -799,6 +805,24 @@ enum { X86_REG_EBP = _REG_EBP, X86_REG_ESI = _REG_ESI, X86_REG_EDI = _REG_EDI +#elif (defined(__x86_64__) || defined(x86_64)) + X86_REG_EIP = _REG_RIP, + X86_REG_EAX = _REG_RAX, + X86_REG_ECX = _REG_RCX, + X86_REG_EDX = _REG_RDX, + X86_REG_EBX = _REG_RBX, + X86_REG_ESP = _REG_RSP, + X86_REG_EBP = _REG_RBP, + X86_REG_ESI = _REG_RSI, + X86_REG_EDI = _REG_RDI, + X86_REG_R8 = _REG_R8, + X86_REG_R9 = _REG_R9, + X86_REG_R10 = _REG_R10, + X86_REG_R11 = _REG_R11, + X86_REG_R12 = _REG_R12, + X86_REG_R13 = _REG_R13, + X86_REG_R14 = _REG_R14, + X86_REG_R15 = _REG_R15 #endif }; #endif diff --git a/SheepShaver/src/Unix/configure.ac b/SheepShaver/src/Unix/configure.ac index f1f1fea3..6fd59033 100755 --- a/SheepShaver/src/Unix/configure.ac +++ b/SheepShaver/src/Unix/configure.ac @@ -525,6 +525,9 @@ mips-sony-bsd|mips-sony-newsos4) *-*-freebsd*) no_dev_ptmx=1 ;; +*-*-netbsd*) + no_dev_ptmx=1 + ;; esac if test -z "$no_dev_ptmx" ; then diff --git a/SheepShaver/src/Unix/sysdeps.h b/SheepShaver/src/Unix/sysdeps.h index ac5d78ac..f6e43851 100644 --- a/SheepShaver/src/Unix/sysdeps.h +++ b/SheepShaver/src/Unix/sysdeps.h @@ -54,6 +54,10 @@ # include #endif +#ifdef HAVE_SYS_STAT_H +# include +#endif + #ifdef TIME_WITH_SYS_TIME # include # include