From 466b3593e83286af3e81f7c6d1c4292c8f1fb659 Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 22 Jan 2003 18:18:45 +0000 Subject: - Move enable_sse()'s prototype to machine/md_var.h. - Sort definition of cpu_* variables appropriately. - Move cpu_fxsr out of the magic non-BSS set of variables and stick it in the BSS along with hw_instruction_sse (make the latter static as well). Submitted by: bde (partially) --- sys/amd64/amd64/initcpu.c | 13 ++++++------- sys/amd64/amd64/mp_machdep.c | 2 -- sys/amd64/amd64/mptable.c | 2 -- sys/amd64/include/md_var.h | 5 +++-- sys/amd64/include/mptable.h | 2 -- sys/i386/i386/initcpu.c | 13 ++++++------- sys/i386/i386/mp_machdep.c | 2 -- sys/i386/i386/mptable.c | 2 -- sys/i386/include/md_var.h | 5 +++-- sys/i386/include/mptable.h | 2 -- 10 files changed, 18 insertions(+), 30 deletions(-) (limited to 'sys') diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index 2c4edef..2a4b473 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -70,23 +70,22 @@ static void init_6x86MX(void); static void init_ppro(void); static void init_mendocino(void); #endif -void enable_sse(void); -int hw_instruction_sse = 0; +static int hw_instruction_sse; SYSCTL_INT(_hw, OID_AUTO, instruction_sse, CTLFLAG_RD, - &hw_instruction_sse, 0, - "SIMD/MMX2 instructions available in CPU"); + &hw_instruction_sse, 0, "SIMD/MMX2 instructions available in CPU"); /* Must *NOT* be BSS or locore will bzero these after setting them */ int cpu = 0; /* Are we 386, 386sx, 486, etc? */ -u_int cpu_id = 0; /* Stepping ID */ u_int cpu_feature = 0; /* Feature flags */ u_int cpu_high = 0; /* Highest arg to CPUID */ +u_int cpu_id = 0; /* Stepping ID */ u_int cpu_procinfo = 0; /* HyperThreading Info / Brand Index / CLFUSH */ +char cpu_vendor[20] = ""; /* CPU Origin code */ + #ifdef CPU_ENABLE_SSE -u_int cpu_fxsr = 0; /* SSE enabled */ +u_int cpu_fxsr; /* SSE enabled */ #endif -char cpu_vendor[20] = ""; /* CPU Origin code */ #ifdef I486_CPU /* diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 599f182..39d10d6 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -2523,8 +2523,6 @@ smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. */ -extern void enable_sse(void); - void ap_init(void) { diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c index 599f182..39d10d6 100644 --- a/sys/amd64/amd64/mptable.c +++ b/sys/amd64/amd64/mptable.c @@ -2523,8 +2523,6 @@ smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. */ -extern void enable_sse(void); - void ap_init(void) { diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h index 0f3922c..5f52c259 100644 --- a/sys/amd64/include/md_var.h +++ b/sys/amd64/include/md_var.h @@ -44,10 +44,10 @@ extern int (*copyin_vector)(const void *udaddr, void *kaddr, size_t len); extern int (*copyout_vector)(const void *kaddr, void *udaddr, size_t len); extern u_int cpu_exthigh; extern u_int cpu_feature; +extern u_int cpu_fxsr; extern u_int cpu_high; -extern u_int cpu_procinfo; extern u_int cpu_id; -extern u_int cpu_fxsr; +extern u_int cpu_procinfo; extern char cpu_vendor[]; extern u_int cyrix_did; extern uint16_t *elan_mmcr; @@ -86,6 +86,7 @@ void doreti_popl_es(void) __asm(__STRING(doreti_popl_es)); void doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault)); void doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs)); void doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault)); +void enable_sse(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void i486_bzero(void *buf, size_t len); void i586_bcopy(const void *from, void *to, size_t len); diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index 599f182..39d10d6 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/include/mptable.h @@ -2523,8 +2523,6 @@ smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. */ -extern void enable_sse(void); - void ap_init(void) { diff --git a/sys/i386/i386/initcpu.c b/sys/i386/i386/initcpu.c index 2c4edef..2a4b473 100644 --- a/sys/i386/i386/initcpu.c +++ b/sys/i386/i386/initcpu.c @@ -70,23 +70,22 @@ static void init_6x86MX(void); static void init_ppro(void); static void init_mendocino(void); #endif -void enable_sse(void); -int hw_instruction_sse = 0; +static int hw_instruction_sse; SYSCTL_INT(_hw, OID_AUTO, instruction_sse, CTLFLAG_RD, - &hw_instruction_sse, 0, - "SIMD/MMX2 instructions available in CPU"); + &hw_instruction_sse, 0, "SIMD/MMX2 instructions available in CPU"); /* Must *NOT* be BSS or locore will bzero these after setting them */ int cpu = 0; /* Are we 386, 386sx, 486, etc? */ -u_int cpu_id = 0; /* Stepping ID */ u_int cpu_feature = 0; /* Feature flags */ u_int cpu_high = 0; /* Highest arg to CPUID */ +u_int cpu_id = 0; /* Stepping ID */ u_int cpu_procinfo = 0; /* HyperThreading Info / Brand Index / CLFUSH */ +char cpu_vendor[20] = ""; /* CPU Origin code */ + #ifdef CPU_ENABLE_SSE -u_int cpu_fxsr = 0; /* SSE enabled */ +u_int cpu_fxsr; /* SSE enabled */ #endif -char cpu_vendor[20] = ""; /* CPU Origin code */ #ifdef I486_CPU /* diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 599f182..39d10d6 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -2523,8 +2523,6 @@ smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. */ -extern void enable_sse(void); - void ap_init(void) { diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c index 599f182..39d10d6 100644 --- a/sys/i386/i386/mptable.c +++ b/sys/i386/i386/mptable.c @@ -2523,8 +2523,6 @@ smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. */ -extern void enable_sse(void); - void ap_init(void) { diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index 0f3922c..5f52c259 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -44,10 +44,10 @@ extern int (*copyin_vector)(const void *udaddr, void *kaddr, size_t len); extern int (*copyout_vector)(const void *kaddr, void *udaddr, size_t len); extern u_int cpu_exthigh; extern u_int cpu_feature; +extern u_int cpu_fxsr; extern u_int cpu_high; -extern u_int cpu_procinfo; extern u_int cpu_id; -extern u_int cpu_fxsr; +extern u_int cpu_procinfo; extern char cpu_vendor[]; extern u_int cyrix_did; extern uint16_t *elan_mmcr; @@ -86,6 +86,7 @@ void doreti_popl_es(void) __asm(__STRING(doreti_popl_es)); void doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault)); void doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs)); void doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault)); +void enable_sse(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void i486_bzero(void *buf, size_t len); void i586_bcopy(const void *from, void *to, size_t len); diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h index 599f182..39d10d6 100644 --- a/sys/i386/include/mptable.h +++ b/sys/i386/include/mptable.h @@ -2523,8 +2523,6 @@ smp_masked_invlpg_range(u_int mask, vm_offset_t addr1, vm_offset_t addr2) * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. */ -extern void enable_sse(void); - void ap_init(void) { -- cgit v1.1