diff options
author | Andreas Färber <afaerber@suse.de> | 2013-05-28 13:52:01 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-06-11 18:03:35 +0200 |
commit | a23bbfda75118eb738acce84afd64965934828f0 (patch) | |
tree | 657bf51b76711385cea7df8464d32bf7bd620f84 /include | |
parent | 6d4d3ae77dbb756d454c2deb2ef844b0cc7bde7b (diff) |
cpu: Turn cpu_get_memory_mapping() into a CPUState hook
Change error reporting from return value to Error argument.
Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
[AF: Fixed cpu_get_memory_mapping() documentation]
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/qom/cpu.h | 13 | ||||
-rw-r--r-- | include/sysemu/memory_mapping.h | 2 |
2 files changed, 13 insertions, 2 deletions
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 <signal.h> #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, @@ -148,6 +152,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 * @cpu: The CPU whose memory is to be dumped diff --git a/include/sysemu/memory_mapping.h b/include/sysemu/memory_mapping.h index 1f71c327b1..c47e6ee1fd 100644 --- a/include/sysemu/memory_mapping.h +++ b/include/sysemu/memory_mapping.h @@ -31,8 +31,6 @@ struct MemoryMappingList { QTAILQ_HEAD(, MemoryMapping) head; }; -int cpu_get_memory_mapping(MemoryMappingList *list, CPUArchState *env); - /* * add or merge the memory region [phys_addr, phys_addr + length) into the * memory mapping's list. The region's virtual address starts with virt_addr, |