1fcf5ef2aSThomas Huth /* 237b9414bSPhilippe Mathieu-Daudé * QEMU PowerPC CPU QOM header (target agnostic) 3fcf5ef2aSThomas Huth * 4fcf5ef2aSThomas Huth * Copyright (c) 2012 SUSE LINUX Products GmbH 5fcf5ef2aSThomas Huth * 6fcf5ef2aSThomas Huth * This library is free software; you can redistribute it and/or 7fcf5ef2aSThomas Huth * modify it under the terms of the GNU Lesser General Public 8fcf5ef2aSThomas Huth * License as published by the Free Software Foundation; either 9fcf5ef2aSThomas Huth * version 2.1 of the License, or (at your option) any later version. 10fcf5ef2aSThomas Huth * 11fcf5ef2aSThomas Huth * This library is distributed in the hope that it will be useful, 12fcf5ef2aSThomas Huth * but WITHOUT ANY WARRANTY; without even the implied warranty of 13fcf5ef2aSThomas Huth * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14fcf5ef2aSThomas Huth * Lesser General Public License for more details. 15fcf5ef2aSThomas Huth * 16fcf5ef2aSThomas Huth * You should have received a copy of the GNU Lesser General Public 17fcf5ef2aSThomas Huth * License along with this library; if not, see 18fcf5ef2aSThomas Huth * <http://www.gnu.org/licenses/lgpl-2.1.html> 19fcf5ef2aSThomas Huth */ 20fcf5ef2aSThomas Huth #ifndef QEMU_PPC_CPU_QOM_H 21fcf5ef2aSThomas Huth #define QEMU_PPC_CPU_QOM_H 22fcf5ef2aSThomas Huth 23*1b53948fSAkihiko Odaki #include "exec/gdbstub.h" 242e5b09fdSMarkus Armbruster #include "hw/core/cpu.h" 25fcf5ef2aSThomas Huth 26fcf5ef2aSThomas Huth #ifdef TARGET_PPC64 27fcf5ef2aSThomas Huth #define TYPE_POWERPC_CPU "powerpc64-cpu" 28fcf5ef2aSThomas Huth #else 29fcf5ef2aSThomas Huth #define TYPE_POWERPC_CPU "powerpc-cpu" 30fcf5ef2aSThomas Huth #endif 31fcf5ef2aSThomas Huth 329295b1aaSPhilippe Mathieu-Daudé OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU) 33fcf5ef2aSThomas Huth 3466453c0fSPhilippe Mathieu-Daudé #define POWERPC_CPU_TYPE_SUFFIX "-" TYPE_POWERPC_CPU 3566453c0fSPhilippe Mathieu-Daudé #define POWERPC_CPU_TYPE_NAME(model) model POWERPC_CPU_TYPE_SUFFIX 3666453c0fSPhilippe Mathieu-Daudé 37be67dd4aSPhilippe Mathieu-Daudé #define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host") 38be67dd4aSPhilippe Mathieu-Daudé 39fcf5ef2aSThomas Huth #ifndef CONFIG_USER_ONLY 40fcf5ef2aSThomas Huth typedef struct PPCTimebase { 41fcf5ef2aSThomas Huth uint64_t guest_timebase; 42fcf5ef2aSThomas Huth int64_t time_of_the_day_ns; 43d14f3397SMaxiwell S. Garcia bool runstate_paused; 44fcf5ef2aSThomas Huth } PPCTimebase; 45fcf5ef2aSThomas Huth 468a9358ccSMarkus Armbruster extern const VMStateDescription vmstate_ppc_timebase; 47fcf5ef2aSThomas Huth 48fcf5ef2aSThomas Huth #define VMSTATE_PPC_TIMEBASE_V(_field, _state, _version) { \ 49fcf5ef2aSThomas Huth .name = (stringify(_field)), \ 50fcf5ef2aSThomas Huth .version_id = (_version), \ 51fcf5ef2aSThomas Huth .size = sizeof(PPCTimebase), \ 52fcf5ef2aSThomas Huth .vmsd = &vmstate_ppc_timebase, \ 53fcf5ef2aSThomas Huth .flags = VMS_STRUCT, \ 54fcf5ef2aSThomas Huth .offset = vmstate_offset_value(_state, _field, PPCTimebase), \ 55fcf5ef2aSThomas Huth } 5642043e4fSLaurent Vivier 57538f0497SPhilippe Mathieu-Daudé void cpu_ppc_clock_vm_state_change(void *opaque, bool running, 5842043e4fSLaurent Vivier RunState state); 59fcf5ef2aSThomas Huth #endif 60fcf5ef2aSThomas Huth 61fcf5ef2aSThomas Huth #endif 62