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>
23 #include "qemu/object.h"
27 * @section_id: QEMU-cpu
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
;
42 * @reset: Callback to reset the #CPUState to its initial state.
44 * Represents a CPU family or model.
46 typedef struct CPUClass
{
48 ObjectClass parent_class
;
51 void (*reset
)(CPUState
*cpu
);
57 * State of one CPU core or thread.
64 /* TODO Move common fields from CPUArchState here. */
70 * @cpu: The CPU whose state is to be reset.
72 void cpu_reset(CPUState
*cpu
);