2 * QEMU PowerPC CPU QOM header (target agnostic)
4 * Copyright (c) 2012 SUSE LINUX Products GmbH
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see
18 * <http://www.gnu.org/licenses/lgpl-2.1.html>
20 #ifndef QEMU_PPC_CPU_QOM_H
21 #define QEMU_PPC_CPU_QOM_H
23 #include "exec/gdbstub.h"
24 #include "hw/core/cpu.h"
27 #define TYPE_POWERPC_CPU "powerpc64-cpu"
29 #define TYPE_POWERPC_CPU "powerpc-cpu"
32 OBJECT_DECLARE_CPU_TYPE(PowerPCCPU
, PowerPCCPUClass
, POWERPC_CPU
)
34 #define POWERPC_CPU_TYPE_SUFFIX "-" TYPE_POWERPC_CPU
35 #define POWERPC_CPU_TYPE_NAME(model) model POWERPC_CPU_TYPE_SUFFIX
37 #define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host")
39 #ifndef CONFIG_USER_ONLY
40 typedef struct PPCTimebase
{
41 uint64_t guest_timebase
;
42 int64_t time_of_the_day_ns
;
46 extern const VMStateDescription vmstate_ppc_timebase
;
48 #define VMSTATE_PPC_TIMEBASE_V(_field, _state, _version) { \
49 .name = (stringify(_field)), \
50 .version_id = (_version), \
51 .size = sizeof(PPCTimebase), \
52 .vmsd = &vmstate_ppc_timebase, \
53 .flags = VMS_STRUCT, \
54 .offset = vmstate_offset_value(_state, _field, PPCTimebase), \
57 void cpu_ppc_clock_vm_state_change(void *opaque
, bool running
,