72 |
|
#define POWERPC_ROM 1 |
73 |
|
|
74 |
|
#if EMULATED_PPC |
75 |
– |
// Handle interrupts asynchronously? |
76 |
– |
#define ASYNC_IRQ 0 |
75 |
|
// Mac ROM is write protected when banked memory is used |
76 |
|
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
77 |
|
# define ROM_IS_WRITE_PROTECTED 0 |
80 |
|
# define ROM_IS_WRITE_PROTECTED 1 |
81 |
|
#endif |
82 |
|
// Configure PowerPC emulator |
83 |
< |
#define PPC_CHECK_INTERRUPTS (ASYNC_IRQ ? 0 : 1) |
83 |
> |
#define PPC_REENTRANT_JIT 1 |
84 |
> |
#define PPC_CHECK_INTERRUPTS 1 |
85 |
|
#define PPC_DECODE_CACHE 1 |
86 |
|
#define PPC_FLIGHT_RECORDER 1 |
87 |
|
#define PPC_PROFILE_COMPILE_TIME 0 |
88 |
|
#define PPC_PROFILE_GENERIC_CALLS 0 |
89 |
|
#define KPX_MAX_CPUS 1 |
90 |
+ |
#if ENABLE_DYNGEN |
91 |
+ |
// Don't bother with predecode cache when using JIT |
92 |
+ |
#define PPC_ENABLE_JIT 1 |
93 |
+ |
#undef PPC_DECODE_CACHE |
94 |
+ |
#endif |
95 |
+ |
#if defined(__i386__) |
96 |
+ |
#define DYNGEN_ASM_OPTS 1 |
97 |
+ |
#endif |
98 |
|
#else |
99 |
|
// Mac ROM is write protected |
100 |
|
#define ROM_IS_WRITE_PROTECTED 1 |
254 |
|
} |
255 |
|
#endif |
256 |
|
|
257 |
< |
#ifdef __i386__ |
257 |
> |
/* FIXME: SheepShaver occasionnally hangs with those locks */ |
258 |
> |
#if 0 && (defined(__i386__) || defined(__x86_64__)) |
259 |
|
#define HAVE_TEST_AND_SET 1 |
260 |
|
static inline int testandset(volatile int *p) |
261 |
|
{ |
262 |
< |
int ret; |
255 |
< |
long int readval; |
262 |
> |
long int ret; |
263 |
|
/* Note: the "xchg" instruction does not need a "lock" prefix */ |
264 |
< |
__asm__ __volatile__("xchgl %0, %1" |
265 |
< |
: "=r" (ret), "=m" (*p), "=a" (readval) |
264 |
> |
__asm__ __volatile__("xchgl %k0, %1" |
265 |
> |
: "=r" (ret), "=m" (*p) |
266 |
|
: "0" (1), "m" (*p) |
267 |
|
: "memory"); |
268 |
|
return ret; |
334 |
|
|
335 |
|
#endif /* __GNUC__ */ |
336 |
|
|
330 |
– |
#if HAVE_TEST_AND_SET |
331 |
– |
#define HAVE_SPINLOCKS 1 |
337 |
|
typedef volatile int spinlock_t; |
338 |
|
|
339 |
|
static const spinlock_t SPIN_LOCK_UNLOCKED = 0; |
340 |
|
|
341 |
+ |
#if HAVE_TEST_AND_SET |
342 |
+ |
#define HAVE_SPINLOCKS 1 |
343 |
|
static inline void spin_lock(spinlock_t *lock) |
344 |
|
{ |
345 |
|
while (testandset(lock)); |
354 |
|
{ |
355 |
|
return !testandset(lock); |
356 |
|
} |
357 |
+ |
#else |
358 |
+ |
static inline void spin_lock(spinlock_t *lock) |
359 |
+ |
{ |
360 |
+ |
} |
361 |
+ |
|
362 |
+ |
static inline void spin_unlock(spinlock_t *lock) |
363 |
+ |
{ |
364 |
+ |
} |
365 |
+ |
|
366 |
+ |
static inline int spin_trylock(spinlock_t *lock) |
367 |
+ |
{ |
368 |
+ |
return 1; |
369 |
+ |
} |
370 |
|
#endif |
371 |
|
|
372 |
|
// Time data type for Time Manager emulation |