From 248f01553f4d6765e1f95e0207111d433c57296d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 2 May 2008 13:00:27 +0000 Subject: [PATCH] * Fixed warning and bad coding style. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25290 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_system_info.c | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_system_info.c b/src/system/kernel/arch/x86/arch_system_info.c index 54e38afd01..51b3a97fd9 100644 --- a/src/system/kernel/arch/x86/arch_system_info.c +++ b/src/system/kernel/arch/x86/arch_system_info.c @@ -1,19 +1,20 @@ /* - * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ +#include + +#include + #include #include +#include +#include #include #include -#include -#include -#include - -#include uint32 sCpuType; @@ -22,7 +23,8 @@ int64 sCpuClockSpeed; static bool -get_cpuid_for(cpuid_info *info, uint32 currentCPU, uint32 eaxRegister, uint32 forCPU) +get_cpuid_for(cpuid_info *info, uint32 currentCPU, uint32 eaxRegister, + uint32 forCPU) { if (currentCPU != forCPU) return false; @@ -81,7 +83,7 @@ arch_system_info_init(struct kernel_args *args) uint32 base; uint32 model = 0; cpu_ent *cpu = get_cpu_struct(); - + switch (cpu->arch.vendor) { case VENDOR_INTEL: base = B_CPU_INTEL_x86; @@ -114,29 +116,30 @@ arch_system_info_init(struct kernel_args *args) base = B_CPU_x86; } - if (base != B_CPU_x86) - if (base == B_CPU_INTEL_x86) - model = (cpu->arch.extended_family << 20) + (cpu->arch.extended_model << 16) + - (cpu->arch.family << 4) + cpu->arch.model; - else + if (base != B_CPU_x86) { + if (base == B_CPU_INTEL_x86) { + model = (cpu->arch.extended_family << 20) + + (cpu->arch.extended_model << 16) + + (cpu->arch.family << 4) + cpu->arch.model; + } else { model = (cpu->arch.family << 4) + cpu->arch.model; - /* There isn't much useful information yet in the extended - family and extended model fields of AMD processors - and is probably undefined for others */ + // There isn't much useful information yet in the extended + // family and extended model fields of AMD processors + // and is probably undefined for others + } + } sCpuRevision = (cpu->arch.extended_family << 18) - | (cpu->arch.extended_model << 14) - | (cpu->arch.type << 12) - | (cpu->arch.family << 8) - | (cpu->arch.model << 4) - | cpu->arch.stepping; + | (cpu->arch.extended_model << 14) | (cpu->arch.type << 12) + | (cpu->arch.family << 8) | (cpu->arch.model << 4) | cpu->arch.stepping; sCpuType = base + model; sCpuClockSpeed = args->arch_args.cpu_clock_speed; return B_OK; } + // #pragma mark -