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.27 by gbeauche, 2004-05-12T11:38:16Z vs.
Revision 1.32 by gbeauche, 2004-06-02T16:11:49Z

# Line 72 | Line 72
72   #define POWERPC_ROM 1
73  
74   #if EMULATED_PPC
75 // Handle interrupts asynchronously?
76 #define ASYNC_IRQ 0
75   // Mac ROM is write protected when banked memory is used
76   #if REAL_ADDRESSING || DIRECT_ADDRESSING
77   # define ROM_IS_WRITE_PROTECTED 0
# Line 82 | Line 80
80   # define ROM_IS_WRITE_PROTECTED 1
81   #endif
82   // Configure PowerPC emulator
83 < #define PPC_CHECK_INTERRUPTS (ASYNC_IRQ ? 0 : 1)
83 > #define PPC_REENTRANT_JIT 1
84 > #define PPC_CHECK_INTERRUPTS 1
85   #define PPC_DECODE_CACHE 1
86   #define PPC_FLIGHT_RECORDER 1
87   #define PPC_PROFILE_COMPILE_TIME 0
88   #define PPC_PROFILE_GENERIC_CALLS 0
89   #define KPX_MAX_CPUS 1
90 + #if defined(__i386__)
91 + #define DYNGEN_ASM_OPTS 1
92 + #endif
93   #else
94   // Mac ROM is write protected
95   #define ROM_IS_WRITE_PROTECTED 1
# Line 247 | Line 249 | static inline int testandset(volatile in
249   }
250   #endif
251  
252 < #ifdef __i386__
252 > /* FIXME: SheepShaver occasionnally hangs with those locks */
253 > #if 0 && (defined(__i386__) || defined(__x86_64__))
254   #define HAVE_TEST_AND_SET 1
255   static inline int testandset(volatile int *p)
256   {
257 <        int ret;
255 <        long int readval;
257 >        long int ret;
258          /* Note: the "xchg" instruction does not need a "lock" prefix */
259 <        __asm__ __volatile__("xchgl %0, %1"
260 <                                                 : "=r" (ret), "=m" (*p), "=a" (readval)
259 >        __asm__ __volatile__("xchgl %k0, %1"
260 >                                                 : "=r" (ret), "=m" (*p)
261                                                   : "0" (1), "m" (*p)
262                                                   : "memory");
263          return ret;
# Line 327 | Line 329 | static inline int testandset(volatile in
329  
330   #endif /* __GNUC__ */
331  
330 #if HAVE_TEST_AND_SET
331 #define HAVE_SPINLOCKS 1
332   typedef volatile int spinlock_t;
333  
334   static const spinlock_t SPIN_LOCK_UNLOCKED = 0;
335  
336 + #if HAVE_TEST_AND_SET
337 + #define HAVE_SPINLOCKS 1
338   static inline void spin_lock(spinlock_t *lock)
339   {
340          while (testandset(lock));
# Line 347 | Line 349 | static inline int spin_trylock(spinlock_
349   {
350          return !testandset(lock);
351   }
352 + #else
353 + static inline void spin_lock(spinlock_t *lock)
354 + {
355 + }
356 +
357 + static inline void spin_unlock(spinlock_t *lock)
358 + {
359 + }
360 +
361 + static inline int spin_trylock(spinlock_t *lock)
362 + {
363 +        return 1;
364 + }
365   #endif
366  
367   // Time data type for Time Manager emulation

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines