--- SheepShaver/src/Unix/sysdeps.h 2005/06/25 11:06:24 1.43 +++ SheepShaver/src/Unix/sysdeps.h 2007/02/17 09:01:30 1.56 @@ -83,26 +83,15 @@ #if !defined(EMULATED_PPC) #define REAL_ADDRESSING 1 #include "ppc_asm.tmpl" -#elif defined(__CYGWIN__) -#define DIRECT_ADDRESSING 1 -#define DIRECT_ADDRESSING_HACK 1 -/* - The following address translation functions were empirically - determined on a Windows XP system running Cygwin 1.5.12-1 so - that RAM size can be maximized (up to 960 MB) and avoiding - the use of a TLB. This also takes into account reduced address - space available when the Cygwin runtime is used. -*/ -#define DIRECT_ADDRESSING_VIRT2PHYS(ADDR) \ - ((ADDR) + (((ADDR) < 0x41000000) ? 0x39000000 : 0xcf800000)) -#define DIRECT_ADDRESSING_PHYS2VIRT(ADDR) \ - ((ADDR) - (((ADDR) >= 0x39000000) ? 0x39000000 : 0xcf800000)) #elif defined(NATMEM_OFFSET) #define DIRECT_ADDRESSING 1 #else #define REAL_ADDRESSING 1 #endif +// Always use the complete non-stubs Ethernet driver +#define USE_ETHER_FULL_DRIVER 1 + #define POWERPC_ROM 1 #if EMULATED_PPC @@ -119,14 +108,13 @@ #define PPC_DECODE_CACHE 1 #define PPC_FLIGHT_RECORDER 1 #define PPC_PROFILE_COMPILE_TIME 0 -#define PPC_PROFILE_GENERIC_CALLS 0 +#define PPC_PROFILE_GENERIC_CALLS 1 +#define PPC_PROFILE_REGS_USE 0 #define KPX_MAX_CPUS 1 #if ENABLE_DYNGEN -// Don't bother with predecode cache when using JIT #define PPC_ENABLE_JIT 1 -#undef PPC_DECODE_CACHE #endif -#if defined(__i386__) +#if defined(__i386__) || defined(__x86_64__) #define DYNGEN_ASM_OPTS 1 #endif #else @@ -179,6 +167,12 @@ typedef int64 intptr; #error "Unsupported size of pointer" #endif +// Define if the host processor supports fast unaligned load/stores +#if defined __i386__ || defined __x86_64__ +#define UNALIGNED_PROFITABLE 1 +#endif + + /** * Helper functions to byteswap data **/ @@ -288,8 +282,7 @@ static inline int testandset(volatile in } #endif -/* FIXME: SheepShaver occasionnally hangs with those locks */ -#if 0 && (defined(__i386__) || defined(__x86_64__)) +#if defined(__i386__) || defined(__x86_64__) #define HAVE_TEST_AND_SET 1 static inline int testandset(volatile int *p) { @@ -372,7 +365,8 @@ typedef volatile int spinlock_t; static const spinlock_t SPIN_LOCK_UNLOCKED = 0; -#if HAVE_TEST_AND_SET +#if defined(HAVE_TEST_AND_SET) && defined(HAVE_PTHREADS) +// There is nothing to lock if we are not in an multithreaded environment #define HAVE_SPINLOCKS 1 static inline void spin_lock(spinlock_t *lock) { @@ -419,7 +413,7 @@ typedef struct timeval tm_time_t; #define C4X_FLOAT_FORMAT 4 // High-precision timing -#if defined(HAVE_PTHREADS) && defined(HAVE_CLOCK_NANOSLEEP) && 0 +#if defined(HAVE_PTHREADS) && defined(HAVE_CLOCK_NANOSLEEP) #define PRECISE_TIMING 1 #define PRECISE_TIMING_POSIX 1 #endif @@ -442,16 +436,16 @@ typedef struct rgb_color { } rgb_color; // X11 display fast locks -#ifdef HAVE_SPINLOCKS -#define X11_LOCK_TYPE spinlock_t -#define X11_LOCK_INIT SPIN_LOCK_UNLOCKED -#define XDisplayLock() spin_lock(&x_display_lock) -#define XDisplayUnlock() spin_unlock(&x_display_lock) -#elif defined(HAVE_PTHREADS) +#if defined(HAVE_PTHREADS) #define X11_LOCK_TYPE pthread_mutex_t #define X11_LOCK_INIT PTHREAD_MUTEX_INITIALIZER #define XDisplayLock() pthread_mutex_lock(&x_display_lock); #define XDisplayUnlock() pthread_mutex_unlock(&x_display_lock); +#elif defined(HAVE_SPINLOCKS) +#define X11_LOCK_TYPE spinlock_t +#define X11_LOCK_INIT SPIN_LOCK_UNLOCKED +#define XDisplayLock() spin_lock(&x_display_lock) +#define XDisplayUnlock() spin_unlock(&x_display_lock) #else #define XDisplayLock() #define XDisplayUnlock()