1 |
|
/* |
2 |
|
* sysdeps.h - System dependent definitions for Unix |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2000 Christian Bauer |
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 |
42 |
|
#include <stdio.h> |
43 |
|
#include <stdlib.h> |
44 |
|
#include <string.h> |
45 |
– |
#include <pthread.h> |
45 |
|
|
46 |
|
#ifdef HAVE_FCNTL_H |
47 |
|
# include <fcntl.h> |
59 |
|
#endif |
60 |
|
|
61 |
|
|
62 |
< |
/* Are the Mac and the host address space the same? */ |
62 |
> |
#ifdef ENABLE_NATIVE_M68K |
63 |
> |
|
64 |
> |
/* Mac and host address space are the same */ |
65 |
> |
#define REAL_ADDRESSING 1 |
66 |
> |
|
67 |
> |
/* Using 68k natively */ |
68 |
> |
#define EMULATED_68K 0 |
69 |
> |
|
70 |
> |
/* Mac ROM is not write protected */ |
71 |
> |
#define ROM_IS_WRITE_PROTECTED 0 |
72 |
> |
|
73 |
> |
#else |
74 |
> |
|
75 |
> |
/* Mac and host address space are distinct */ |
76 |
> |
#ifndef REAL_ADDRESSING |
77 |
|
#define REAL_ADDRESSING 0 |
78 |
+ |
#endif |
79 |
|
|
80 |
< |
/* Are we using a 68k emulator or the real thing? */ |
80 |
> |
/* Using 68k emulator */ |
81 |
|
#define EMULATED_68K 1 |
82 |
|
|
83 |
< |
/* Is the Mac ROM write protected? */ |
84 |
< |
#define ROM_IS_WRITE_PROTECTED 1 |
83 |
> |
/* The m68k emulator uses a prefetch buffer ? */ |
84 |
> |
#define USE_PREFETCH_BUFFER 0 |
85 |
> |
|
86 |
> |
/* Mac ROM is write protected */ |
87 |
> |
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
88 |
> |
# define ROM_IS_WRITE_PROTECTED 0 |
89 |
> |
# define USE_SCRATCHMEM_SUBTERFUGE 1 |
90 |
> |
#else |
91 |
> |
# define ROM_IS_WRITE_PROTECTED 1 |
92 |
> |
#endif |
93 |
> |
|
94 |
> |
#endif |
95 |
> |
|
96 |
> |
/* Direct Addressing requires Video on SEGV signals */ |
97 |
> |
#if DIRECT_ADDRESSING && !ENABLE_VOSF |
98 |
> |
# undef ENABLE_VOSF |
99 |
> |
# define ENABLE_VOSF 1 |
100 |
> |
#endif |
101 |
|
|
102 |
|
/* ExtFS is supported */ |
103 |
|
#define SUPPORTS_EXTFS 1 |
104 |
|
|
105 |
+ |
|
106 |
|
/* Data types */ |
107 |
|
typedef unsigned char uint8; |
108 |
|
typedef signed char int8; |
137 |
|
#else |
138 |
|
#error "No 8 byte type, you lose." |
139 |
|
#endif |
140 |
+ |
#if SIZEOF_VOID_P == 4 |
141 |
+ |
typedef uint32 uintptr; |
142 |
+ |
typedef int32 intptr; |
143 |
+ |
#elif SIZEOF_VOID_P == 8 |
144 |
+ |
typedef uint64 uintptr; |
145 |
+ |
typedef int64 intptr; |
146 |
+ |
#else |
147 |
+ |
#error "Unsupported size of pointer" |
148 |
+ |
#endif |
149 |
|
|
150 |
|
/* Time data type for Time Manager emulation */ |
151 |
|
#ifdef HAVE_CLOCK_GETTIME |
173 |
|
# define CPU_CAN_ACCESS_UNALIGNED |
174 |
|
#endif |
175 |
|
|
176 |
+ |
/* Timing functions */ |
177 |
+ |
extern uint64 GetTicks_usec(void); |
178 |
+ |
extern void Delay_usec(uint32 usec); |
179 |
+ |
|
180 |
|
/* UAE CPU defines */ |
181 |
|
#ifdef WORDS_BIGENDIAN |
182 |
|
|
263 |
|
#define call_mem_put_func(func, addr, v) ((*func)(addr, v)) |
264 |
|
#define __inline__ inline |
265 |
|
#define CPU_EMU_SIZE 0 |
222 |
– |
#undef USE_MAPPED_MEMORY |
223 |
– |
#undef CAN_MAP_MEMORY |
266 |
|
#undef NO_INLINE_MEMORY_ACCESS |
267 |
|
#undef MD_HAVE_MEM_1_FUNCS |
226 |
– |
#undef USE_COMPILER |
268 |
|
#define ENUMDECL typedef enum |
269 |
|
#define ENUMNAME(name) name |
270 |
|
#define write_log printf |
271 |
|
|
272 |
+ |
#ifdef USE_COMPILER |
273 |
+ |
#define USE_MAPPED_MEMORY |
274 |
+ |
#define CAN_MAP_MEMORY |
275 |
+ |
#define NO_EXCEPTION_3 |
276 |
+ |
#define NO_PREFETCH_BUFFER |
277 |
+ |
#else |
278 |
+ |
#undef USE_MAPPED_MEMORY |
279 |
+ |
#undef CAN_MAP_MEMORY |
280 |
+ |
#endif |
281 |
+ |
|
282 |
|
#ifdef X86_ASSEMBLY |
283 |
|
#define ASM_SYM_FOR_FUNC(a) __asm__(a) |
284 |
|
#else |