ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/kpx_cpu/spcflags.h
Revision: 1.1
Committed: 2003-09-28T21:27:34Z (20 years, 11 months ago) by gbeauche
Content type: text/plain
Branch: MAIN
Log Message:
Try to handle XLM_IRQ_NEST atomically in emulated PPC views. Fix placement
of fake SCSIGlobals (disabled for now). Switch back to mono core emulation
until things are debugged enough. Implement get_resource() et al.

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 uint32 spcflags_t;
13    
14     enum {
15     SPCFLAG_STOP = 0x01,
16     SPCFLAG_INT = 0x02,
17     SPCFLAG_DOINT = 0x04,
18     SPCFLAG_ENTER_MON = 0x08,
19     #if USE_JIT
20     SPCFLAG_JIT_END_COMPILE = 0x40,
21     SPCFLAG_JIT_EXEC_RETURN = 0x80,
22     #else
23     SPCFLAG_JIT_END_COMPILE = 0,
24     SPCFLAG_JIT_EXEC_RETURN = 0,
25     #endif
26    
27     SPCFLAG_ALL = SPCFLAG_STOP
28     | SPCFLAG_INT
29     | SPCFLAG_DOINT
30     | SPCFLAG_ENTER_MON
31     | SPCFLAG_JIT_END_COMPILE
32     | SPCFLAG_JIT_EXEC_RETURN
33     ,
34    
35     SPCFLAG_ALL_BUT_EXEC_RETURN = SPCFLAG_ALL & ~SPCFLAG_JIT_EXEC_RETURN
36     };
37    
38     #define SPCFLAGS_TEST(m) \
39     ((sheepshaver_cpu::spcflags & (m)) != 0)
40    
41     /* Macro only used in m68k_reset() */
42     #define SPCFLAGS_INIT(m) do { \
43     sheepshaver_cpu::spcflags = (m); \
44     } while (0)
45    
46     #if !(ENABLE_EXCLUSIVE_SPCFLAGS)
47    
48     #define SPCFLAGS_SET(m) do { \
49     sheepshaver_cpu::spcflags |= (m); \
50     } while (0)
51    
52     #define SPCFLAGS_CLEAR(m) do { \
53     sheepshaver_cpu::spcflags &= ~(m); \
54     } while (0)
55    
56     #elif defined(__i386__) && defined(X86_ASSEMBLY)
57    
58     #define HAVE_HARDWARE_LOCKS
59    
60     #define SPCFLAGS_SET(m) do { \
61     __asm__ __volatile__("lock\n\torl %1,%0" : "=m" (sheepshaver_cpu::spcflags) : "i" ((m))); \
62     } while (0)
63    
64     #define SPCFLAGS_CLEAR(m) do { \
65     __asm__ __volatile__("lock\n\tandl %1,%0" : "=m" (sheepshaver_cpu::spcflags) : "i" (~(m))); \
66     } while (0)
67    
68     #else
69    
70     #undef HAVE_HARDWARE_LOCKS
71    
72     #include "main.h"
73     extern B2_mutex *spcflags_lock;
74    
75     #define SPCFLAGS_SET(m) do { \
76     B2_lock_mutex(spcflags_lock); \
77     sheepshaver_cpu::spcflags |= (m); \
78     B2_unlock_mutex(spcflags_lock); \
79     } while (0)
80    
81     #define SPCFLAGS_CLEAR(m) do { \
82     B2_lock_mutex(spcflags_lock); \
83     sheepshaver_cpu::spcflags &= ~(m); \
84     B2_unlock_mutex(spcflags_lock); \
85     } while (0)
86    
87     #endif
88    
89     #endif /* SPCFLAGS_H */