Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145971271
D7888.id20370.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
D7888.id20370.diff
View Options
Index: head/sys/amd64/amd64/machdep.c
===================================================================
--- head/sys/amd64/amd64/machdep.c
+++ head/sys/amd64/amd64/machdep.c
@@ -269,7 +269,6 @@
*/
startrtclock();
printcpuinfo();
- panicifcpuunsupported();
/*
* Display physical memory if SMBIOS reports reasonable amount.
Index: head/sys/amd64/include/cputypes.h
===================================================================
--- head/sys/amd64/include/cputypes.h
+++ head/sys/amd64/include/cputypes.h
@@ -1,48 +1,6 @@
/*-
- * Copyright (c) 1993 Christopher G. Demetriou
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
+ * This file is in the public domain.
*/
-
-#ifndef _MACHINE_CPUTYPES_H_
-#define _MACHINE_CPUTYPES_H_
+/* $FreeBSD$ */
#include <x86/cputypes.h>
-
-/*
- * Classes of processor.
- */
-#define CPUCLASS_X86 0 /* X86 */
-#define CPUCLASS_K8 1 /* K8 AMD64 class */
-
-/*
- * Kinds of processor.
- */
-#define CPU_X86 0 /* Intel */
-#define CPU_CLAWHAMMER 1 /* AMD Clawhammer */
-#define CPU_SLEDGEHAMMER 2 /* AMD Sledgehammer */
-
-#endif /* !_MACHINE_CPUTYPES_H_ */
Index: head/sys/compat/linprocfs/linprocfs.c
===================================================================
--- head/sys/compat/linprocfs/linprocfs.c
+++ head/sys/compat/linprocfs/linprocfs.c
@@ -218,7 +218,7 @@
char model[128];
uint64_t freq;
size_t size;
- int class, fqmhz, fqkhz;
+ int fqmhz, fqkhz;
int i;
/*
@@ -235,33 +235,6 @@
"3dnowext", "3dnow"
};
- switch (cpu_class) {
-#ifdef __i386__
- case CPUCLASS_286:
- class = 2;
- break;
- case CPUCLASS_386:
- class = 3;
- break;
- case CPUCLASS_486:
- class = 4;
- break;
- case CPUCLASS_586:
- class = 5;
- break;
- case CPUCLASS_686:
- class = 6;
- break;
- default:
- class = 0;
- break;
-#else /* __amd64__ */
- default:
- class = 15;
- break;
-#endif
- }
-
hw_model[0] = CTL_HW;
hw_model[1] = HW_MODEL;
model[0] = '\0';
@@ -286,7 +259,7 @@
#ifdef __i386__
switch (cpu_vendor_id) {
case CPU_VENDOR_AMD:
- if (class < 6)
+ if (cpu_class < CPUCLASS_686)
flags[16] = "fcmov";
break;
case CPU_VENDOR_CYRIX:
Index: head/sys/i386/include/cputypes.h
===================================================================
--- head/sys/i386/include/cputypes.h
+++ head/sys/i386/include/cputypes.h
@@ -63,4 +63,9 @@
#define CPU_P4 16 /* Intel Pentium 4 */
#define CPU_GEODE1100 17 /* NS Geode SC1100 */
+#ifndef LOCORE
+extern int cpu;
+extern int cpu_class;
+#endif
+
#endif /* !_MACHINE_CPUTYPES_H_ */
Index: head/sys/i386/include/md_var.h
===================================================================
--- head/sys/i386/include/md_var.h
+++ head/sys/i386/include/md_var.h
@@ -65,6 +65,7 @@
void sse2_pagezero(void *addr);
void init_AMD_Elan_sc520(void);
vm_paddr_t kvtop(void *addr);
+void panicifcpuunsupported(void);
void ppro_reenable_apic(void);
void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec);
union savefpu *get_pcb_user_save_td(struct thread *td);
Index: head/sys/x86/include/cputypes.h
===================================================================
--- head/sys/x86/include/cputypes.h
+++ head/sys/x86/include/cputypes.h
@@ -46,9 +46,4 @@
#define CPU_VENDOR_RISE 0xdead2bad /* Rise */
#define CPU_VENDOR_CENTAUR CPU_VENDOR_IDT
-#ifndef LOCORE
-extern int cpu;
-extern int cpu_class;
-#endif
-
#endif /* !_X86_CPUTYPES_H_ */
Index: head/sys/x86/include/x86_var.h
===================================================================
--- head/sys/x86/include/x86_var.h
+++ head/sys/x86/include/x86_var.h
@@ -107,7 +107,6 @@
void fillw(int /*u_short*/ pat, void *base, size_t cnt);
int is_physical_memory(vm_paddr_t addr);
int isa_nmi(int cd);
-void panicifcpuunsupported(void);
void pagecopy(void *from, void *to);
void printcpuinfo(void);
int user_dbreg_trap(void);
Index: head/sys/x86/x86/identcpu.c
===================================================================
--- head/sys/x86/x86/identcpu.c
+++ head/sys/x86/x86/identcpu.c
@@ -87,8 +87,10 @@
static void print_via_padlock_info(void);
static void print_vmx_info(void);
+#ifdef __i386__
int cpu; /* Are we 386, 386sx, 486, etc? */
int cpu_class;
+#endif
u_int cpu_feature; /* Feature flags */
u_int cpu_feature2; /* Feature flags */
u_int amd_feature; /* AMD feature flags */
@@ -184,13 +186,11 @@
NULL,
"Intel Pentium 4"
};
-#endif
static struct {
char *cpu_name;
int cpu_class;
} cpus[] = {
-#ifdef __i386__
{ "Intel 80286", CPUCLASS_286 }, /* CPU_286 */
{ "i386SX", CPUCLASS_386 }, /* CPU_386SX */
{ "i386DX", CPUCLASS_386 }, /* CPU_386 */
@@ -208,11 +208,8 @@
{ "Pentium II", CPUCLASS_686 }, /* CPU_PII */
{ "Pentium III", CPUCLASS_686 }, /* CPU_PIII */
{ "Pentium 4", CPUCLASS_686 }, /* CPU_P4 */
-#else
- { "Clawhammer", CPUCLASS_K8 }, /* CPU_CLAWHAMMER */
- { "Sledgehammer", CPUCLASS_K8 }, /* CPU_SLEDGEHAMMER */
-#endif
};
+#endif
static struct {
char *vendor;
@@ -242,9 +239,13 @@
u_int regs[4], i;
char *brand;
- cpu_class = cpus[cpu].cpu_class;
printf("CPU: ");
+#ifdef __i386__
+ cpu_class = cpus[cpu].cpu_class;
strncpy(cpu_model, cpus[cpu].cpu_name, sizeof (cpu_model));
+#else
+ strncpy(cpu_model, "Hammer", sizeof (cpu_model));
+#endif
/* Check for extended CPUID information and a processor name. */
if (cpu_exthigh >= 0x80000004) {
@@ -697,8 +698,8 @@
(intmax_t)(tsc_freq + 4999) / 1000000,
(u_int)((tsc_freq + 4999) / 10000) % 100);
}
- switch(cpu_class) {
#ifdef __i386__
+ switch(cpu_class) {
case CPUCLASS_286:
printf("286");
break;
@@ -720,14 +721,12 @@
printf("686");
break;
#endif
-#else
- case CPUCLASS_K8:
- printf("K8");
- break;
-#endif
default:
printf("Unknown"); /* will panic below... */
}
+#else
+ printf("K8");
+#endif
printf("-class CPU)\n");
if (*cpu_vendor)
printf(" Origin=\"%s\"", cpu_vendor);
@@ -1051,28 +1050,22 @@
print_hypervisor_info();
}
+#ifdef __i386__
void
panicifcpuunsupported(void)
{
-#ifdef __i386__
#if !defined(lint)
#if !defined(I486_CPU) && !defined(I586_CPU) && !defined(I686_CPU)
#error This kernel is not configured for one of the supported CPUs
#endif
#else /* lint */
#endif /* lint */
-#else /* __amd64__ */
-#ifndef HAMMER
-#error "You need to specify a cpu type"
-#endif
-#endif
/*
* Now that we have told the user what they have,
* let them know if that machine type isn't configured.
*/
switch (cpu_class) {
-#ifdef __i386__
case CPUCLASS_286: /* a 286 should not make it this far, anyway */
case CPUCLASS_386:
#if !defined(I486_CPU)
@@ -1084,19 +1077,12 @@
#if !defined(I686_CPU)
case CPUCLASS_686:
#endif
-#else /* __amd64__ */
- case CPUCLASS_X86:
-#ifndef HAMMER
- case CPUCLASS_K8:
-#endif
-#endif
panic("CPU class not configured");
default:
break;
}
}
-#ifdef __i386__
static volatile u_int trap_by_rdmsr;
/*
@@ -1580,9 +1566,6 @@
return;
}
}
-#else
- /* XXX */
- cpu = CPU_CLAWHAMMER;
#endif
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 27, 3:47 PM (5 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29034734
Default Alt Text
D7888.id20370.diff (8 KB)
Attached To
Mode
D7888: Remove 'cpu' and 'cpu_class' on amd64.
Attached
Detach File
Event Timeline
Log In to Comment