ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/sysdeps.h
(Generate patch)

Comparing BasiliskII/src/Unix/sysdeps.h (file contents):
Revision 1.10 by cebix, 2000-04-10T18:53:08Z vs.
Revision 1.20 by cebix, 2001-07-12T19:48:27Z

# Line 1 | Line 1
1   /*
2   *  sysdeps.h - System dependent definitions for Unix
3   *
4 < *  Basilisk II (C) 1997-2000 Christian Bauer
4 > *  Basilisk II (C) 1997-2001 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
# Line 42 | Line 42
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>
# Line 60 | Line 59
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 > #define USE_SCRATCHMEM_SUBTERFUGE 1
73 >
74 > #else
75 >
76 > /* Mac and host address space are distinct */
77 > #ifndef REAL_ADDRESSING
78   #define REAL_ADDRESSING 0
79 + #endif
80  
81 < /* Are we using a 68k emulator or the real thing? */
81 > /* Using 68k emulator */
82   #define EMULATED_68K 1
83  
84 < /* Is the Mac ROM write protected? */
85 < #define ROM_IS_WRITE_PROTECTED 1
84 > /* The m68k emulator uses a prefetch buffer ? */
85 > #define USE_PREFETCH_BUFFER 0
86 >
87 > /* Mac ROM is write protected when banked memory is used */
88 > #if REAL_ADDRESSING || DIRECT_ADDRESSING
89 > # define ROM_IS_WRITE_PROTECTED 0
90 > # define USE_SCRATCHMEM_SUBTERFUGE 1
91 > #else
92 > # define ROM_IS_WRITE_PROTECTED 1
93 > #endif
94 >
95 > #endif
96 >
97 > /* Direct Addressing requires Video on SEGV signals */
98 > #if DIRECT_ADDRESSING && !ENABLE_VOSF
99 > # undef  ENABLE_VOSF
100 > # define ENABLE_VOSF 1
101 > #endif
102  
103   /* ExtFS is supported */
104   #define SUPPORTS_EXTFS 1
105  
106 + /* BSD socket API supported */
107 + #define SUPPORTS_UDP_TUNNEL 1
108 +
109 +
110   /* Data types */
111   typedef unsigned char uint8;
112   typedef signed char int8;
# Line 106 | Line 141 | typedef long long int64;
141   #else
142   #error "No 8 byte type, you lose."
143   #endif
144 + #if SIZEOF_VOID_P == 4
145 + typedef uint32 uintptr;
146 + typedef int32 intptr;
147 + #elif SIZEOF_VOID_P == 8
148 + typedef uint64 uintptr;
149 + typedef int64 intptr;
150 + #else
151 + #error "Unsupported size of pointer"
152 + #endif
153  
154   /* Time data type for Time Manager emulation */
155   #ifdef HAVE_CLOCK_GETTIME
# Line 114 | Line 158 | typedef struct timespec tm_time_t;
158   typedef struct timeval tm_time_t;
159   #endif
160  
117 /* Offset Mac->Unix time in seconds */
118 #define TIME_OFFSET 0x7c25b080
119
161   /* UAE CPU data types */
162   #define uae_s8 int8
163   #define uae_u8 uint8
# Line 133 | Line 174 | typedef uae_u32 uaecptr;
174   # define CPU_CAN_ACCESS_UNALIGNED
175   #endif
176  
177 + /* Timing functions */
178 + extern uint64 GetTicks_usec(void);
179 + extern void Delay_usec(uint32 usec);
180 +
181   /* UAE CPU defines */
182   #ifdef WORDS_BIGENDIAN
183  
# Line 191 | Line 236 | static inline void do_put_mem_word(uae_u
236   #else
237   static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
238   #endif
239 + #define HAVE_OPTIMIZED_BYTESWAP_32
240 + /* bswap doesn't affect condition codes */
241 + static inline uae_u32 do_byteswap_32(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;}
242 + #define HAVE_OPTIMIZED_BYTESWAP_16
243 + #ifdef X86_PPRO_OPT
244 + static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;}
245 + #else
246 + static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); return v;}
247 + #endif
248  
249   #elif defined(CPU_CAN_ACCESS_UNALIGNED)
250  
# Line 212 | Line 266 | static inline void do_put_mem_word(uae_u
266  
267   #endif /* WORDS_BIGENDIAN */
268  
269 + #ifndef HAVE_OPTIMIZED_BYTESWAP_32
270 + static inline uae_u32 do_byteswap_32(uae_u32 v)
271 +        { return (((v >> 24) & 0xff) | ((v >> 8) & 0xff00) | ((v & 0xff) << 24) | ((v & 0xff00) << 8)); }
272 + #endif
273 +
274 + #ifndef HAVE_OPTIMIZED_BYTESWAP_16
275 + static inline uae_u32 do_byteswap_16(uae_u32 v)
276 +        { return (((v >> 8) & 0xff) | ((v & 0xff) << 8)); }
277 + #endif
278 +
279   #define do_get_mem_byte(a) ((uae_u32)*((uae_u8 *)(a)))
280   #define do_put_mem_byte(a, v) (*(uae_u8 *)(a) = (v))
281  
# Line 225 | Line 289 | static inline void do_put_mem_word(uae_u
289   #define ENUMNAME(name) name
290   #define write_log printf
291  
228 #ifdef USE_COMPILER
229 #define USE_MAPPED_MEMORY
230 #define CAN_MAP_MEMORY
231 #define NO_EXCEPTION_3
232 #define NO_PREFETCH_BUFFER
233 #else
234 #undef USE_MAPPED_MEMORY
235 #undef CAN_MAP_MEMORY
236 #endif
237
292   #ifdef X86_ASSEMBLY
293   #define ASM_SYM_FOR_FUNC(a) __asm__(a)
294   #else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines