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

Comparing BasiliskII/src/MacOSX/sysdeps.h (file contents):
Revision 1.3 by nigel, 2002-10-31T08:52:59Z vs.
Revision 1.11 by asvitkine, 2011-03-11T16:47:48Z

# Line 4 | Line 4
4   *
5   *      $Id$
6   *
7 < *      Basilisk II (C) 1997-2001 Christian Bauer
7 > *      Basilisk II (C) 1997-2008 Christian Bauer
8   *
9   *      This program is free software; you can redistribute it and/or modify
10   *      it under the terms of the GNU General Public License as published by
# Line 46 | Line 46
46   #include <stdlib.h>
47   #include <string.h>
48  
49 + #ifdef HAVE_PTHREADS
50 + # include <pthread.h>
51 + #endif
52 +
53   #ifdef HAVE_FCNTL_H
54   # include <fcntl.h>
55   #endif
# Line 61 | Line 65
65   # endif
66   #endif
67  
68 + #if defined(__MACH__)
69 + #include <mach/clock.h>
70 + #endif
71 +
72 + /* Symbol to distinguish Nigel's Aqua port from a normal Darwin X11 build */
73 + /* (this sysdeps.h file is currently specific to the Mac OS X Aqua port)  */
74 + #define AQUA 1
75  
76 + /* Header which defines OS X version for selecting APIs */
77   #ifdef AVAILABILITYMACROS
78   # include <AvailabilityMacros.h>
79   #endif
80  
69 /* Emulator and host address space are distinct */
70 #ifndef REAL_ADDRESSING
71 # define REAL_ADDRESSING 0
72 #endif
81  
82 < /* Linear address translation (i.e. just an offset between Emulator & host)  */
83 < #ifndef DIRECT_ADDRESSING
84 < # ifdef MAC_OS_X_VERSION_10_2
85 < /* For some reason, compiling on 10.2 with DIRECT_ADDRESSING enabled gives an   */
86 < /* app that never writes to its screen! (i.e. it never calls most of video.cpp) */
87 < #  define DIRECT_ADDRESSING 1
88 < //#  define DIRECT_ADDRESSING 0
89 < # else
90 < #  define DIRECT_ADDRESSING 1
91 < # endif
82 > #ifdef ENABLE_NATIVE_M68K
83 >
84 > /* Mac and host address space are the same */
85 > #define REAL_ADDRESSING 1
86 >
87 > /* Using 68k natively */
88 > #define EMULATED_68K 0
89 >
90 > /* Mac ROM is not write protected */
91 > #define ROM_IS_WRITE_PROTECTED 0
92 > #define USE_SCRATCHMEM_SUBTERFUGE 1
93 >
94 > #else
95 >
96 > /* Mac and host address space are distinct */
97 > #ifndef REAL_ADDRESSING
98 > #define REAL_ADDRESSING 0
99   #endif
100  
101   /* Using 68k emulator */
# Line 97 | Line 112
112   # define ROM_IS_WRITE_PROTECTED 1
113   #endif
114  
115 + #endif
116 +
117 + /* Direct Addressing requires Video on SEGV signals */
118 + #if DIRECT_ADDRESSING && !ENABLE_VOSF
119 + # undef  ENABLE_VOSF
120 + # define ENABLE_VOSF 1
121 + #endif
122  
123   /* ExtFS is supported */
124   #define SUPPORTS_EXTFS 1
125  
126 + /* BSD socket API supported */
127 + #define SUPPORTS_UDP_TUNNEL 1
128 +
129  
130   /* Data types */
131   typedef unsigned char uint8;
# Line 146 | Line 171 | typedef int64 intptr;
171   #error "Unsupported size of pointer"
172   #endif
173  
174 + #ifndef HAVE_LOFF_T
175 + typedef off_t loff_t;
176 + #endif
177 + #ifndef HAVE_CADDR_T
178 + typedef char * caddr_t;
179 + #endif
180 +
181   /* Time data type for Time Manager emulation */
182   #ifdef HAVE_CLOCK_GETTIME
183   typedef struct timespec tm_time_t;
184 + #elif defined(__MACH__)
185 + typedef mach_timespec_t tm_time_t;
186   #else
187   typedef struct timeval tm_time_t;
188   #endif
189  
190 < /* Offset Mac->Unix time in seconds */
191 < #define TIME_OFFSET 0x7c25b080
190 > /* Define codes for all the float formats that we know of.
191 > * Though we only handle IEEE format.  */
192 > #define UNKNOWN_FLOAT_FORMAT 0
193 > #define IEEE_FLOAT_FORMAT 1
194 > #define VAX_FLOAT_FORMAT 2
195 > #define IBM_FLOAT_FORMAT 3
196 > #define C4X_FLOAT_FORMAT 4
197  
198   /* UAE CPU data types */
199   #define uae_s8 int8
# Line 168 | Line 207 | typedef struct timeval tm_time_t;
207   typedef uae_u32 uaecptr;
208  
209   /* Alignment restrictions */
210 < #if defined(__i386__) || defined(__powerpc__) || defined(__m68k__)
210 > #if defined(__i386__) || defined(__powerpc__) || defined(__m68k__) || defined(__x86_64__)
211   # define CPU_CAN_ACCESS_UNALIGNED
212   #endif
213  
# Line 176 | Line 215 | typedef uae_u32 uaecptr;
215   extern uint64 GetTicks_usec(void);
216   extern void Delay_usec(uint32 usec);
217  
218 + #ifdef HAVE_PTHREADS
219 + /* Centralized pthread attribute setup */
220 + void Set_pthread_attr(pthread_attr_t *attr, int priority);
221 + #endif
222 +
223   /* UAE CPU defines */
224   #ifdef WORDS_BIGENDIAN
225  
# Line 216 | Line 260 | static inline void do_put_mem_word(uae_u
260  
261   #else /* WORDS_BIGENDIAN */
262  
263 < #ifdef __i386__
263 > #if defined(__i386__) || defined(__x86_64__)
264  
265   /* Intel x86 */
266   #define X86_PPRO_OPT
# Line 286 | Line 330 | static inline uae_u32 do_byteswap_16(uae
330   #define ENUMDECL typedef enum
331   #define ENUMNAME(name) name
332   #define write_log printf
289 #undef USE_MAPPED_MEMORY
290 #undef CAN_MAP_MEMORY
333  
334 < #ifdef X86_ASSEMBLY
334 > #if defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY)
335   #define ASM_SYM_FOR_FUNC(a) __asm__(a)
336   #else
337   #define ASM_SYM_FOR_FUNC(a)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines