From a23bbfda75118eb738acce84afd64965934828f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 28 May 2013 13:52:01 +0200 Subject: cpu: Turn cpu_get_memory_mapping() into a CPUState hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change error reporting from return value to Error argument. Reviewed-by: Jens Freimann Reviewed-by: Luiz Capitulino [AF: Fixed cpu_get_memory_mapping() documentation] Signed-off-by: Andreas Färber --- include/qom/cpu.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/qom') diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 1f70240991..a5bb515978 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -23,6 +23,7 @@ #include #include "hw/qdev-core.h" #include "qemu/thread.h" +#include "qemu/typedefs.h" typedef int (*WriteCoreDumpFunction)(void *buf, size_t size, void *opaque); @@ -49,6 +50,7 @@ typedef struct CPUState CPUState; * @do_interrupt: Callback for interrupt handling. * @get_arch_id: Callback for getting architecture-dependent CPU ID. * @get_paging_enabled: Callback for inquiring whether paging is enabled. + * @get_memory_mapping: Callback for obtaining the memory mappings. * @vmsd: State description for migration. * * Represents a CPU family or model. @@ -64,6 +66,8 @@ typedef struct CPUClass { void (*do_interrupt)(CPUState *cpu); int64_t (*get_arch_id)(CPUState *cpu); bool (*get_paging_enabled)(const CPUState *cpu); + void (*get_memory_mapping)(CPUState *cpu, MemoryMappingList *list, + Error **errp); const struct VMStateDescription *vmsd; int (*write_elf64_note)(WriteCoreDumpFunction f, CPUState *cpu, @@ -147,6 +151,15 @@ struct CPUState { */ bool cpu_paging_enabled(const CPUState *cpu); +/** + * cpu_get_memory_mapping: + * @cpu: The CPU whose memory mappings are to be obtained. + * @list: Where to write the memory mappings to. + * @errp: Pointer for reporting an #Error. + */ +void cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list, + Error **errp); + /** * cpu_write_elf64_note: * @f: pointer to a function that writes memory to a file -- cgit v1.2.3