From 444d55907871f88276a654fc7fdc8c7db95f4b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 28 May 2013 13:28:38 +0200 Subject: cpu: Turn cpu_paging_enabled() into a CPUState hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Relocate assignment of x86 get_arch_id to have all hooks in one place. Reviewed-by: Jens Freimann Reviewed-by: Luiz Capitulino Signed-off-by: Andreas Färber --- qom/cpu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'qom') 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; -- cgit v1.2.3