This is a discussion on remove i386 cpu classes within the mailing.openbsd.tech forums, part of the OpenBSD category; --> if saving 100 bytes by leaving 686 support out of your 586 kernel makes a difference, here's a nickel, ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| if saving 100 bytes by leaving 686 support out of your 586 kernel makes a difference, here's a nickel, get a real computer... simplifies quite a bit of mazy ifdef. also of note, if the cpuclass is 386, print a warning and promote to 486. it's much more likely to be a new undetected cpu than some old crap. Index: conf/GENERIC ================================================== ================= RCS file: /cvs/src/sys/arch/i386/conf/GENERIC,v retrieving revision 1.591 diff -u -u -r1.591 GENERIC --- conf/GENERIC 25 Nov 2007 17:11:12 -0000 1.591 +++ conf/GENERIC 28 Nov 2007 15:46:36 -0000 @@ -13,10 +13,6 @@ include "../../../conf/GENERIC" maxusers 32 # estimated number of users -option I486_CPU # CPU classes; at least one is REQUIRED -option I586_CPU -option I686_CPU - option USER_PCICONF # user-space PCI configuration #option VM86 # Virtual 8086 emulation Index: conf/RAMDISK ================================================== ================= RCS file: /cvs/src/sys/arch/i386/conf/RAMDISK,v retrieving revision 1.156 diff -u -u -r1.156 RAMDISK --- conf/RAMDISK 15 Nov 2007 22:21:32 -0000 1.156 +++ conf/RAMDISK 28 Nov 2007 15:46:36 -0000 @@ -5,10 +5,6 @@ option SCSITERSE option APM_NOPRINT -option I486_CPU # CPU classes; at least one is REQUIRED -option I586_CPU -option I686_CPU - option SMALL_KERNEL option NO_PROPOLICE Index: conf/RAMDISKB ================================================== ================= RCS file: /cvs/src/sys/arch/i386/conf/RAMDISKB,v retrieving revision 1.100 diff -u -u -r1.100 RAMDISKB --- conf/RAMDISKB 15 Nov 2007 22:21:32 -0000 1.100 +++ conf/RAMDISKB 28 Nov 2007 15:46:36 -0000 @@ -5,10 +5,6 @@ option SCSITERSE option APM_NOPRINT -option I486_CPU # CPU classes; at least one is REQUIRED -option I586_CPU -option I686_CPU - option SMALL_KERNEL option NO_PROPOLICE Index: conf/RAMDISKC ================================================== ================= RCS file: /cvs/src/sys/arch/i386/conf/RAMDISKC,v retrieving revision 1.81 diff -u -u -r1.81 RAMDISKC --- conf/RAMDISKC 16 Nov 2007 03:18:36 -0000 1.81 +++ conf/RAMDISKC 28 Nov 2007 15:46:36 -0000 @@ -5,10 +5,6 @@ option SCSITERSE option APM_NOPRINT -option I486_CPU # CPU classes; at least one is REQUIRED -option I586_CPU -option I686_CPU - option SMALL_KERNEL option NO_PROPOLICE Index: conf/RAMDISK_CD ================================================== ================= RCS file: /cvs/src/sys/arch/i386/conf/RAMDISK_CD,v retrieving revision 1.145 diff -u -u -r1.145 RAMDISK_CD --- conf/RAMDISK_CD 15 Nov 2007 22:21:32 -0000 1.145 +++ conf/RAMDISK_CD 28 Nov 2007 15:46:36 -0000 @@ -5,10 +5,6 @@ option SCSITERSE option APM_NOPRINT -option I486_CPU # CPU classes; at least one is REQUIRED -option I586_CPU -option I686_CPU - option SMALL_KERNEL option NO_PROPOLICE Index: conf/files.i386 ================================================== ================= RCS file: /cvs/src/sys/arch/i386/conf/files.i386,v retrieving revision 1.170 diff -u -u -r1.170 files.i386 --- conf/files.i386 25 Nov 2007 18:25:28 -0000 1.170 +++ conf/files.i386 28 Nov 2007 15:46:36 -0000 @@ -18,22 +18,22 @@ file arch/i386/i386/db_trace.c ddb file arch/i386/i386/db_magic.s ddb file arch/i386/i386/disksubr.c disk -file arch/i386/i386/est.c !small_kernel & i686_cpu +file arch/i386/i386/est.c !small_kernel file arch/i386/i386/gdt.c file arch/i386/i386/in_cksum.s inet file arch/i386/i386/machdep.c -file arch/i386/i386/via.c i686_cpu -file arch/i386/i386/amd64errata.c i686_cpu +file arch/i386/i386/via.c +file arch/i386/i386/amd64errata.c file arch/i386/i386/kgdb_machdep.c kgdb -file arch/i386/i386/longrun.c !small_kernel & i586_cpu +file arch/i386/i386/longrun.c !small_kernel file arch/i386/i386/mem.c file arch/i386/i386/i686_mem.c mtrr file arch/i386/i386/k6_mem.c mtrr -file arch/i386/i386/p4tcc.c !small_kernel & i686_cpu +file arch/i386/i386/p4tcc.c !small_kernel file arch/i386/i386/pmap.c -file arch/i386/i386/powernow.c !small_kernel & i586_cpu -file arch/i386/i386/powernow-k7.c !small_kernel & i686_cpu -file arch/i386/i386/powernow-k8.c !small_kernel & i686_cpu +file arch/i386/i386/powernow.c !small_kernel +file arch/i386/i386/powernow-k7.c !small_kernel +file arch/i386/i386/powernow-k8.c !small_kernel file arch/i386/i386/process_machdep.c file arch/i386/i386/procfs_machdep.c procfs file arch/i386/i386/random.s Index: i386/autoconf.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/i386/autoconf.c,v retrieving revision 1.75 diff -u -u -r1.75 autoconf.c --- i386/autoconf.c 1 Jun 2007 19:25:10 -0000 1.75 +++ i386/autoconf.c 28 Nov 2007 15:46:37 -0000 @@ -84,7 +84,6 @@ extern dev_t bootdev; /* Support for VIA C3 RNG */ -#ifdef I686_CPU extern struct timeout viac3_rnd_tmo; extern int viac3_rnd_present; void viac3_rnd(void *); @@ -92,7 +91,6 @@ #ifdef CRYPTO void viac3_crypto_setup(void); extern int i386_has_xcrypt; -#endif /* CRYPTO */ #endif /* @@ -146,7 +144,6 @@ */ cold = 0; -#ifdef I686_CPU /* * At this point the RNG is running, and if FSXR is set we can * use it. Here we setup a periodic timeout to collect the data. @@ -161,7 +158,6 @@ */ if (i386_has_xcrypt) viac3_crypto_setup(); -#endif /* CRYPTO */ #endif } Index: i386/cpu.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/i386/cpu.c,v retrieving revision 1.28 diff -u -u -r1.28 cpu.c --- i386/cpu.c 27 Nov 2007 16:22:13 -0000 1.28 +++ i386/cpu.c 28 Nov 2007 15:46:37 -0000 @@ -342,7 +342,6 @@ lcr4(rcr4() | CR4_PGE); /* enable global TLB caching */ ci->ci_flags |= CPUF_RUNNING; -#if defined(I686_CPU) /* * If we have FXSAVE/FXRESTOR, use them. */ @@ -355,7 +354,6 @@ if (cpu_feature & (CPUID_SSE|CPUID_SSE2)) lcr4(rcr4() | CR4_OSXMMEXCPT); } -#endif /* I686_CPU */ } void Index: i386/locore.s ================================================== ================= RCS file: /cvs/src/sys/arch/i386/i386/locore.s,v retrieving revision 1.120 diff -u -u -r1.120 locore.s --- i386/locore.s 5 Nov 2007 21:46:13 -0000 1.120 +++ i386/locore.s 28 Nov 2007 15:46:38 -0000 @@ -1559,7 +1559,6 @@ TRAP(T_STKFLT) IDTVEC(prot) TRAP(T_PROTFLT) -#ifdef I586_CPU IDTVEC(f00f_redirect) pushl $T_PAGEFLT INTRENTRY @@ -1571,7 +1570,6 @@ jne calltrap movb $T_PRIVINFLT,TF_TRAPNO(%esp) jmp calltrap -#endif IDTVEC(page) TRAP(T_PAGEFLT) IDTVEC(rsvd) @@ -1744,11 +1742,8 @@ rep /* zero until word aligned */ stosb -#if defined(I486_CPU) -#if defined(I586_CPU) || defined(I686_CPU) cmpl $CPUCLASS_486,_C_LABEL(cpu_class) jne 8f -#endif movl %edx,%ecx shrl $6,%ecx @@ -1773,7 +1768,6 @@ addl $64,%edi decl %ecx jnz 1b -#endif 8: movl %edx,%ecx /* zero by words */ shrl $2,%ecx @@ -1788,7 +1782,7 @@ popl %edi ret -#if defined(I686_CPU) && !defined(SMALL_KERNEL) +#if !defined(SMALL_KERNEL) ENTRY(sse2_pagezero) pushl %ebx movl 8(%esp),%ecx Index: i386/machdep.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/i386/machdep.c,v retrieving revision 1.412 diff -u -u -r1.412 machdep.c --- i386/machdep.c 25 Nov 2007 10:50:13 -0000 1.412 +++ i386/machdep.c 28 Nov 2007 15:46:39 -0000 @@ -239,7 +239,7 @@ struct vm_map *exec_map = NULL; struct vm_map *phys_map = NULL; -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) int p4_model; int p3_early; void (*update_cpuspeed)(void) = NULL; @@ -1079,7 +1079,6 @@ void winchip_cpu_setup(struct cpu_info *ci) { -#if defined(I586_CPU) switch ((ci->ci_signature >> 4) & 15) { /* model */ case 4: /* WinChip C6 */ @@ -1089,10 +1088,9 @@ printf("%s: TSC disabled\n", ci->ci_dev.dv_xname); break; } -#endif } -#if defined(I686_CPU) && !defined(SMALL_KERNEL) +#if !defined(SMALL_KERNEL) void cyrix3_setperf_setup(struct cpu_info *ci) { @@ -1104,12 +1102,10 @@ ci->ci_dev.dv_xname); } } -#endif void cyrix3_cpu_setup(struct cpu_info *ci) { -#if defined(I686_CPU) int model = (ci->ci_signature >> 4) & 15; int step = ci->ci_signature & 15; @@ -1237,7 +1233,6 @@ printf("\n"); break; } -#endif } void @@ -1276,7 +1271,6 @@ void natsem6x86_cpu_setup(struct cpu_info *ci) { -#if defined(I586_CPU) || defined(I686_CPU) extern int clock_broken_latch; int model = (ci->ci_signature >> 4) & 15; @@ -1287,22 +1281,19 @@ printf("%s: TSC disabled\n", ci->ci_dev.dv_xname); break; } -#endif } void intel586_cpu_setup(struct cpu_info *ci) { -#if defined(I586_CPU) if (!cpu_f00f_bug) { fix_f00f(); printf("%s: F00F bug workaround installed\n", ci->ci_dev.dv_xname); } -#endif } -#if !defined(SMALL_KERNEL) && defined(I586_CPU) +#if !defined(SMALL_KERNEL) void amd_family5_setperf_setup(struct cpu_info *ci) { @@ -1332,14 +1323,14 @@ break; case 12: case 13: -#if !defined(SMALL_KERNEL) && defined(I586_CPU) +#if !defined(SMALL_KERNEL) setperf_setup = amd_family5_setperf_setup; #endif break; } } -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) void amd_family6_setperf_setup(struct cpu_info *ci) { @@ -1354,12 +1345,12 @@ break; } } -#endif /* !SMALL_KERNEL && I686_CPU */ +#endif void amd_family6_setup(struct cpu_info *ci) { -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) int family = (ci->ci_signature >> 8) & 15; extern void (*pagezero)(void *, size_t); extern void sse2_pagezero(void *, size_t); @@ -1378,7 +1369,7 @@ #endif } -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) /* * Temperature read on the CPU is relative to the maximum * temperature supported by the CPU, Tj(Max). @@ -1436,7 +1427,7 @@ } #endif -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) void intel686_setperf_setup(struct cpu_info *ci) { @@ -1459,7 +1450,7 @@ intel686_common_cpu_setup(struct cpu_info *ci) { -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) setperf_setup = intel686_setperf_setup; cpusensors_setup = intel686_cpusensors_setup; { @@ -1487,7 +1478,7 @@ int step = ci->ci_signature & 15; u_quad_t msr119; -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) p3_get_bus_clock(ci); #endif @@ -1514,7 +1505,7 @@ ci->ci_level = 2; } -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) p3_early = (model == 8 && step == 1) ? 1 : 0; update_cpuspeed = p3_update_cpuspeed; #endif @@ -1523,13 +1514,13 @@ void intel686_p4_cpu_setup(struct cpu_info *ci) { -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) p4_get_bus_clock(ci); #endif intel686_common_cpu_setup(ci); -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) p4_model = (ci->ci_signature >> 4) & 15; update_cpuspeed = p4_update_cpuspeed; #endif @@ -1538,7 +1529,7 @@ void tm86_cpu_setup(struct cpu_info *ci) { -#if !defined(SMALL_KERNEL) && (defined(I586_CPU) || defined(I686_CPU)) +#if !defined(SMALL_KERNEL) longrun_init(); #endif } @@ -1778,7 +1769,6 @@ printf("%s: %s", cpu_device, cpu_model); } -#if defined(I586_CPU) || defined(I686_CPU) if (ci->ci_feature_flags && (ci->ci_feature_flags & CPUID_TSC)) { /* Has TSC */ calibrate_cyclecounter(); @@ -1799,7 +1789,6 @@ } } } -#endif if ((ci->ci_flags & CPUF_PRIMARY) == 0) { printf("\n"); @@ -1838,49 +1827,15 @@ #endif #ifndef SMALL_KERNEL -#if defined(I586_CPU) || defined(I686_CPU) if (cpuspeed != 0 && cpu_cpuspeed == NULL) cpu_cpuspeed = pentium_cpuspeed; #endif -#endif cpu_class = class; - /* - * Now that we have told the user what they have, - * let them know if that machine type isn't configured. - */ - switch (cpu_class) { -#if !defined(I486_CPU) && !defined(I586_CPU) && !defined(I686_CPU) -#error No CPU classes configured. -#endif -#ifndef I686_CPU - case CPUCLASS_686: - printf("NOTICE: this kernel does not support Pentium Pro CPU class\n"); -#ifdef I586_CPU - printf("NOTICE: lowering CPU class to i586\n"); - cpu_class = CPUCLASS_586; - break; -#endif -#endif -#ifndef I586_CPU - case CPUCLASS_586: - printf("NOTICE: this kernel does not support Pentium CPU class\n"); -#ifdef I486_CPU - printf("NOTICE: lowering CPU class to i486\n"); + if (cpu_class == CPUCLASS_386) { + printf("WARNING: 386 (possibly unknown?) cpu class, assuming 486\n"); cpu_class = CPUCLASS_486; - break; -#endif -#endif -#ifndef I486_CPU - case CPUCLASS_486: - printf("NOTICE: this kernel does not support i486 CPU class\n"); -#endif - case CPUCLASS_386: - printf("NOTICE: this kernel does not support i386 CPU class\n"); - panic("no appropriate CPU class available"); - default: - break; } ci->cpu_class = class; @@ -1903,7 +1858,6 @@ */ lcr0(rcr0() | CR0_WP); -#if defined(I686_CPU) /* * If we have FXSAVE/FXRESTOR, use them. */ @@ -1925,7 +1879,6 @@ } else i386_use_fxsave = 0; -#endif /* I686_CPU */ } char * @@ -1948,7 +1901,6 @@ } #ifndef SMALL_KERNEL -#ifdef I686_CPU void cyrix3_get_bus_clock(struct cpu_info *ci) { @@ -2153,16 +2105,13 @@ cpuspeed = (bus_clock * mult) / 1000; } -#endif /* I686_CPU */ -#if defined(I586_CPU) || defined(I686_CPU) int pentium_cpuspeed(int *freq) { *freq = cpuspeed; return (0); } -#endif #endif /* !SMALL_KERNEL */ #ifdef COMPAT_IBCS2 @@ -2215,9 +2164,7 @@ sendsig(sig_t catcher, int sig, int mask, u_long code, int type, union sigval val) { -#ifdef I686_CPU extern char sigcode, sigcode_xmm; -#endif struct proc *p = curproc; struct trapframe *tf = p->p_md.md_regs; struct sigframe *fp, frame; @@ -2315,10 +2262,8 @@ tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL); tf->tf_eip = p->p_sigcode; tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL); -#ifdef I686_CPU if (i386_use_fxsave) tf->tf_eip += &sigcode_xmm - &sigcode; -#endif tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC); tf->tf_esp = (int)fp; tf->tf_ss = GSEL(GUDATA_SEL, SEL_UPL); @@ -2806,7 +2751,6 @@ IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), IDTVEC(syscall), IDTVEC(mchk), IDTVEC(osyscall), IDTVEC(simd); -#if defined(I586_CPU) extern int IDTVEC(f00f_redirect); int cpu_f00f_bug = 0; @@ -2842,7 +2786,6 @@ /* Tell the rest of the world */ cpu_f00f_bug = 1; } -#endif #ifdef MULTIPROCESSOR void Index: i386/pmap.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/i386/pmap.c,v retrieving revision 1.120 diff -u -u -r1.120 pmap.c --- i386/pmap.c 16 Nov 2007 16:16:06 -0000 1.120 +++ i386/pmap.c 28 Nov 2007 15:46:40 -0000 @@ -313,10 +313,8 @@ static caddr_t csrcp, cdstp, zerop, ptpp; caddr_t vmmap; /* XXX: used by mem.c... it should really uvm_map_reserve it */ -#if defined(I586_CPU) /* stuff to fix the pentium f00f bug */ extern vaddr_t pentium_idt_vaddr; -#endif /* Index: i386/procfs_machdep.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/i386/procfs_machdep.c,v retrieving revision 1.6 diff -u -u -r1.6 procfs_machdep.c --- i386/procfs_machdep.c 20 Dec 2006 17:50:40 -0000 1.6 +++ i386/procfs_machdep.c 28 Nov 2007 15:46:40 -0000 @@ -123,12 +123,10 @@ if (left <= 0) return 0; -#if defined(I586_CPU) || defined(I686_CPU) if (cpuspeed != 0) l = snprintf(p, left, "cpu MHz\t\t: %d\n", cpuspeed); else -#endif l = snprintf(p, left, "cpu MHz\t\t: unknown\n"); if (l == -1) Index: i386/via.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/i386/via.c,v retrieving revision 1.16 diff -u -u -r1.16 via.c --- i386/via.c 14 Nov 2007 19:10:44 -0000 1.16 +++ i386/via.c 28 Nov 2007 15:46:40 -0000 @@ -508,7 +508,6 @@ #endif /* CRYPTO */ -#if defined(I686_CPU) /* * Note, the VIA C3 Nehemiah provides 4 internal 8-byte buffers, which * store random data, and can be accessed a lot quicker than waiting @@ -567,5 +566,3 @@ timeout_add(tmo, (hz > 100) ? (hz / 100) : 1); } - -#endif /* defined(I686_CPU) */ Index: include/cpu.h ================================================== ================= RCS file: /cvs/src/sys/arch/i386/include/cpu.h,v retrieving revision 1.98 diff -u -u -r1.98 cpu.h --- include/cpu.h 16 Nov 2007 16:16:06 -0000 1.98 +++ include/cpu.h 28 Nov 2007 15:46:40 -0000 @@ -263,12 +263,10 @@ #define DELAY(x) (*delay_func)(x) #define delay(x) (*delay_func)(x) -#if defined(I586_CPU) || defined(I686_CPU) /* * High resolution clock support (Pentium only) */ void calibrate_cyclecounter(void); -#endif /* * pull in #defines for kinds of processors @@ -326,9 +324,7 @@ /* apm.c */ extern int cpu_apmwarn; -#if defined(I586_CPU) || defined(I686_CPU) extern int cpuspeed; -#endif #if !defined(SMALL_KERNEL) #define BUS66 6667 @@ -341,11 +337,9 @@ extern int bus_clock; #endif -#ifdef I586_CPU /* F00F bug fix stuff for pentium cpu */ extern int cpu_f00f_bug; void fix_f00f(void); -#endif /* dkcsum.c */ void dkcsumattach(void); @@ -383,30 +377,19 @@ void i8254_inittimecounter_simple(void); +#if !defined(SMALL_KERNEL) /* est.c */ -#if !defined(SMALL_KERNEL) && defined(I686_CPU) void est_init(const char *, int); void est_setperf(int); -#endif - /* longrun.c */ -#if !defined(SMALL_KERNEL) && defined(I586_CPU) void longrun_init(void); void longrun_setperf(int); -#endif - /* p4tcc.c */ -#if !defined(SMALL_KERNEL) && defined(I686_CPU) void p4tcc_init(int, int); void p4tcc_setperf(int); -#endif - -#if !defined(SMALL_KERNEL) && defined(I586_CPU) /* powernow.c */ void k6_powernow_init(void); void k6_powernow_setperf(int); -#endif -#if !defined(SMALL_KERNEL) && defined(I686_CPU) /* powernow-k7.c */ void k7_powernow_init(void); void k7_powernow_setperf(int); Index: include/cpufunc.h ================================================== ================= RCS file: /cvs/src/sys/arch/i386/include/cpufunc.h,v retrieving revision 1.13 diff -u -u -r1.13 cpufunc.h --- include/cpufunc.h 17 Feb 2007 17:38:37 -0000 1.13 +++ include/cpufunc.h 28 Nov 2007 15:46:40 -0000 @@ -172,13 +172,11 @@ * pre-P6-family processors. */ -#if defined(I686_CPU) if (cpu_feature & CPUID_PGE) { u_int cr4 = rcr4(); lcr4(cr4 & ~CR4_PGE); lcr4(cr4); } else -#endif tlbflush(); } @@ -271,9 +269,7 @@ __asm __volatile("int $3"); } -#ifdef I686_CPU void amd64_errata(struct cpu_info *); -#endif #endif /* _KERNEL */ #endif /* !_I386_CPUFUNC_H_ */ Index: isa/clock.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/isa/clock.c,v retrieving revision 1.40 diff -u -u -r1.40 clock.c --- isa/clock.c 1 Aug 2007 13:18:18 -0000 1.40 +++ isa/clock.c 28 Nov 2007 15:46:41 -0000 @@ -119,12 +119,8 @@ u_int mc146818_read(void *, u_int); void mc146818_write(void *, u_int, u_int); -#if defined(I586_CPU) || defined(I686_CPU) int cpuspeed; -#endif -#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU) int clock_broken_latch; -#endif /* Timecounter on the i8254 */ uint32_t i8254_lastcount; @@ -254,7 +250,6 @@ gettick(void) { -#if defined(I586_CPU) || defined(I686_CPU) if (clock_broken_latch) { int v1, v2, v3; int w1, w2, w3; @@ -306,9 +301,7 @@ return (v2); } return (v3); - } else -#endif - { + } else { u_char lo, hi; u_long ef; @@ -385,7 +378,6 @@ } } -#if defined(I586_CPU) || defined(I686_CPU) void calibrate_cyclecounter(void) { @@ -396,7 +388,6 @@ __asm __volatile("rdtsc" : "=A" (count)); cpuspeed = ((count - last_count) + 999999) / 1000000; } -#endif void i8254_initclocks(void) Index: isa/npx.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/isa/npx.c,v retrieving revision 1.42 diff -u -u -r1.42 npx.c --- isa/npx.c 18 Oct 2006 19:48:32 -0000 1.42 +++ isa/npx.c 28 Nov 2007 15:46:41 -0000 @@ -134,22 +134,18 @@ extern int i386_fpu_exception; extern int i386_fpu_fdivbug; -#ifdef I686_CPU #define fxsave(addr) __asm("fxsave %0" : "=m" (*addr)) #define fxrstor(addr) __asm("fxrstor %0" : : "m" (*addr)) -#endif /* I686_CPU */ static __inline void fpu_save(union savefpu *addr) { -#ifdef I686_CPU if (i386_use_fxsave) { fxsave(&addr->sv_xmm); /* FXSAVE doesn't FNINIT like FNSAVE does -- so do it here. */ fninit(); } else -#endif /* I686_CPU */ fnsave(&addr->sv_87); } @@ -161,9 +157,7 @@ int (*npxdna_func)(struct cpu_info *) = npxdna_notset; int npxdna_s87(struct cpu_info *); -#ifdef I686_CPU int npxdna_xmm(struct cpu_info *); -#endif /* I686_CPU */ void npxexit(void); /* @@ -393,11 +387,9 @@ npxinit(&cpu_info_primary); i386_fpu_present = 1; -#ifdef I686_CPU if (i386_use_fxsave) npxdna_func = npxdna_xmm; else -#endif /* I686_CPU */ npxdna_func = npxdna_s87; } @@ -577,7 +569,6 @@ * XXX It is unclear if the code below is correct in the multiprocessor * XXX case. Check the NetBSD sources once again to be sure. */ -#ifdef I686_CPU int npxdna_xmm(struct cpu_info *ci) { @@ -654,7 +645,6 @@ return (1); } -#endif /* I686_CPU */ int npxdna_s87(struct cpu_info *ci) Index: pci/elan520.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/pci/elan520.c,v retrieving revision 1.13 diff -u -u -r1.13 elan520.c --- pci/elan520.c 23 May 2007 11:55:11 -0000 1.13 +++ pci/elan520.c 28 Nov 2007 15:46:41 -0000 @@ -327,16 +327,12 @@ void elansc_update_cpuspeed(void) { -#ifdef I586_CPU static const int elansc_mhz[] = { 0, 100, 133, 999 }; -#endif uint8_t cpuctl; cpuctl = bus_space_read_1(elansc->sc_memt, elansc->sc_memh, MMCR_CPUCTL); -#ifdef I586_CPU cpuspeed = elansc_mhz[cpuctl & CPUCTL_CPU_CLK_SPD_MASK]; -#endif } void Index: pci/ichpcib.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/pci/ichpcib.c,v retrieving revision 1.21 diff -u -u -r1.21 ichpcib.c --- pci/ichpcib.c 17 Oct 2007 22:13:56 -0000 1.21 +++ pci/ichpcib.c 28 Nov 2007 15:46:41 -0000 @@ -294,10 +294,8 @@ bus_space_write_1(sc->sc_pm_iot, sc->sc_pm_ioh, ICH_PM_CNTL, cntl); -#ifdef I686_CPU if (update_cpuspeed != NULL) update_cpuspeed(); -#endif } splx(s); } Index: pci/piixpcib.c ================================================== ================= RCS file: /cvs/src/sys/arch/i386/pci/piixpcib.c,v retrieving revision 1.2 diff -u -u -r1.2 piixpcib.c --- pci/piixpcib.c 29 May 2007 02:40:24 -0000 1.2 +++ pci/piixpcib.c 28 Nov 2007 15:46:41 -0000 @@ -116,7 +116,7 @@ extern void pcibattach(struct device *, struct device *, void *); /* arch/i386/i386/machdep.c */ -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) extern void p3_update_cpuspeed(void); #endif @@ -365,7 +365,7 @@ * There seems to be no reliable fix for this. */ delay(200); -#if !defined(SMALL_KERNEL) && defined(I686_CPU) +#if !defined(SMALL_KERNEL) p3_update_cpuspeed(); #endif } |