Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/i386 Newer Intel PIII processors also make ava...
details: https://anonhg.NetBSD.org/src/rev/c68efc844de6
branches: trunk
changeset: 499301:c68efc844de6
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Thu Nov 16 10:19:02 2000 +0000
description:
Newer Intel PIII processors also make available Brand ID value through
cpuid instruction, which is used to differentiate between Celeron, common PIII
and PIII Xeon; recognize it and print appropriate info if applicable
Information taken from Intel's (R)
Intel Processor Identification and the CPUID Instruction, AP-485
diffstat:
sys/arch/i386/i386/locore.s | 8 +++++++-
sys/arch/i386/i386/machdep.c | 27 ++++++++++++++++++++++++---
2 files changed, 31 insertions(+), 4 deletions(-)
diffs (94 lines):
diff -r e414a9b30541 -r c68efc844de6 sys/arch/i386/i386/locore.s
--- a/sys/arch/i386/i386/locore.s Thu Nov 16 09:06:17 2000 +0000
+++ b/sys/arch/i386/i386/locore.s Thu Nov 16 10:19:02 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.225 2000/09/07 18:46:19 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.226 2000/11/16 10:19:02 jdolecek Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -217,6 +217,7 @@
.globl _C_LABEL(cpu),_C_LABEL(cpu_id),_C_LABEL(cpu_vendor)
.globl _C_LABEL(cpuid_level),_C_LABEL(cpu_feature)
+ .globl _C_LABEL(cpu_brand_id)
.globl _C_LABEL(esym),_C_LABEL(boothowto)
.globl _C_LABEL(bootinfo),_C_LABEL(atdevbase)
#ifdef COMPAT_OLDBOOT
@@ -237,6 +238,7 @@
# instruction
_C_LABEL(cpu_vendor): .space 16 # vendor string returned by `cpuid'
# instruction
+_C_LABEL(cpu_brand_id): .long 0 # brand ID from 'cpuid' instruction
_C_LABEL(esym): .long 0 # ptr to end of syms
_C_LABEL(atdevbase): .long 0 # location of start of iomem in virtual
_C_LABEL(proc0paddr): .long 0
@@ -499,6 +501,10 @@
movl %eax,RELOC(cpu_id) # store cpu_id and features
movl %edx,RELOC(cpu_feature)
+ /* Brand ID is bits 0-7 of %ebx */
+ andl $255,%ebx
+ movl %ebx,RELOC(cpu_brand_id)
+
2:
/*
* Finished with old stack; load new %esp now instead of later so we
diff -r e414a9b30541 -r c68efc844de6 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c Thu Nov 16 09:06:17 2000 +0000
+++ b/sys/arch/i386/i386/machdep.c Thu Nov 16 10:19:02 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.416 2000/11/16 09:06:17 jdolecek Exp $ */
+/* $NetBSD: machdep.c,v 1.417 2000/11/16 10:19:02 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -281,6 +281,17 @@
const struct i386_cache_info *i386_cache_info_lookup __P((u_int8_t));
+/*
+ * Map Brand ID from cpuid instruction to brand name.
+ * Source: Intel Processor Identification and the CPUID Instruction, AP-485
+ */
+const char * const i386_p3_brand[] = {
+ NULL, /* Unsupported */
+ "Celeron", /* Intel (R) Celeron (TM) processor */
+ "", /* Intel (R) Pentium (R) III processor */
+ "Xeon", /* Intel (R) Pentium (R) III Xeon (TM) processor */
+};
+
#ifdef COMPAT_NOMID
static int exec_nomid __P((struct proc *, struct exec_package *));
#endif
@@ -863,7 +874,8 @@
{
extern char cpu_vendor[];
extern int cpu_id;
- const char *name, *modifier, *vendorname;
+ extern int cpu_brand_id;
+ const char *name, *modifier, *vendorname, *brand = "";
int class = CPUCLASS_386, vendor, i, max;
int family, model, step, modif;
struct cpu_cpuid_nameclass *cpup = NULL;
@@ -929,10 +941,19 @@
name = cpup->cpu_family[i].cpu_models[CPU_DEFMODEL];
class = cpup->cpu_family[i].cpu_class;
cpu_setup = cpup->cpu_family[i].cpu_setup;
+
+ /*
+ * Intel processors family >= 6, model 8 allow to
+ * recognize brand by Brand ID value.
+ */
+ if (vendor == CPUVENDOR_INTEL && family >= 6
+ && model >= 8 && cpu_brand_id && cpu_brand_id <= 3)
+ brand = i386_p3_brand[cpu_brand_id];
}
}
- sprintf(cpu_model, "%s %s%s (%s-class)", vendorname, modifier, name,
+ sprintf(cpu_model, "%s %s%s%s%s (%s-class)", vendorname, modifier, name,
+ (brand && *brand) ? " " : "", brand,
classnames[class]);
cpu_class = class;
Home |
Main Index |
Thread Index |
Old Index