4 |
|
* |
5 |
|
* $Id$ |
6 |
|
* |
7 |
< |
* Basilisk II (C) 1997-2001 Christian Bauer |
7 |
> |
* Basilisk II (C) 1997-2005 Christian Bauer |
8 |
|
* |
9 |
|
* This program is free software; you can redistribute it and/or modify |
10 |
|
* it under the terms of the GNU General Public License as published by |
46 |
|
#include <stdlib.h> |
47 |
|
#include <string.h> |
48 |
|
|
49 |
+ |
#ifdef HAVE_PTHREADS |
50 |
+ |
# include <pthread.h> |
51 |
+ |
#endif |
52 |
+ |
|
53 |
|
#ifdef HAVE_FCNTL_H |
54 |
|
# include <fcntl.h> |
55 |
|
#endif |
66 |
|
#endif |
67 |
|
|
68 |
|
|
69 |
< |
/* Emulator and host address space are distinct */ |
70 |
< |
#ifndef REAL_ADDRESSING |
71 |
< |
#define REAL_ADDRESSING 0 |
69 |
> |
/* Symbol to distinguish Nigel's Aqua port from a normal Darwin X11 build */ |
70 |
> |
/* (this sysdeps.h file is currently specific to the Mac OS X Aqua port) */ |
71 |
> |
#define AQUA 1 |
72 |
> |
|
73 |
> |
/* Header which defines OS X version for selecting APIs */ |
74 |
> |
#ifdef AVAILABILITYMACROS |
75 |
> |
# include <AvailabilityMacros.h> |
76 |
|
#endif |
77 |
|
|
78 |
< |
/* Linear address translation (i.e. just an offset between Emulator & host) */ |
79 |
< |
#ifndef DIRECT_ADDRESSING |
80 |
< |
#define DIRECT_ADDRESSING 1 |
78 |
> |
|
79 |
> |
#ifdef ENABLE_NATIVE_M68K |
80 |
> |
|
81 |
> |
/* Mac and host address space are the same */ |
82 |
> |
#define REAL_ADDRESSING 1 |
83 |
> |
|
84 |
> |
/* Using 68k natively */ |
85 |
> |
#define EMULATED_68K 0 |
86 |
> |
|
87 |
> |
/* Mac ROM is not write protected */ |
88 |
> |
#define ROM_IS_WRITE_PROTECTED 0 |
89 |
> |
#define USE_SCRATCHMEM_SUBTERFUGE 1 |
90 |
> |
|
91 |
> |
#else |
92 |
> |
|
93 |
> |
/* Mac and host address space are distinct */ |
94 |
> |
#ifndef REAL_ADDRESSING |
95 |
> |
#define REAL_ADDRESSING 0 |
96 |
|
#endif |
97 |
|
|
98 |
|
/* Using 68k emulator */ |
109 |
|
# define ROM_IS_WRITE_PROTECTED 1 |
110 |
|
#endif |
111 |
|
|
112 |
+ |
#endif |
113 |
+ |
|
114 |
+ |
/* Direct Addressing requires Video on SEGV signals */ |
115 |
+ |
#if DIRECT_ADDRESSING && !ENABLE_VOSF |
116 |
+ |
# undef ENABLE_VOSF |
117 |
+ |
# define ENABLE_VOSF 1 |
118 |
+ |
#endif |
119 |
|
|
120 |
|
/* ExtFS is supported */ |
121 |
|
#define SUPPORTS_EXTFS 1 |
122 |
|
|
123 |
+ |
/* BSD socket API supported */ |
124 |
+ |
#define SUPPORTS_UDP_TUNNEL 1 |
125 |
+ |
|
126 |
|
|
127 |
|
/* Data types */ |
128 |
|
typedef unsigned char uint8; |
168 |
|
#error "Unsupported size of pointer" |
169 |
|
#endif |
170 |
|
|
171 |
+ |
#ifndef HAVE_LOFF_T |
172 |
+ |
typedef off_t loff_t; |
173 |
+ |
#endif |
174 |
+ |
#ifndef HAVE_CADDR_T |
175 |
+ |
typedef char * caddr_t; |
176 |
+ |
#endif |
177 |
+ |
|
178 |
|
/* Time data type for Time Manager emulation */ |
179 |
|
#ifdef HAVE_CLOCK_GETTIME |
180 |
|
typedef struct timespec tm_time_t; |
182 |
|
typedef struct timeval tm_time_t; |
183 |
|
#endif |
184 |
|
|
185 |
< |
/* Offset Mac->Unix time in seconds */ |
186 |
< |
#define TIME_OFFSET 0x7c25b080 |
185 |
> |
/* Define codes for all the float formats that we know of. |
186 |
> |
* Though we only handle IEEE format. */ |
187 |
> |
#define UNKNOWN_FLOAT_FORMAT 0 |
188 |
> |
#define IEEE_FLOAT_FORMAT 1 |
189 |
> |
#define VAX_FLOAT_FORMAT 2 |
190 |
> |
#define IBM_FLOAT_FORMAT 3 |
191 |
> |
#define C4X_FLOAT_FORMAT 4 |
192 |
|
|
193 |
|
/* UAE CPU data types */ |
194 |
|
#define uae_s8 int8 |
202 |
|
typedef uae_u32 uaecptr; |
203 |
|
|
204 |
|
/* Alignment restrictions */ |
205 |
< |
#if defined(__i386__) || defined(__powerpc__) || defined(__m68k__) |
205 |
> |
#if defined(__i386__) || defined(__powerpc__) || defined(__m68k__) || defined(__x86_64__) |
206 |
|
# define CPU_CAN_ACCESS_UNALIGNED |
207 |
|
#endif |
208 |
|
|
210 |
|
extern uint64 GetTicks_usec(void); |
211 |
|
extern void Delay_usec(uint32 usec); |
212 |
|
|
213 |
+ |
#ifdef HAVE_PTHREADS |
214 |
+ |
/* Centralized pthread attribute setup */ |
215 |
+ |
void Set_pthread_attr(pthread_attr_t *attr, int priority); |
216 |
+ |
#endif |
217 |
+ |
|
218 |
|
/* UAE CPU defines */ |
219 |
|
#ifdef WORDS_BIGENDIAN |
220 |
|
|
255 |
|
|
256 |
|
#else /* WORDS_BIGENDIAN */ |
257 |
|
|
258 |
< |
#ifdef __i386__ |
258 |
> |
#if defined(__i386__) || defined(__x86_64__) |
259 |
|
|
260 |
|
/* Intel x86 */ |
261 |
|
#define X86_PPRO_OPT |
325 |
|
#define ENUMDECL typedef enum |
326 |
|
#define ENUMNAME(name) name |
327 |
|
#define write_log printf |
278 |
– |
#undef USE_MAPPED_MEMORY |
279 |
– |
#undef CAN_MAP_MEMORY |
328 |
|
|
329 |
< |
#ifdef X86_ASSEMBLY |
329 |
> |
#if defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY) |
330 |
|
#define ASM_SYM_FOR_FUNC(a) __asm__(a) |
331 |
|
#else |
332 |
|
#define ASM_SYM_FOR_FUNC(a) |