summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorDimitry Andric <dim@cvs.openbsd.org>2006-06-17 17:23:40 +0000
committerDimitry Andric <dim@cvs.openbsd.org>2006-06-17 17:23:40 +0000
commit4b76f2f0a8c8da832134b68d617d144bdf8222cc (patch)
tree621c7a0ed73e01ef6b65f7c99170887f0007d603 /sys/arch/i386
parent178f58f21c615fbb0c74a71b1b1732da8ccd7abe (diff)
In p4tcc, only check cpu stepping for the Pentium 4 family. Also kill
some trailing whitespace. ok gklok@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/machdep.c8
-rw-r--r--sys/arch/i386/i386/p4tcc.c42
2 files changed, 26 insertions, 24 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 36eed9d35b1..6b8019c2b1e 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.360 2006/06/15 02:53:15 gwk Exp $ */
+/* $OpenBSD: machdep.c,v 1.361 2006/06/17 17:23:39 dim Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -1435,7 +1435,7 @@ amd_family6_setup(struct cpu_info *ci)
extern void sse2_pagezero(void *, size_t);
extern void i686_pagezero(void *, size_t);
#if !defined(MULTIPROCESSOR)
- int family = (ci->ci_signature >> 8) & 15;
+ int family = (ci->ci_signature >> 8) & 15;
#endif
if (cpu_feature & CPUID_SSE2)
@@ -1461,7 +1461,7 @@ intel686_common_cpu_setup(struct cpu_info *ci)
{
#if !defined(SMALL_KERNEL) && defined(I686_CPU)
- int model = (ci->ci_signature >> 4) & 15;
+ int family = (ci->ci_signature >> 8) & 15;
int step = ci->ci_signature & 15;
if (cpu_ecxfeature & CPUIDECX_EST) {
@@ -1472,7 +1472,7 @@ intel686_common_cpu_setup(struct cpu_info *ci)
ci->ci_dev.dv_xname);
} else if ((cpu_feature & (CPUID_ACPI | CPUID_TM)) ==
(CPUID_ACPI | CPUID_TM))
- p4tcc_init(model, step);
+ p4tcc_init(family, step);
{
extern void (*pagezero)(void *, size_t);
diff --git a/sys/arch/i386/i386/p4tcc.c b/sys/arch/i386/i386/p4tcc.c
index 7f3e5b75d3f..fe935bb5838 100644
--- a/sys/arch/i386/i386/p4tcc.c
+++ b/sys/arch/i386/i386/p4tcc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: p4tcc.c,v 1.8 2006/06/15 13:18:51 dim Exp $ */
+/* $OpenBSD: p4tcc.c,v 1.9 2006/06/17 17:23:39 dim Exp $ */
/*
* Copyright (c) 2003 Ted Unangst
* All rights reserved.
@@ -62,29 +62,31 @@ static struct {
extern int setperf_prio;
void
-p4tcc_init(int model, int step)
+p4tcc_init(int family, int step)
{
if (setperf_prio > 1)
return;
- switch (step) {
- case 0x22: /* errata O50 P44 and Z21 */
- case 0x24:
- case 0x25:
- case 0x27:
- case 0x29:
- /* hang with 12.5 */
- tcc[TCC_LEVELS - 1].reg = 2;
- break;
- case 0x07: /* errata N44 and P18 */
- case 0x0a:
- case 0x12:
- case 0x13:
- /* hang at 12.5 and 25 */
- tcc[TCC_LEVELS - 1].reg = 3;
- tcc[TCC_LEVELS - 2].reg = 3;
- break;
- default:
+ switch (family) {
+ case 0xf: /* Pentium 4 */
+ switch (step) {
+ case 0x22: /* errata O50 P44 and Z21 */
+ case 0x24:
+ case 0x25:
+ case 0x27:
+ case 0x29:
+ /* hang with 12.5 */
+ tcc[TCC_LEVELS - 1].reg = 2;
+ break;
+ case 0x07: /* errata N44 and P18 */
+ case 0x0a:
+ case 0x12:
+ case 0x13:
+ /* hang at 12.5 and 25 */
+ tcc[TCC_LEVELS - 1].reg = 3;
+ tcc[TCC_LEVELS - 2].reg = 3;
+ break;
+ }
break;
}