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

Comparing SheepShaver/src/Unix/sysdeps.h (file contents):
Revision 1.6 by gbeauche, 2003-09-29T08:27:56Z vs.
Revision 1.15 by gbeauche, 2003-11-24T21:20:47Z

# Line 68 | Line 68
68   #define POWERPC_ROM 1
69  
70   #if EMULATED_PPC
71 + // Handle interrupts asynchronously?
72 + #define ASYNC_IRQ 0
73   // Mac ROM is write protected when banked memory is used
74   #if REAL_ADDRESSING || DIRECT_ADDRESSING
75   # define ROM_IS_WRITE_PROTECTED 0
# Line 75 | Line 77
77   #else
78   # define ROM_IS_WRITE_PROTECTED 1
79   #endif
80 + // Configure PowerPC emulator
81 + #define PPC_CHECK_INTERRUPTS (ASYNC_IRQ ? 0 : 1)
82 + #define PPC_DECODE_CACHE 1
83 + #define PPC_FLIGHT_RECORDER 1
84   #else
85   // Mac ROM is write protected
86   #define ROM_IS_WRITE_PROTECTED 1
# Line 125 | Line 131 | typedef int64 intptr;
131   #error "Unsupported size of pointer"
132   #endif
133  
134 < // Helper functions to byteswap data
134 > /**
135 > *              Helper functions to byteswap data
136 > **/
137 >
138 > #if defined(__GNUC__)
139 > #if defined(__x86_64__)
140 > // Linux/AMD64 currently has no asm optimized bswap_32() in <byteswap.h>
141 > #define opt_bswap_32 do_opt_bswap_32
142 > static inline uint32 do_opt_bswap_32(uint32 x)
143 > {
144 >  uint32 v;
145 >  __asm__ __volatile__ ("bswap %0" : "=r" (v) : "0" (x));
146 >  return v;
147 > }
148 > #endif
149 > #endif
150 >
151   #ifdef HAVE_BYTESWAP_H
152   #include <byteswap.h>
153   #endif
154  
155 + #ifdef  opt_bswap_16
156 + #undef  bswap_16
157 + #define bswap_16 opt_bswap_16
158 + #endif
159   #ifndef bswap_16
160   #define bswap_16 generic_bswap_16
161   #endif
# Line 139 | Line 165 | static inline uint16 generic_bswap_16(ui
165    return ((x & 0xff) << 8) | ((x >> 8) & 0xff);
166   }
167  
168 + #ifdef  opt_bswap_32
169 + #undef  bswap_32
170 + #define bswap_32 opt_bswap_32
171 + #endif
172   #ifndef bswap_32
173   #define bswap_32 generic_bswap_32
174   #endif
# Line 151 | Line 181 | static inline uint32 generic_bswap_32(ui
181                    ((x & 0x000000ff) << 24) );
182   }
183  
184 + #ifdef  opt_bswap_64
185 + #undef  bswap_64
186 + #define bswap_64 opt_bswap_64
187 + #endif
188   #ifndef bswap_64
189   #define bswap_64 generic_bswap_64
190   #endif
# Line 282 | Line 316 | static inline int testandset(int *p)
316   #define HAVE_SPINLOCKS 1
317   typedef int spinlock_t;
318  
319 < const spinlock_t SPIN_LOCK_UNLOCKED = 0;
319 > static const spinlock_t SPIN_LOCK_UNLOCKED = 0;
320  
321   static inline void spin_lock(spinlock_t *lock)
322   {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines