From 4ac67ec386d37db5b890fa575ac9c4daf0e9d010 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Fri, 29 Jul 2011 15:24:32 +0000 Subject: [PATCH] compilation when cu_level < 4 --- bochs/cpu/cpu.h | 3 --- bochs/cpu/init.cc | 11 ++++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bochs/cpu/cpu.h b/bochs/cpu/cpu.h index 7d8fee825..f2fdd62e8 100644 --- a/bochs/cpu/cpu.h +++ b/bochs/cpu/cpu.h @@ -634,9 +634,6 @@ typedef struct } bx_regs_msr_t; #endif -#define MAX_STD_CPUID_FUNCTION 14 -#define MAX_EXT_CPUID_FUNCTION 9 - #include "cpuid.h" #include "crregs.h" #include "descriptor.h" diff --git a/bochs/cpu/init.cc b/bochs/cpu/init.cc index c88e2f537..8f791eda5 100644 --- a/bochs/cpu/init.cc +++ b/bochs/cpu/init.cc @@ -27,7 +27,10 @@ #include "param_names.h" -BX_CPU_C::BX_CPU_C(unsigned id): bx_cpuid(id), cpuid(NULL) +BX_CPU_C::BX_CPU_C(unsigned id): bx_cpuid(id) +#if BX_CPU_LEVEL >= 4 + , cpuid(NULL) +#endif #if BX_SUPPORT_APIC ,lapic (this, id) #endif @@ -145,6 +148,8 @@ static Bit64s cpu_param_handler(bx_param_c *param, int set, Bit64s val) #endif +#if BX_CPU_LEVEL >= 4 + #include "generic_cpuid.h" #if BX_SUPPORT_X86_64 @@ -176,17 +181,21 @@ static bx_cpuid_t *cpuid_factory(BX_CPU_C *cpu) } } +#endif + // BX_CPU_C constructor void BX_CPU_C::initialize(void) { BX_CPU_THIS_PTR set_INTR(0); +#if BX_CPU_LEVEL >= 4 BX_CPU_THIS_PTR cpuid = cpuid_factory(this); if (! BX_CPU_THIS_PTR cpuid) BX_PANIC(("Failed to create CPUID module !")); BX_CPU_THIS_PTR isa_extensions_bitmask = cpuid->get_isa_extensions_bitmask(); BX_CPU_THIS_PTR cpu_extensions_bitmask = cpuid->get_cpu_extensions_bitmask(); +#endif init_FetchDecodeTables(); // must be called after init_isa_features_bitmask()