kernel/cpu: Do not use get_system_info() to identify CPU
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
#include "amd.h"
|
||||
#include "generic_x86.h"
|
||||
|
||||
#include <OS.h>
|
||||
#include <cpu.h>
|
||||
|
||||
|
||||
static void
|
||||
@@ -23,16 +23,12 @@ amd_init_mtrrs(void)
|
||||
static status_t
|
||||
amd_init(void)
|
||||
{
|
||||
system_info info;
|
||||
if (get_system_info(&info) != B_OK)
|
||||
return B_ERROR;
|
||||
|
||||
if ((info.cpu_type & B_CPU_x86_VENDOR_MASK) != B_CPU_AMD_x86)
|
||||
if (gCPU[0].arch.vendor != VENDOR_AMD)
|
||||
return B_ERROR;
|
||||
|
||||
// The K6-2 doesn't seem to support write-combining (before model 9),
|
||||
// so we ignore anything before that one.
|
||||
if (info.cpu_type <= B_CPU_AMD_K6_2)
|
||||
if (gCPU[0].arch.family <= 5 || gCPU[0].arch.model < 9)
|
||||
return B_ERROR;
|
||||
|
||||
generic_mtrr_compute_physical_mask();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "intel.h"
|
||||
#include "generic_x86.h"
|
||||
|
||||
#include <OS.h>
|
||||
#include <cpu.h>
|
||||
|
||||
|
||||
static void
|
||||
@@ -23,11 +23,7 @@ intel_init_mtrrs(void)
|
||||
static status_t
|
||||
intel_init(void)
|
||||
{
|
||||
system_info info;
|
||||
if (get_system_info(&info) != B_OK)
|
||||
return B_ERROR;
|
||||
|
||||
if ((info.cpu_type & B_CPU_x86_VENDOR_MASK) != B_CPU_INTEL_x86)
|
||||
if (gCPU[0].arch.vendor != VENDOR_INTEL)
|
||||
return B_ERROR;
|
||||
|
||||
generic_mtrr_compute_physical_mask();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "via.h"
|
||||
#include "generic_x86.h"
|
||||
|
||||
#include <OS.h>
|
||||
#include <cpu.h>
|
||||
|
||||
|
||||
static uint32
|
||||
@@ -41,11 +41,7 @@ via_set_mtrrs(uint8 defaultType, const x86_mtrr_info* infos, uint32 count)
|
||||
static status_t
|
||||
via_init(void)
|
||||
{
|
||||
system_info info;
|
||||
if (get_system_info(&info) != B_OK)
|
||||
return B_ERROR;
|
||||
|
||||
if ((info.cpu_type & B_CPU_x86_VENDOR_MASK) != B_CPU_VIA_IDT_x86)
|
||||
if (gCPU[0].arch.vendor != VENDOR_CENTAUR)
|
||||
return B_ERROR;
|
||||
|
||||
// current VIA CPUs have always 36 bit (or less?)
|
||||
|
||||
Reference in New Issue
Block a user