diff options
author | Andreas Färber <afaerber@suse.de> | 2013-05-28 13:28:38 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-06-11 17:50:09 +0200 |
commit | 444d55907871f88276a654fc7fdc8c7db95f4b59 (patch) | |
tree | 10dde797d560c58dbd9a70405c0b38891fef5fc1 /qom | |
parent | c51a944b7505ba827adc897d5452d2b54dbf86bb (diff) | |
download | qemu-444d55907871f88276a654fc7fdc8c7db95f4b59.tar.gz qemu-444d55907871f88276a654fc7fdc8c7db95f4b59.tar.bz2 qemu-444d55907871f88276a654fc7fdc8c7db95f4b59.zip |
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')
-rw-r--r-- | qom/cpu.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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; |