aboutsummaryrefslogtreecommitdiff
path: root/qom/cpu.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-05-28 13:28:38 +0200
committerAndreas Färber <afaerber@suse.de>2013-06-11 17:50:09 +0200
commit444d55907871f88276a654fc7fdc8c7db95f4b59 (patch)
tree10dde797d560c58dbd9a70405c0b38891fef5fc1 /qom/cpu.c
parentc51a944b7505ba827adc897d5452d2b54dbf86bb (diff)
cpu: Turn cpu_paging_enabled() into a CPUState hook
Relocate assignment of x86 get_arch_id to have all hooks in one place. Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'qom/cpu.c')
-rw-r--r--qom/cpu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/qom/cpu.c b/qom/cpu.c
index 04aefbb956..9f6da0fdd8 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -50,6 +50,18 @@ bool cpu_exists(int64_t id)
return data.found;
}
+bool cpu_paging_enabled(const CPUState *cpu)
+{
+ CPUClass *cc = CPU_GET_CLASS(cpu);
+
+ return cc->get_paging_enabled(cpu);
+}
+
+static bool cpu_common_get_paging_enabled(const CPUState *cpu)
+{
+ return true;
+}
+
/* CPU hot-plug notifiers */
static NotifierList cpu_added_notifiers =
NOTIFIER_LIST_INITIALIZER(cpu_add_notifiers);
@@ -176,6 +188,7 @@ static void cpu_class_init(ObjectClass *klass, void *data)
k->class_by_name = cpu_common_class_by_name;
k->reset = cpu_common_reset;
k->get_arch_id = cpu_common_get_arch_id;
+ k->get_paging_enabled = cpu_common_get_paging_enabled;
k->write_elf32_qemunote = cpu_common_write_elf32_qemunote;
k->write_elf32_note = cpu_common_write_elf32_note;
k->write_elf64_qemunote = cpu_common_write_elf64_qemunote;