root / target-sparc / cpu.h @ 6c9bf893
History | View | Annotate | Download (1.6 kB)
1 | 7a3f1944 | bellard | #ifndef CPU_SPARC_H
|
---|---|---|---|
2 | 7a3f1944 | bellard | #define CPU_SPARC_H
|
3 | 7a3f1944 | bellard | |
4 | 7a3f1944 | bellard | #include <setjmp.h> |
5 | 7a3f1944 | bellard | #include "config.h" |
6 | 7a3f1944 | bellard | #include "cpu-defs.h" |
7 | 7a3f1944 | bellard | |
8 | 7a3f1944 | bellard | /*#define EXCP_INTERRUPT 0x100*/
|
9 | 7a3f1944 | bellard | |
10 | cf495bcf | bellard | /* trap definitions */
|
11 | cf495bcf | bellard | #define TT_ILL_INSN 0x02 |
12 | cf495bcf | bellard | #define TT_WIN_OVF 0x05 |
13 | cf495bcf | bellard | #define TT_WIN_UNF 0x06 |
14 | cf495bcf | bellard | #define TT_DIV_ZERO 0x2a |
15 | cf495bcf | bellard | #define TT_TRAP 0x80 |
16 | 7a3f1944 | bellard | |
17 | 7a3f1944 | bellard | #define PSR_NEG (1<<23) |
18 | 7a3f1944 | bellard | #define PSR_ZERO (1<<22) |
19 | 7a3f1944 | bellard | #define PSR_OVF (1<<21) |
20 | 7a3f1944 | bellard | #define PSR_CARRY (1<<20) |
21 | 7a3f1944 | bellard | |
22 | cf495bcf | bellard | #define NWINDOWS 32 |
23 | cf495bcf | bellard | |
24 | 7a3f1944 | bellard | typedef struct CPUSPARCState { |
25 | cf495bcf | bellard | uint32_t gregs[8]; /* general registers */ |
26 | cf495bcf | bellard | uint32_t *regwptr; /* pointer to current register window */
|
27 | cf495bcf | bellard | double *regfptr; /* floating point registers */ |
28 | cf495bcf | bellard | uint32_t pc; /* program counter */
|
29 | cf495bcf | bellard | uint32_t npc; /* next program counter */
|
30 | cf495bcf | bellard | uint32_t sp; /* stack pointer */
|
31 | cf495bcf | bellard | uint32_t y; /* multiply/divide register */
|
32 | cf495bcf | bellard | uint32_t psr; /* processor state register */
|
33 | cf495bcf | bellard | uint32_t T2; |
34 | cf495bcf | bellard | uint32_t cwp; /* index of current register window (extracted
|
35 | cf495bcf | bellard | from PSR) */
|
36 | cf495bcf | bellard | uint32_t wim; /* window invalid mask */
|
37 | cf495bcf | bellard | jmp_buf jmp_env; |
38 | cf495bcf | bellard | int user_mode_only;
|
39 | cf495bcf | bellard | int exception_index;
|
40 | cf495bcf | bellard | int interrupt_index;
|
41 | cf495bcf | bellard | int interrupt_request;
|
42 | cf495bcf | bellard | struct TranslationBlock *current_tb;
|
43 | cf495bcf | bellard | void *opaque;
|
44 | cf495bcf | bellard | /* NOTE: we allow 8 more registers to handle wrapping */
|
45 | cf495bcf | bellard | uint32_t regbase[NWINDOWS * 16 + 8]; |
46 | 7a3f1944 | bellard | } CPUSPARCState; |
47 | 7a3f1944 | bellard | |
48 | 7a3f1944 | bellard | CPUSPARCState *cpu_sparc_init(void);
|
49 | 7a3f1944 | bellard | int cpu_sparc_exec(CPUSPARCState *s);
|
50 | 7a3f1944 | bellard | int cpu_sparc_close(CPUSPARCState *s);
|
51 | 7a3f1944 | bellard | |
52 | 7a3f1944 | bellard | struct siginfo;
|
53 | 7a3f1944 | bellard | int cpu_sparc_signal_handler(int hostsignum, struct siginfo *info, void *puc); |
54 | 7a3f1944 | bellard | void cpu_sparc_dump_state(CPUSPARCState *env, FILE *f, int flags); |
55 | 7a3f1944 | bellard | |
56 | 7a3f1944 | bellard | #define TARGET_PAGE_BITS 13 |
57 | 7a3f1944 | bellard | #include "cpu-all.h" |
58 | 7a3f1944 | bellard | |
59 | 7a3f1944 | bellard | #endif |