Introduce apic-msidef.h
[qemu.git] / include / qemu / cpu.h
blob78b65b35fccda296e5d894733a22ad09c5ed161a
1 /*
2 * QEMU CPU model
4 * Copyright (c) 2012 SUSE LINUX Products GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see
18 * <http://www.gnu.org/licenses/gpl-2.0.html>
20 #ifndef QEMU_CPU_H
21 #define QEMU_CPU_H
23 #include "qemu/object.h"
25 /**
26 * SECTION:cpu
27 * @section_id: QEMU-cpu
28 * @title: CPU Class
29 * @short_description: Base class for all CPUs
32 #define TYPE_CPU "cpu"
34 #define CPU(obj) OBJECT_CHECK(CPUState, (obj), TYPE_CPU)
35 #define CPU_CLASS(class) OBJECT_CLASS_CHECK(CPUClass, (class), TYPE_CPU)
36 #define CPU_GET_CLASS(obj) OBJECT_GET_CLASS(CPUClass, (obj), TYPE_CPU)
38 typedef struct CPUState CPUState;
40 /**
41 * CPUClass:
42 * @reset: Callback to reset the #CPUState to its initial state.
44 * Represents a CPU family or model.
46 typedef struct CPUClass {
47 /*< private >*/
48 ObjectClass parent_class;
49 /*< public >*/
51 void (*reset)(CPUState *cpu);
52 } CPUClass;
54 /**
55 * CPUState:
57 * State of one CPU core or thread.
59 struct CPUState {
60 /*< private >*/
61 Object parent_obj;
62 /*< public >*/
64 /* TODO Move common fields from CPUArchState here. */
68 /**
69 * cpu_reset:
70 * @cpu: The CPU whose state is to be reset.
72 void cpu_reset(CPUState *cpu);
75 #endif