aboutsummaryrefslogtreecommitdiff
path: root/target-i386/arch_memory_mapping.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-05-28 13:52:01 +0200
committerAndreas Färber <afaerber@suse.de>2013-06-11 18:03:35 +0200
commita23bbfda75118eb738acce84afd64965934828f0 (patch)
tree657bf51b76711385cea7df8464d32bf7bd620f84 /target-i386/arch_memory_mapping.c
parent6d4d3ae77dbb756d454c2deb2ef844b0cc7bde7b (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 'target-i386/arch_memory_mapping.c')
-rw-r--r--target-i386/arch_memory_mapping.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/target-i386/arch_memory_mapping.c b/target-i386/arch_memory_mapping.c
index c5a10ec9bd..2566a040a6 100644
--- a/target-i386/arch_memory_mapping.c
+++ b/target-i386/arch_memory_mapping.c
@@ -239,11 +239,15 @@ static void walk_pml4e(MemoryMappingList *list,
}
#endif
-int cpu_get_memory_mapping(MemoryMappingList *list, CPUArchState *env)
+void x86_cpu_get_memory_mapping(CPUState *cs, MemoryMappingList *list,
+ Error **errp)
{
- if (!cpu_paging_enabled(ENV_GET_CPU(env))) {
+ X86CPU *cpu = X86_CPU(cs);
+ CPUX86State *env = &cpu->env;
+
+ if (!cpu_paging_enabled(cs)) {
/* paging is disabled */
- return 0;
+ return;
}
if (env->cr[4] & CR4_PAE_MASK) {
@@ -269,7 +273,5 @@ int cpu_get_memory_mapping(MemoryMappingList *list, CPUArchState *env)
pse = !!(env->cr[4] & CR4_PSE_MASK);
walk_pde2(list, pde_addr, env->a20_mask, pse);
}
-
- return 0;
}