1 |
|
/* |
2 |
|
* sysdeps.h - System dependent definitions for Linux |
3 |
|
* |
4 |
< |
* SheepShaver (C) 1997-2005 Christian Bauer and Marc Hellwig |
4 |
> |
* SheepShaver (C) 1997-2008 Christian Bauer and Marc Hellwig |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
64 |
|
# endif |
65 |
|
#endif |
66 |
|
|
67 |
+ |
#ifdef __MACH__ |
68 |
+ |
#include <mach/mach_types.h> |
69 |
+ |
#endif |
70 |
+ |
|
71 |
|
// Fix offsetof() on FreeBSD and GCC >= 3.4 |
72 |
|
#if defined(__FreeBSD__) && defined(__cplusplus) |
73 |
|
#undef offsetof |
87 |
|
#if !defined(EMULATED_PPC) |
88 |
|
#define REAL_ADDRESSING 1 |
89 |
|
#include "ppc_asm.tmpl" |
86 |
– |
#elif defined(__CYGWIN__) |
87 |
– |
#define DIRECT_ADDRESSING 1 |
88 |
– |
#define DIRECT_ADDRESSING_HACK 1 |
89 |
– |
/* |
90 |
– |
The following address translation functions were empirically |
91 |
– |
determined on a Windows XP system running Cygwin 1.5.12-1 so |
92 |
– |
that RAM size can be maximized (up to 960 MB) and avoiding |
93 |
– |
the use of a TLB. This also takes into account reduced address |
94 |
– |
space available when the Cygwin runtime is used. |
95 |
– |
*/ |
96 |
– |
#define DIRECT_ADDRESSING_VIRT2PHYS(ADDR) \ |
97 |
– |
((ADDR) + (((ADDR) < 0x41000000) ? 0x39000000 : 0xcf800000)) |
98 |
– |
#define DIRECT_ADDRESSING_PHYS2VIRT(ADDR) \ |
99 |
– |
((ADDR) - (((ADDR) >= 0x39000000) ? 0x39000000 : 0xcf800000)) |
90 |
|
#elif defined(NATMEM_OFFSET) |
91 |
|
#define DIRECT_ADDRESSING 1 |
92 |
|
#else |
93 |
|
#define REAL_ADDRESSING 1 |
94 |
|
#endif |
95 |
|
|
96 |
+ |
// Always use the complete non-stubs Ethernet driver |
97 |
+ |
#define USE_ETHER_FULL_DRIVER 1 |
98 |
+ |
|
99 |
|
#define POWERPC_ROM 1 |
100 |
|
|
101 |
|
#if EMULATED_PPC |
113 |
|
#define PPC_FLIGHT_RECORDER 1 |
114 |
|
#define PPC_PROFILE_COMPILE_TIME 0 |
115 |
|
#define PPC_PROFILE_GENERIC_CALLS 0 |
116 |
+ |
#define PPC_PROFILE_REGS_USE 0 |
117 |
|
#define KPX_MAX_CPUS 1 |
118 |
|
#if ENABLE_DYNGEN |
125 |
– |
// Don't bother with predecode cache when using JIT |
119 |
|
#define PPC_ENABLE_JIT 1 |
127 |
– |
#undef PPC_DECODE_CACHE |
120 |
|
#endif |
121 |
< |
#if defined(__i386__) |
121 |
> |
#if defined(__i386__) || defined(__x86_64__) |
122 |
|
#define DYNGEN_ASM_OPTS 1 |
123 |
|
#endif |
124 |
|
#else |
171 |
|
#error "Unsupported size of pointer" |
172 |
|
#endif |
173 |
|
|
174 |
+ |
// Define if the host processor supports fast unaligned load/stores |
175 |
+ |
#if defined __i386__ || defined __x86_64__ |
176 |
+ |
#define UNALIGNED_PROFITABLE 1 |
177 |
+ |
#endif |
178 |
+ |
|
179 |
+ |
|
180 |
|
/** |
181 |
|
* Helper functions to byteswap data |
182 |
|
**/ |
404 |
|
// Time data type for Time Manager emulation |
405 |
|
#ifdef HAVE_CLOCK_GETTIME |
406 |
|
typedef struct timespec tm_time_t; |
407 |
+ |
#elif defined(__MACH__) |
408 |
+ |
typedef mach_timespec_t tm_time_t; |
409 |
|
#else |
410 |
|
typedef struct timeval tm_time_t; |
411 |
|
#endif |
419 |
|
#define C4X_FLOAT_FORMAT 4 |
420 |
|
|
421 |
|
// High-precision timing |
422 |
< |
#if defined(HAVE_PTHREADS) && defined(HAVE_CLOCK_NANOSLEEP) && 0 |
422 |
> |
#if defined(HAVE_PTHREADS) && defined(HAVE_CLOCK_NANOSLEEP) |
423 |
|
#define PRECISE_TIMING 1 |
424 |
|
#define PRECISE_TIMING_POSIX 1 |
425 |
+ |
#elif defined(HAVE_PTHREADS) && defined(__MACH__) |
426 |
+ |
#define PRECISE_TIMING 1 |
427 |
+ |
#define PRECISE_TIMING_MACH 1 |
428 |
|
#endif |
429 |
|
|
430 |
|
// Timing functions |