root / target-sparc / exec.h @ 543fc7b2
History | View | Annotate | Download (977 Bytes)
1 | 7a3f1944 | bellard | #ifndef EXEC_SPARC_H
|
---|---|---|---|
2 | 7a3f1944 | bellard | #define EXEC_SPARC_H 1 |
3 | 3475187d | bellard | #include "config.h" |
4 | 8294eba1 | ths | #include "dyngen-exec.h" |
5 | 7a3f1944 | bellard | |
6 | 7a3f1944 | bellard | register struct CPUSPARCState *env asm(AREG0); |
7 | 3475187d | bellard | |
8 | e8af50a3 | bellard | #define DT0 (env->dt0)
|
9 | e8af50a3 | bellard | #define DT1 (env->dt1)
|
10 | 1f587329 | blueswir1 | #define QT0 (env->qt0)
|
11 | 1f587329 | blueswir1 | #define QT1 (env->qt1)
|
12 | 7a3f1944 | bellard | |
13 | 7a3f1944 | bellard | #include "cpu.h" |
14 | 7a3f1944 | bellard | #include "exec-all.h" |
15 | 7a3f1944 | bellard | |
16 | 0d1a29f9 | bellard | static inline void env_to_regs(void) |
17 | 0d1a29f9 | bellard | { |
18 | 0d1a29f9 | bellard | } |
19 | 0d1a29f9 | bellard | |
20 | 0d1a29f9 | bellard | static inline void regs_to_env(void) |
21 | 0d1a29f9 | bellard | { |
22 | 0d1a29f9 | bellard | } |
23 | 0d1a29f9 | bellard | |
24 | 91736d37 | blueswir1 | /* op_helper.c */
|
25 | f2bc7e7f | blueswir1 | void do_interrupt(CPUState *env);
|
26 | 9d893301 | bellard | |
27 | 5210977a | Igor Kovalenko | static inline int cpu_interrupts_enabled(CPUState *env1) |
28 | 5210977a | Igor Kovalenko | { |
29 | 5210977a | Igor Kovalenko | #if !defined (TARGET_SPARC64)
|
30 | 5210977a | Igor Kovalenko | if (env1->psret != 0) |
31 | 5210977a | Igor Kovalenko | return 1; |
32 | 5210977a | Igor Kovalenko | #else
|
33 | 5210977a | Igor Kovalenko | if (env1->pstate & PS_IE)
|
34 | 5210977a | Igor Kovalenko | return 1; |
35 | 5210977a | Igor Kovalenko | #endif
|
36 | 5210977a | Igor Kovalenko | |
37 | 5210977a | Igor Kovalenko | return 0; |
38 | 5210977a | Igor Kovalenko | } |
39 | 5210977a | Igor Kovalenko | |
40 | 6a4955a8 | aliguori | static inline int cpu_has_work(CPUState *env1) |
41 | 6a4955a8 | aliguori | { |
42 | 6a4955a8 | aliguori | return (env1->interrupt_request & CPU_INTERRUPT_HARD) &&
|
43 | 5210977a | Igor Kovalenko | cpu_interrupts_enabled(env1); |
44 | 6a4955a8 | aliguori | } |
45 | 6a4955a8 | aliguori | |
46 | 6a4955a8 | aliguori | |
47 | 22548760 | blueswir1 | static inline int cpu_halted(CPUState *env1) { |
48 | 22548760 | blueswir1 | if (!env1->halted)
|
49 | bfed01fc | ths | return 0; |
50 | 6a4955a8 | aliguori | if (cpu_has_work(env1)) {
|
51 | 22548760 | blueswir1 | env1->halted = 0;
|
52 | bfed01fc | ths | return 0; |
53 | bfed01fc | ths | } |
54 | bfed01fc | ths | return EXCP_HALTED;
|
55 | bfed01fc | ths | } |
56 | bfed01fc | ths | |
57 | 7a3f1944 | bellard | #endif |