root / target-i386 / cpu-qom.h @ f6049f44
History | View | Annotate | Download (3.5 kB)
1 | 5fd2087a | Andreas Färber | /*
|
---|---|---|---|
2 | 5fd2087a | Andreas Färber | * QEMU x86 CPU
|
3 | 5fd2087a | Andreas Färber | *
|
4 | 5fd2087a | Andreas Färber | * Copyright (c) 2012 SUSE LINUX Products GmbH
|
5 | 5fd2087a | Andreas Färber | *
|
6 | 5fd2087a | Andreas Färber | * This library is free software; you can redistribute it and/or
|
7 | 5fd2087a | Andreas Färber | * modify it under the terms of the GNU Lesser General Public
|
8 | 5fd2087a | Andreas Färber | * License as published by the Free Software Foundation; either
|
9 | 5fd2087a | Andreas Färber | * version 2.1 of the License, or (at your option) any later version.
|
10 | 5fd2087a | Andreas Färber | *
|
11 | 5fd2087a | Andreas Färber | * This library is distributed in the hope that it will be useful,
|
12 | 5fd2087a | Andreas Färber | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | 5fd2087a | Andreas Färber | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 | 5fd2087a | Andreas Färber | * Lesser General Public License for more details.
|
15 | 5fd2087a | Andreas Färber | *
|
16 | 5fd2087a | Andreas Färber | * You should have received a copy of the GNU Lesser General Public
|
17 | 5fd2087a | Andreas Färber | * License along with this library; if not, see
|
18 | 5fd2087a | Andreas Färber | * <http://www.gnu.org/licenses/lgpl-2.1.html>
|
19 | 5fd2087a | Andreas Färber | */
|
20 | 5fd2087a | Andreas Färber | #ifndef QEMU_I386_CPU_QOM_H
|
21 | 5fd2087a | Andreas Färber | #define QEMU_I386_CPU_QOM_H
|
22 | 5fd2087a | Andreas Färber | |
23 | 14cccb61 | Paolo Bonzini | #include "qom/cpu.h" |
24 | 5fd2087a | Andreas Färber | #include "cpu.h" |
25 | 7b1b5d19 | Paolo Bonzini | #include "qapi/error.h" |
26 | 5fd2087a | Andreas Färber | |
27 | 5fd2087a | Andreas Färber | #ifdef TARGET_X86_64
|
28 | 5fd2087a | Andreas Färber | #define TYPE_X86_CPU "x86_64-cpu" |
29 | 5fd2087a | Andreas Färber | #else
|
30 | 5fd2087a | Andreas Färber | #define TYPE_X86_CPU "i386-cpu" |
31 | 5fd2087a | Andreas Färber | #endif
|
32 | 5fd2087a | Andreas Färber | |
33 | 5fd2087a | Andreas Färber | #define X86_CPU_CLASS(klass) \
|
34 | 5fd2087a | Andreas Färber | OBJECT_CLASS_CHECK(X86CPUClass, (klass), TYPE_X86_CPU) |
35 | 5fd2087a | Andreas Färber | #define X86_CPU(obj) \
|
36 | 5fd2087a | Andreas Färber | OBJECT_CHECK(X86CPU, (obj), TYPE_X86_CPU) |
37 | 5fd2087a | Andreas Färber | #define X86_CPU_GET_CLASS(obj) \
|
38 | 5fd2087a | Andreas Färber | OBJECT_GET_CLASS(X86CPUClass, (obj), TYPE_X86_CPU) |
39 | 5fd2087a | Andreas Färber | |
40 | 5fd2087a | Andreas Färber | /**
|
41 | 5fd2087a | Andreas Färber | * X86CPUClass:
|
42 | 2b6f294c | Andreas Färber | * @parent_realize: The parent class' realize handler.
|
43 | 5fd2087a | Andreas Färber | * @parent_reset: The parent class' reset handler.
|
44 | 5fd2087a | Andreas Färber | *
|
45 | 5fd2087a | Andreas Färber | * An x86 CPU model or family.
|
46 | 5fd2087a | Andreas Färber | */
|
47 | 5fd2087a | Andreas Färber | typedef struct X86CPUClass { |
48 | 5fd2087a | Andreas Färber | /*< private >*/
|
49 | 5fd2087a | Andreas Färber | CPUClass parent_class; |
50 | 5fd2087a | Andreas Färber | /*< public >*/
|
51 | 5fd2087a | Andreas Färber | |
52 | 2b6f294c | Andreas Färber | DeviceRealize parent_realize; |
53 | 5fd2087a | Andreas Färber | void (*parent_reset)(CPUState *cpu);
|
54 | 5fd2087a | Andreas Färber | } X86CPUClass; |
55 | 5fd2087a | Andreas Färber | |
56 | 5fd2087a | Andreas Färber | /**
|
57 | 5fd2087a | Andreas Färber | * X86CPU:
|
58 | 5fd2087a | Andreas Färber | * @env: #CPUX86State
|
59 | 5fd2087a | Andreas Färber | *
|
60 | 5fd2087a | Andreas Färber | * An x86 CPU.
|
61 | 5fd2087a | Andreas Färber | */
|
62 | 5fd2087a | Andreas Färber | typedef struct X86CPU { |
63 | 5fd2087a | Andreas Färber | /*< private >*/
|
64 | 5fd2087a | Andreas Färber | CPUState parent_obj; |
65 | 5fd2087a | Andreas Färber | /*< public >*/
|
66 | 5fd2087a | Andreas Färber | |
67 | 5fd2087a | Andreas Färber | CPUX86State env; |
68 | 034acf4a | Eduardo Habkost | |
69 | 034acf4a | Eduardo Habkost | /* Features that were filtered out because of missing host capabilities */
|
70 | 034acf4a | Eduardo Habkost | uint32_t filtered_features[FEATURE_WORDS]; |
71 | 9337e3b6 | Eduardo Habkost | |
72 | 9337e3b6 | Eduardo Habkost | /* Enable PMU CPUID bits. This can't be enabled by default yet because
|
73 | 9337e3b6 | Eduardo Habkost | * it doesn't have ABI stability guarantees, as it passes all PMU CPUID
|
74 | 9337e3b6 | Eduardo Habkost | * bits returned by GET_SUPPORTED_CPUID (that depend on host CPU and kernel
|
75 | 9337e3b6 | Eduardo Habkost | * capabilities) directly to the guest.
|
76 | 9337e3b6 | Eduardo Habkost | */
|
77 | 9337e3b6 | Eduardo Habkost | bool enable_pmu;
|
78 | 5fd2087a | Andreas Färber | } X86CPU; |
79 | 5fd2087a | Andreas Färber | |
80 | 5fd2087a | Andreas Färber | static inline X86CPU *x86_env_get_cpu(CPUX86State *env) |
81 | 5fd2087a | Andreas Färber | { |
82 | 6e42be7c | Andreas Färber | return container_of(env, X86CPU, env);
|
83 | 5fd2087a | Andreas Färber | } |
84 | 5fd2087a | Andreas Färber | |
85 | 5fd2087a | Andreas Färber | #define ENV_GET_CPU(e) CPU(x86_env_get_cpu(e))
|
86 | 5fd2087a | Andreas Färber | |
87 | fadf9825 | Andreas Färber | #define ENV_OFFSET offsetof(X86CPU, env)
|
88 | 5fd2087a | Andreas Färber | |
89 | f56e3a14 | Andreas Färber | #ifndef CONFIG_USER_ONLY
|
90 | f56e3a14 | Andreas Färber | extern const struct VMStateDescription vmstate_x86_cpu; |
91 | f56e3a14 | Andreas Färber | #endif
|
92 | f56e3a14 | Andreas Färber | |
93 | 97a8ea5a | Andreas Färber | /**
|
94 | 97a8ea5a | Andreas Färber | * x86_cpu_do_interrupt:
|
95 | 97a8ea5a | Andreas Färber | * @cpu: vCPU the interrupt is to be handled by.
|
96 | 97a8ea5a | Andreas Färber | */
|
97 | 97a8ea5a | Andreas Färber | void x86_cpu_do_interrupt(CPUState *cpu);
|
98 | 97a8ea5a | Andreas Färber | |
99 | c72bf468 | Jens Freimann | int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
|
100 | c72bf468 | Jens Freimann | int cpuid, void *opaque); |
101 | c72bf468 | Jens Freimann | int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu,
|
102 | c72bf468 | Jens Freimann | int cpuid, void *opaque); |
103 | c72bf468 | Jens Freimann | int x86_cpu_write_elf64_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
|
104 | c72bf468 | Jens Freimann | void *opaque);
|
105 | c72bf468 | Jens Freimann | int x86_cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
|
106 | c72bf468 | Jens Freimann | void *opaque);
|
107 | c72bf468 | Jens Freimann | |
108 | a23bbfda | Andreas Färber | void x86_cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list,
|
109 | a23bbfda | Andreas Färber | Error **errp); |
110 | a23bbfda | Andreas Färber | |
111 | 878096ee | Andreas Färber | void x86_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
|
112 | 878096ee | Andreas Färber | int flags);
|
113 | 878096ee | Andreas Färber | |
114 | 00b941e5 | Andreas Färber | hwaddr x86_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); |
115 | 00b941e5 | Andreas Färber | |
116 | 5b50e790 | Andreas Färber | int x86_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg); |
117 | 5b50e790 | Andreas Färber | int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); |
118 | 5b50e790 | Andreas Färber | |
119 | 5fd2087a | Andreas Färber | #endif |