2021-05-17 12:51:31 +02:00
|
|
|
/*
|
|
|
|
* CPU operations specific to system emulation
|
|
|
|
*
|
|
|
|
* Copyright (c) 2012 SUSE LINUX Products GmbH
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SYSEMU_CPU_OPS_H
|
|
|
|
#define SYSEMU_CPU_OPS_H
|
|
|
|
|
|
|
|
#include "hw/core/cpu.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* struct SysemuCPUOps: System operations specific to a CPU class
|
|
|
|
*/
|
|
|
|
typedef struct SysemuCPUOps {
|
2021-05-17 12:51:38 +02:00
|
|
|
/**
|
|
|
|
* @get_memory_mapping: Callback for obtaining the memory mappings.
|
|
|
|
*/
|
|
|
|
void (*get_memory_mapping)(CPUState *cpu, MemoryMappingList *list,
|
|
|
|
Error **errp);
|
2021-05-17 12:51:39 +02:00
|
|
|
/**
|
|
|
|
* @get_paging_enabled: Callback for inquiring whether paging is enabled.
|
|
|
|
*/
|
|
|
|
bool (*get_paging_enabled)(const CPUState *cpu);
|
2021-05-17 12:51:37 +02:00
|
|
|
/**
|
|
|
|
* @get_phys_page_debug: Callback for obtaining a physical address.
|
|
|
|
*/
|
|
|
|
hwaddr (*get_phys_page_debug)(CPUState *cpu, vaddr addr);
|
|
|
|
/**
|
|
|
|
* @get_phys_page_attrs_debug: Callback for obtaining a physical address
|
|
|
|
* and the associated memory transaction attributes to use for the
|
|
|
|
* access.
|
|
|
|
* CPUs which use memory transaction attributes should implement this
|
|
|
|
* instead of get_phys_page_debug.
|
|
|
|
*/
|
|
|
|
hwaddr (*get_phys_page_attrs_debug)(CPUState *cpu, vaddr addr,
|
|
|
|
MemTxAttrs *attrs);
|
2021-05-17 12:51:36 +02:00
|
|
|
/**
|
|
|
|
* @asidx_from_attrs: Callback to return the CPU AddressSpace to use for
|
|
|
|
* a memory access with the specified memory transaction attributes.
|
|
|
|
*/
|
|
|
|
int (*asidx_from_attrs)(CPUState *cpu, MemTxAttrs attrs);
|
2021-05-17 12:51:34 +02:00
|
|
|
/**
|
|
|
|
* @get_crash_info: Callback for reporting guest crash information in
|
|
|
|
* GUEST_PANICKED events.
|
|
|
|
*/
|
|
|
|
GuestPanicInformation* (*get_crash_info)(CPUState *cpu);
|
2021-05-17 12:51:35 +02:00
|
|
|
/**
|
|
|
|
* @write_elf32_note: Callback for writing a CPU-specific ELF note to a
|
|
|
|
* 32-bit VM coredump.
|
|
|
|
*/
|
|
|
|
int (*write_elf32_note)(WriteCoreDumpFunction f, CPUState *cpu,
|
|
|
|
int cpuid, void *opaque);
|
|
|
|
/**
|
|
|
|
* @write_elf64_note: Callback for writing a CPU-specific ELF note to a
|
|
|
|
* 64-bit VM coredump.
|
|
|
|
*/
|
|
|
|
int (*write_elf64_note)(WriteCoreDumpFunction f, CPUState *cpu,
|
|
|
|
int cpuid, void *opaque);
|
|
|
|
/**
|
|
|
|
* @write_elf32_qemunote: Callback for writing a CPU- and QEMU-specific ELF
|
|
|
|
* note to a 32-bit VM coredump.
|
|
|
|
*/
|
|
|
|
int (*write_elf32_qemunote)(WriteCoreDumpFunction f, CPUState *cpu,
|
|
|
|
void *opaque);
|
|
|
|
/**
|
|
|
|
* @write_elf64_qemunote: Callback for writing a CPU- and QEMU-specific ELF
|
|
|
|
* note to a 64-bit VM coredump.
|
|
|
|
*/
|
|
|
|
int (*write_elf64_qemunote)(WriteCoreDumpFunction f, CPUState *cpu,
|
|
|
|
void *opaque);
|
2021-05-17 12:51:33 +02:00
|
|
|
/**
|
|
|
|
* @virtio_is_big_endian: Callback to return %true if a CPU which supports
|
|
|
|
* runtime configurable endianness is currently big-endian.
|
|
|
|
* Non-configurable CPUs can use the default implementation of this method.
|
|
|
|
* This method should not be used by any callers other than the pre-1.0
|
|
|
|
* virtio devices.
|
|
|
|
*/
|
|
|
|
bool (*virtio_is_big_endian)(CPUState *cpu);
|
|
|
|
|
2021-05-17 12:51:32 +02:00
|
|
|
/**
|
|
|
|
* @legacy_vmsd: Legacy state for migration.
|
|
|
|
* Do not use in new targets, use #DeviceClass::vmsd instead.
|
|
|
|
*/
|
|
|
|
const VMStateDescription *legacy_vmsd;
|
|
|
|
|
2021-05-17 12:51:31 +02:00
|
|
|
} SysemuCPUOps;
|
|
|
|
|
|
|
|
#endif /* SYSEMU_CPU_OPS_H */
|