1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#ifndef QEMU_SPARC_CPU_QOM_H
21#define QEMU_SPARC_CPU_QOM_H
22
23#include "qom/cpu.h"
24#include "cpu.h"
25
26#ifdef TARGET_SPARC64
27#define TYPE_SPARC_CPU "sparc64-cpu"
28#else
29#define TYPE_SPARC_CPU "sparc-cpu"
30#endif
31
32#define SPARC_CPU_CLASS(klass) \
33 OBJECT_CLASS_CHECK(SPARCCPUClass, (klass), TYPE_SPARC_CPU)
34#define SPARC_CPU(obj) \
35 OBJECT_CHECK(SPARCCPU, (obj), TYPE_SPARC_CPU)
36#define SPARC_CPU_GET_CLASS(obj) \
37 OBJECT_GET_CLASS(SPARCCPUClass, (obj), TYPE_SPARC_CPU)
38
39
40
41
42
43
44
45
46typedef struct SPARCCPUClass {
47
48 CPUClass parent_class;
49
50
51 DeviceRealize parent_realize;
52 void (*parent_reset)(CPUState *cpu);
53} SPARCCPUClass;
54
55
56
57
58
59
60
61typedef struct SPARCCPU {
62
63 CPUState parent_obj;
64
65
66 CPUSPARCState env;
67} SPARCCPU;
68
69static inline SPARCCPU *sparc_env_get_cpu(CPUSPARCState *env)
70{
71 return container_of(env, SPARCCPU, env);
72}
73
74#define ENV_GET_CPU(e) CPU(sparc_env_get_cpu(e))
75
76#define ENV_OFFSET offsetof(SPARCCPU, env)
77
78void sparc_cpu_do_interrupt(CPUState *cpu);
79void sparc_cpu_dump_state(CPUState *cpu, FILE *f,
80 fprintf_function cpu_fprintf, int flags);
81hwaddr sparc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
82int sparc_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
83int sparc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
84void QEMU_NORETURN sparc_cpu_do_unaligned_access(CPUState *cpu,
85 vaddr addr, int is_write,
86 int is_user, uintptr_t retaddr);
87
88#endif
89