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 |
26 |
|
#endif |
27 |
|
|
28 |
|
#include "config.h" |
29 |
+ |
#include "user_strings_unix.h" |
30 |
|
|
31 |
|
#ifndef STDC_HEADERS |
32 |
|
#error "You don't have ANSI C header files." |
42 |
|
#include <stdio.h> |
43 |
|
#include <stdlib.h> |
44 |
|
#include <string.h> |
44 |
– |
#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 |
|
#define REAL_ADDRESSING 0 |
77 |
|
|
78 |
< |
/* Are we using a 68k emulator or the real thing? */ |
78 |
> |
/* Using 68k emulator */ |
79 |
|
#define EMULATED_68K 1 |
80 |
|
|
81 |
< |
/* Is the Mac ROM write protected? */ |
81 |
> |
/* Mac ROM is write protected */ |
82 |
|
#define ROM_IS_WRITE_PROTECTED 1 |
83 |
|
|
84 |
+ |
#endif |
85 |
+ |
|
86 |
+ |
/* ExtFS is supported */ |
87 |
+ |
#define SUPPORTS_EXTFS 1 |
88 |
+ |
|
89 |
+ |
|
90 |
|
/* Data types */ |
91 |
|
typedef unsigned char uint8; |
92 |
|
typedef signed char int8; |
111 |
|
#if SIZEOF_LONG == 8 |
112 |
|
typedef unsigned long uint64; |
113 |
|
typedef long int64; |
114 |
+ |
#define VAL64(a) (a ## l) |
115 |
+ |
#define UVAL64(a) (a ## ul) |
116 |
|
#elif SIZEOF_LONG_LONG == 8 |
117 |
|
typedef unsigned long long uint64; |
118 |
|
typedef long long int64; |
119 |
+ |
#define VAL64(a) (a ## LL) |
120 |
+ |
#define UVAL64(a) (a ## uLL) |
121 |
|
#else |
122 |
|
#error "No 8 byte type, you lose." |
123 |
|
#endif |
129 |
|
typedef struct timeval tm_time_t; |
130 |
|
#endif |
131 |
|
|
132 |
+ |
/* Offset Mac->Unix time in seconds */ |
133 |
+ |
#define TIME_OFFSET 0x7c25b080 |
134 |
+ |
|
135 |
|
/* UAE CPU data types */ |
136 |
|
#define uae_s8 int8 |
137 |
|
#define uae_u8 uint8 |
139 |
|
#define uae_u16 uint16 |
140 |
|
#define uae_s32 int32 |
141 |
|
#define uae_u32 uint32 |
142 |
+ |
#define uae_s64 int64 |
143 |
+ |
#define uae_u64 uint64 |
144 |
|
typedef uae_u32 uaecptr; |
145 |
|
|
146 |
|
/* Alignment restrictions */ |
147 |
< |
#if defined(__i386__) || defined(__powerpc__) |
147 |
> |
#if defined(__i386__) || defined(__powerpc__) || defined(__m68k__) |
148 |
|
# define CPU_CAN_ACCESS_UNALIGNED |
149 |
|
#endif |
150 |
|
|
151 |
+ |
/* Timing functions */ |
152 |
+ |
extern uint64 GetTicks_usec(void); |
153 |
+ |
extern void Delay_usec(uint32 usec); |
154 |
+ |
|
155 |
|
/* UAE CPU defines */ |
156 |
|
#ifdef WORDS_BIGENDIAN |
157 |
|
|
238 |
|
#define call_mem_put_func(func, addr, v) ((*func)(addr, v)) |
239 |
|
#define __inline__ inline |
240 |
|
#define CPU_EMU_SIZE 0 |
209 |
– |
#undef USE_MAPPED_MEMORY |
210 |
– |
#undef CAN_MAP_MEMORY |
241 |
|
#undef NO_INLINE_MEMORY_ACCESS |
242 |
|
#undef MD_HAVE_MEM_1_FUNCS |
213 |
– |
#undef USE_COMPILER |
243 |
|
#define ENUMDECL typedef enum |
244 |
|
#define ENUMNAME(name) name |
245 |
|
#define write_log printf |
246 |
|
|
247 |
+ |
#ifdef USE_COMPILER |
248 |
+ |
#define USE_MAPPED_MEMORY |
249 |
+ |
#define CAN_MAP_MEMORY |
250 |
+ |
#define NO_EXCEPTION_3 |
251 |
+ |
#define NO_PREFETCH_BUFFER |
252 |
+ |
#else |
253 |
+ |
#undef USE_MAPPED_MEMORY |
254 |
+ |
#undef CAN_MAP_MEMORY |
255 |
+ |
#endif |
256 |
+ |
|
257 |
|
#ifdef X86_ASSEMBLY |
258 |
|
#define ASM_SYM_FOR_FUNC(a) __asm__(a) |
259 |
|
#else |