1 |
|
/* |
2 |
|
* sysdeps.h - System dependent definitions for Unix |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2000 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2002 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 |
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; |
158 |
|
typedef struct timeval tm_time_t; |
159 |
|
#endif |
160 |
|
|
158 |
– |
/* Offset Mac->Unix time in seconds */ |
159 |
– |
#define TIME_OFFSET 0x7c25b080 |
160 |
– |
|
161 |
|
/* UAE CPU data types */ |
162 |
|
#define uae_s8 int8 |
163 |
|
#define uae_u8 uint8 |
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 |
|
|
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 |
|
|
288 |
|
#define ENUMDECL typedef enum |
289 |
|
#define ENUMNAME(name) name |
290 |
|
#define write_log printf |
272 |
– |
#undef USE_MAPPED_MEMORY |
273 |
– |
#undef CAN_MAP_MEMORY |
291 |
|
|
292 |
|
#ifdef X86_ASSEMBLY |
293 |
|
#define ASM_SYM_FOR_FUNC(a) __asm__(a) |