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 |
|
|
161 |
< |
/* Offset Mac->Unix time in seconds */ |
162 |
< |
#define TIME_OFFSET 0x7c25b080 |
161 |
> |
/* Define codes for all the float formats that we know of. |
162 |
> |
* Though we only handle IEEE format. */ |
163 |
> |
#define UNKNOWN_FLOAT_FORMAT 0 |
164 |
> |
#define IEEE_FLOAT_FORMAT 1 |
165 |
> |
#define VAX_FLOAT_FORMAT 2 |
166 |
> |
#define IBM_FLOAT_FORMAT 3 |
167 |
> |
#define C4X_FLOAT_FORMAT 4 |
168 |
|
|
169 |
|
/* UAE CPU data types */ |
170 |
|
#define uae_s8 int8 |
186 |
|
extern uint64 GetTicks_usec(void); |
187 |
|
extern void Delay_usec(uint32 usec); |
188 |
|
|
189 |
+ |
#ifdef HAVE_PTHREADS |
190 |
+ |
/* Centralized pthread attribute setup */ |
191 |
+ |
void Set_pthread_attr(pthread_attr_t *attr, int priority); |
192 |
+ |
#endif |
193 |
+ |
|
194 |
|
/* UAE CPU defines */ |
195 |
|
#ifdef WORDS_BIGENDIAN |
196 |
|
|
249 |
|
#else |
250 |
|
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); *a = v;} |
251 |
|
#endif |
252 |
+ |
#define HAVE_OPTIMIZED_BYTESWAP_32 |
253 |
+ |
/* bswap doesn't affect condition codes */ |
254 |
+ |
static inline uae_u32 do_byteswap_32(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;} |
255 |
+ |
#define HAVE_OPTIMIZED_BYTESWAP_16 |
256 |
+ |
#ifdef X86_PPRO_OPT |
257 |
+ |
static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;} |
258 |
+ |
#else |
259 |
+ |
static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); return v;} |
260 |
+ |
#endif |
261 |
|
|
262 |
|
#elif defined(CPU_CAN_ACCESS_UNALIGNED) |
263 |
|
|
279 |
|
|
280 |
|
#endif /* WORDS_BIGENDIAN */ |
281 |
|
|
282 |
+ |
#ifndef HAVE_OPTIMIZED_BYTESWAP_32 |
283 |
+ |
static inline uae_u32 do_byteswap_32(uae_u32 v) |
284 |
+ |
{ return (((v >> 24) & 0xff) | ((v >> 8) & 0xff00) | ((v & 0xff) << 24) | ((v & 0xff00) << 8)); } |
285 |
+ |
#endif |
286 |
+ |
|
287 |
+ |
#ifndef HAVE_OPTIMIZED_BYTESWAP_16 |
288 |
+ |
static inline uae_u32 do_byteswap_16(uae_u32 v) |
289 |
+ |
{ return (((v >> 8) & 0xff) | ((v & 0xff) << 8)); } |
290 |
+ |
#endif |
291 |
+ |
|
292 |
|
#define do_get_mem_byte(a) ((uae_u32)*((uae_u8 *)(a))) |
293 |
|
#define do_put_mem_byte(a, v) (*(uae_u8 *)(a) = (v)) |
294 |
|
|
301 |
|
#define ENUMDECL typedef enum |
302 |
|
#define ENUMNAME(name) name |
303 |
|
#define write_log printf |
272 |
– |
#undef USE_MAPPED_MEMORY |
273 |
– |
#undef CAN_MAP_MEMORY |
304 |
|
|
305 |
|
#ifdef X86_ASSEMBLY |
306 |
|
#define ASM_SYM_FOR_FUNC(a) __asm__(a) |