From 4217fc73cdb5a65d64bca03af47ec84f142276af Mon Sep 17 00:00:00 2001 From: robxnano <89391914+robxnano@users.noreply.github.com> Date: Sat, 15 Oct 2022 00:15:37 +0100 Subject: [PATCH] OpenIndiana: Skip instruction fix Fixes the register definitions so that instruction skip works. Both Basilisk II and SheepShaver now work (without JIT) on Solaris-based OSes such as OpenIndiana. --- BasiliskII/src/CrossPlatform/sigsegv.cpp | 16 ++++++++-------- BasiliskII/src/CrossPlatform/vm_alloc.cpp | 2 +- BasiliskII/src/Unix/ether_unix.cpp | 5 +++++ BasiliskII/src/Unix/sshpty.c | 2 +- SheepShaver/src/CrossPlatform/sigsegv.cpp | 16 ++++++++-------- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/BasiliskII/src/CrossPlatform/sigsegv.cpp b/BasiliskII/src/CrossPlatform/sigsegv.cpp index 5e31f1fc..43ec20d4 100644 --- a/BasiliskII/src/CrossPlatform/sigsegv.cpp +++ b/BasiliskII/src/CrossPlatform/sigsegv.cpp @@ -907,14 +907,14 @@ enum { X86_REG_R13 = REG_R13, X86_REG_R14 = REG_R14, X86_REG_R15 = REG_R15, - X86_REG_EDI = EDI, - X86_REG_ESI = ESI, - X86_REG_EBP = EBP, - X86_REG_EBX = EBX, - X86_REG_EDX = EDX, - X86_REG_EAX = EAX, - X86_REG_ECX = ECX, - X86_REG_ESP = ESP, + X86_REG_EDI = REG_RDI, + X86_REG_ESI = REG_RSI, + X86_REG_EBP = REG_RBP, + X86_REG_EBX = REG_RBX, + X86_REG_EDX = REG_RDX, + X86_REG_EAX = REG_RAX, + X86_REG_ECX = REG_RCX, + X86_REG_ESP = REG_RSP, X86_REG_EIP = REG_RIP #endif }; diff --git a/BasiliskII/src/CrossPlatform/vm_alloc.cpp b/BasiliskII/src/CrossPlatform/vm_alloc.cpp index cb869034..f4977610 100755 --- a/BasiliskII/src/CrossPlatform/vm_alloc.cpp +++ b/BasiliskII/src/CrossPlatform/vm_alloc.cpp @@ -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__) || defined(__NetBSD__) || HAVE_LINKER_SCRIPT +#if (defined(__linux__) && defined(__i386__)) || defined(__sun__) || 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/ether_unix.cpp b/BasiliskII/src/Unix/ether_unix.cpp index 19c95d4b..b7751cdd 100644 --- a/BasiliskII/src/Unix/ether_unix.cpp +++ b/BasiliskII/src/Unix/ether_unix.cpp @@ -39,6 +39,11 @@ #ifdef HAVE_SYS_POLL_H #include #endif + +#ifdef __sun__ +#define BSD_COMP 1 +#endif + #include #include diff --git a/BasiliskII/src/Unix/sshpty.c b/BasiliskII/src/Unix/sshpty.c index 18865900..abee7d28 100644 --- a/BasiliskII/src/Unix/sshpty.c +++ b/BasiliskII/src/Unix/sshpty.c @@ -75,7 +75,7 @@ RCSID("$OpenBSD: sshpty.c,v 1.4 2001/12/19 07:18:56 deraadt Exp $"); #endif /* not in BasiliskII */ #ifdef __sun__ -#define mysig_t sig_atomic_t +#define mysig_t void* #else #define mysig_t sig_t #endif diff --git a/SheepShaver/src/CrossPlatform/sigsegv.cpp b/SheepShaver/src/CrossPlatform/sigsegv.cpp index 34c6c880..7d938e82 100644 --- a/SheepShaver/src/CrossPlatform/sigsegv.cpp +++ b/SheepShaver/src/CrossPlatform/sigsegv.cpp @@ -907,14 +907,14 @@ enum { X86_REG_R13 = REG_R13, X86_REG_R14 = REG_R14, X86_REG_R15 = REG_R15, - X86_REG_EDI = EDI, - X86_REG_ESI = ESI, - X86_REG_EBP = EBP, - X86_REG_EBX = EBX, - X86_REG_EDX = EDX, - X86_REG_EAX = EAX, - X86_REG_ECX = ECX, - X86_REG_ESP = ESP, + X86_REG_EDI = REG_RDI, + X86_REG_ESI = REG_RSI, + X86_REG_EBP = REG_RBP, + X86_REG_EBX = REG_RBX, + X86_REG_EDX = REG_RDX, + X86_REG_EAX = REG_RAX, + X86_REG_ECX = REG_RCX, + X86_REG_ESP = REG_RSP, X86_REG_EIP = REG_RIP #endif };