xref: /openbmc/qemu/include/hw/core/sysemu-cpu-ops.h (revision 715e3c1afb0022fb2e0f60a198ed2c740e3c48f4)
1 /*
2  * CPU operations specific to system emulation
3  *
4  * Copyright (c) 2012 SUSE LINUX Products GmbH
5  *
6  * This work is licensed under the terms of the GNU GPL, version 2 or later.
7  * See the COPYING file in the top-level directory.
8  */
9 
10 #ifndef SYSEMU_CPU_OPS_H
11 #define SYSEMU_CPU_OPS_H
12 
13 #include "hw/core/cpu.h"
14 
15 /*
16  * struct SysemuCPUOps: System operations specific to a CPU class
17  */
18 typedef struct SysemuCPUOps {
19     /**
20      * @get_crash_info: Callback for reporting guest crash information in
21      * GUEST_PANICKED events.
22      */
23     GuestPanicInformation* (*get_crash_info)(CPUState *cpu);
24     /**
25      * @write_elf32_note: Callback for writing a CPU-specific ELF note to a
26      * 32-bit VM coredump.
27      */
28     int (*write_elf32_note)(WriteCoreDumpFunction f, CPUState *cpu,
29                             int cpuid, void *opaque);
30     /**
31      * @write_elf64_note: Callback for writing a CPU-specific ELF note to a
32      * 64-bit VM coredump.
33      */
34     int (*write_elf64_note)(WriteCoreDumpFunction f, CPUState *cpu,
35                             int cpuid, void *opaque);
36     /**
37      * @write_elf32_qemunote: Callback for writing a CPU- and QEMU-specific ELF
38      * note to a 32-bit VM coredump.
39      */
40     int (*write_elf32_qemunote)(WriteCoreDumpFunction f, CPUState *cpu,
41                                 void *opaque);
42     /**
43      * @write_elf64_qemunote: Callback for writing a CPU- and QEMU-specific ELF
44      * note to a 64-bit VM coredump.
45      */
46     int (*write_elf64_qemunote)(WriteCoreDumpFunction f, CPUState *cpu,
47                                 void *opaque);
48     /**
49      * @virtio_is_big_endian: Callback to return %true if a CPU which supports
50      * runtime configurable endianness is currently big-endian.
51      * Non-configurable CPUs can use the default implementation of this method.
52      * This method should not be used by any callers other than the pre-1.0
53      * virtio devices.
54      */
55     bool (*virtio_is_big_endian)(CPUState *cpu);
56 
57     /**
58      * @legacy_vmsd: Legacy state for migration.
59      *               Do not use in new targets, use #DeviceClass::vmsd instead.
60      */
61     const VMStateDescription *legacy_vmsd;
62 
63 } SysemuCPUOps;
64 
65 #endif /* SYSEMU_CPU_OPS_H */
66