44 |
|
#include <string.h> |
45 |
|
#include <signal.h> |
46 |
|
|
47 |
+ |
#ifdef HAVE_PTHREADS |
48 |
+ |
# include <pthread.h> |
49 |
+ |
#endif |
50 |
+ |
|
51 |
|
#ifdef HAVE_FCNTL_H |
52 |
|
# include <fcntl.h> |
53 |
|
#endif |
82 |
|
# define ROM_IS_WRITE_PROTECTED 1 |
83 |
|
#endif |
84 |
|
// Configure PowerPC emulator |
85 |
+ |
#define PPC_REENTRANT_JIT 1 |
86 |
|
#define PPC_CHECK_INTERRUPTS (ASYNC_IRQ ? 0 : 1) |
87 |
|
#define PPC_DECODE_CACHE 1 |
88 |
|
#define PPC_FLIGHT_RECORDER 1 |
89 |
|
#define PPC_PROFILE_COMPILE_TIME 0 |
90 |
|
#define PPC_PROFILE_GENERIC_CALLS 0 |
91 |
|
#define KPX_MAX_CPUS 1 |
92 |
+ |
#if defined(__i386__) |
93 |
+ |
#define DYNGEN_ASM_OPTS 1 |
94 |
+ |
#endif |
95 |
|
#else |
96 |
|
// Mac ROM is write protected |
97 |
|
#define ROM_IS_WRITE_PROTECTED 1 |
147 |
|
**/ |
148 |
|
|
149 |
|
#if defined(__GNUC__) |
150 |
< |
#if defined(__x86_64__) |
150 |
> |
#if defined(__x86_64__) || defined(__i386__) |
151 |
|
// Linux/AMD64 currently has no asm optimized bswap_32() in <byteswap.h> |
152 |
|
#define opt_bswap_32 do_opt_bswap_32 |
153 |
|
static inline uint32 do_opt_bswap_32(uint32 x) |
192 |
|
((x & 0x000000ff) << 24) ); |
193 |
|
} |
194 |
|
|
195 |
+ |
#if defined(__i386__) |
196 |
+ |
#define opt_bswap_64 do_opt_bswap_64 |
197 |
+ |
static inline uint64 do_opt_bswap_64(uint64 x) |
198 |
+ |
{ |
199 |
+ |
return (bswap_32(x >> 32) | (((uint64)bswap_32((uint32)x)) << 32)); |
200 |
+ |
} |
201 |
+ |
#endif |
202 |
+ |
|
203 |
|
#ifdef opt_bswap_64 |
204 |
|
#undef bswap_64 |
205 |
|
#define bswap_64 opt_bswap_64 |
364 |
|
extern uint64 GetTicks_usec(void); |
365 |
|
extern void Delay_usec(uint32 usec); |
366 |
|
|
367 |
+ |
#if defined(HAVE_PTHREADS) || (defined(__linux__) && defined(__powerpc__)) |
368 |
|
// Setup pthread attributes |
369 |
|
extern void Set_pthread_attr(pthread_attr_t *attr, int priority); |
370 |
+ |
#endif |
371 |
|
|
372 |
|
// Various definitions |
373 |
|
typedef struct rgb_color { |