ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/uae_cpu/spcflags.h
Revision: 1.1
Committed: 2002-09-01T15:17:13Z (22 years, 3 months ago) by gbeauche
Content type: text/plain
Branch: MAIN
Log Message:
- Merge with Basilisk II/JIT cpu core, interpretive part for now
- Clean use of USE_PREFETCH_BUFFER macro and dependent bits

File Contents

# User Rev Content
1 gbeauche 1.1 /*
2     * UAE - The Un*x Amiga Emulator
3     *
4     * MC68000 emulation
5     *
6     * Copyright 1995 Bernd Schmidt
7     */
8    
9     #ifndef SPCFLAGS_H
10     #define SPCFLAGS_H
11    
12     typedef uae_u32 spcflags_t;
13    
14     enum {
15     SPCFLAG_STOP = 0x01,
16     SPCFLAG_INT = 0x02,
17     SPCFLAG_BRK = 0x04,
18     SPCFLAG_TRACE = 0x08,
19     SPCFLAG_DOTRACE = 0x10,
20     SPCFLAG_DOINT = 0x20,
21     SPCFLAG_JIT_END_COMPILE = 0,
22     SPCFLAG_JIT_EXEC_RETURN = 0,
23     SPCFLAG_ALL = SPCFLAG_STOP
24     | SPCFLAG_INT
25     | SPCFLAG_BRK
26     | SPCFLAG_TRACE
27     | SPCFLAG_DOTRACE
28     | SPCFLAG_DOINT
29     | SPCFLAG_JIT_END_COMPILE
30     | SPCFLAG_JIT_EXEC_RETURN,
31     SPCFLAG_ALL_BUT_EXEC_RETURN = SPCFLAG_ALL & ~SPCFLAG_JIT_EXEC_RETURN
32     };
33    
34     #define SPCFLAGS_TEST(m) \
35     ((regs.spcflags & (m)) != 0)
36    
37     /* Macro only used in m68k_reset() */
38     #define SPCFLAGS_INIT(m) do { \
39     regs.spcflags = (m); \
40     } while (0)
41    
42     #if !(ENABLE_EXCLUSIVE_SPCFLAGS)
43    
44     #define SPCFLAGS_SET(m) do { \
45     regs.spcflags |= (m); \
46     } while (0)
47    
48     #define SPCFLAGS_CLEAR(m) do { \
49     regs.spcflags &= ~(m); \
50     } while (0)
51    
52     #elif defined(__i386__) && defined(X86_ASSEMBLY)
53    
54     #define HAVE_HARDWARE_LOCKS
55    
56     #define SPCFLAGS_SET(m) do { \
57     __asm__ __volatile__("lock\n\torl %1,%0" : "=m" (regs.spcflags) : "i" ((m))); \
58     } while (0)
59    
60     #define SPCFLAGS_CLEAR(m) do { \
61     __asm__ __volatile__("lock\n\tandl %1,%0" : "=m" (regs.spcflags) : "i" (~(m))); \
62     } while (0)
63    
64     #elif defined(HAVE_PTHREADS)
65    
66     #undef HAVE_HARDWARE_LOCKS
67    
68     #include <pthread.h>
69     extern pthread_mutex_t spcflags_lock;
70    
71     #define SPCFLAGS_SET(m) do { \
72     pthread_mutex_lock(&spcflags_lock); \
73     regs.spcflags |= (m); \
74     pthread_mutex_unlock(&spcflags_lock); \
75     } while (0)
76    
77     #define SPCFLAGS_CLEAR(m) do { \
78     pthread_mutex_lock(&spcflags_lock); \
79     regs.spcflags &= ~(m); \
80     pthread_mutex_unlock(&spcflags_lock); \
81     } while (0)
82    
83     #else
84    
85     #error "Can't handle spcflags atomically!"
86    
87     #endif
88    
89     #endif /* SPCFLAGS_H */