From: Jonathan Gray Subject: unused kernel globals To: tech@openbsd.org Date: Sun, 28 Apr 2024 23:17:54 +1000 remove some unused kernel global vars diff --git sys/arch/amd64/amd64/machdep.c sys/arch/amd64/amd64/machdep.c index 7bf57a406cd..d256767d24c 100644 --- sys/arch/amd64/amd64/machdep.c +++ sys/arch/amd64/amd64/machdep.c @@ -178,10 +178,7 @@ int biosbasemem = 0; /* base memory reported by BIOS */ u_int bootapiver = 0; /* /boot API version */ int physmem; -u_int64_t dumpmem_low; -u_int64_t dumpmem_high; extern int boothowto; -int cpu_class; paddr_t dumpmem_paddr; vaddr_t dumpmem_vaddr; diff --git sys/arch/i386/i386/machdep.c sys/arch/i386/i386/machdep.c index 2599def386c..919c9b3f7af 100644 --- sys/arch/i386/i386/machdep.c +++ sys/arch/i386/i386/machdep.c @@ -191,9 +191,6 @@ int dumpsize = 0; /* pages */ long dumplo = 0; /* blocks */ int cpu_class; -int i386_fpu_present; -int i386_fpu_exception; -int i386_fpu_fdivbug; int i386_use_fxsave; int i386_has_sse; @@ -207,7 +204,6 @@ struct vm_map *exec_map = NULL; struct vm_map *phys_map = NULL; #if !defined(SMALL_KERNEL) -int p4_model; int p3_early; void (*update_cpuspeed)(void) = NULL; void via_update_sensor(void *args); @@ -1547,7 +1543,6 @@ intel686_p4_cpu_setup(struct cpu_info *ci) intel686_common_cpu_setup(ci); #if !defined(SMALL_KERNEL) - p4_model = (ci->ci_signature >> 4) & 15; update_cpuspeed = p4_update_cpuspeed; #endif } diff --git sys/arch/i386/isa/npx.c sys/arch/i386/isa/npx.c index 5e354d5d625..fae282d5496 100644 --- sys/arch/i386/isa/npx.c +++ sys/arch/i386/isa/npx.c @@ -132,10 +132,6 @@ static volatile u_int npx_intrs_while_probing static volatile u_int npx_traps_while_probing __attribute__((section(".kudata"))); -extern int i386_fpu_present; -extern int i386_fpu_exception; -extern int i386_fpu_fdivbug; - #define fxsave(addr) __asm("fxsave %0" : "=m" (*addr)) #define fxrstor(addr) __asm("fxrstor %0" : : "m" (*addr)) #define ldmxcsr(addr) __asm("ldmxcsr %0" : : "m" (*addr)) @@ -235,7 +231,6 @@ npxprobe1(struct isa_attach_args *ia) */ npx_type = NPX_EXCEPTION; ia->ia_irq = IRQUNK; /* zap the interrupt */ - i386_fpu_exception = 1; } else if (npx_intrs_while_probing != 0) { /* * Bad, we are stuck with IRQ13. @@ -278,7 +273,6 @@ npxprobe(struct device *parent, void *match, void *aux) if (cpu_feature & CPUID_FPU) { npx_type = NPX_CPUID; - i386_fpu_exception = 1; ia->ia_irq = IRQUNK; /* Don't want the interrupt vector */ ia->ia_iosize = 16; ia->ia_msize = 0; @@ -348,7 +342,6 @@ npxinit(struct cpu_info *ci) lcr0(rcr0() & ~(CR0_EM|CR0_TS)); fninit(); if (npx586bug1(4195835, 3145727) != 0) { - i386_fpu_fdivbug = 1; printf("%s: WARNING: Pentium FDIV bug detected!\n", ci->ci_dev->dv_xname); } @@ -397,7 +390,6 @@ npxattach(struct device *parent, struct device *self, void *aux) } npxinit(&cpu_info_primary); - i386_fpu_present = 1; if (i386_use_fxsave) npxdna_func = npxdna_xmm; diff --git sys/arch/i386/pci/pcibios.c sys/arch/i386/pci/pcibios.c index 36f19fbfd31..ab2337187f4 100644 --- sys/arch/i386/pci/pcibios.c +++ sys/arch/i386/pci/pcibios.c @@ -101,7 +101,6 @@ #include int pcibios_flags; -int pcibios_present; struct pcibios_pir_header pcibios_pir_header; struct pcibios_intr_routing *pcibios_pir_table; @@ -187,8 +186,6 @@ pcibiosattach(struct device *parent, struct device *self, void *aux) */ pci_mode = mech1 ? 1 : 2; - pcibios_present = 1; - /* * Find the PCI IRQ Routing table. */ diff --git sys/dev/ic/ac97.c sys/dev/ic/ac97.c index 89b82a9fee5..c56d016c799 100644 --- sys/dev/ic/ac97.c +++ sys/dev/ic/ac97.c @@ -69,17 +69,6 @@ #include #include - -/* default parameters; supported by all ac97 codecs */ -const struct audio_params ac97_audio_default = { - 48000, /* sample_rate */ - AUDIO_ENCODING_SLINEAR_LE, /* encoding */ - 16, /* precision */ - 2, /* bps */ - 1, /* msb */ - 2 /* channels */ -}; - const struct audio_mixer_enum ac97_on_off = { 2, { { { AudioNoff } , 0 }, diff --git sys/netmpls/mpls_raw.c sys/netmpls/mpls_raw.c index 8aaaf757cde..d0785e95377 100644 --- sys/netmpls/mpls_raw.c +++ sys/netmpls/mpls_raw.c @@ -45,8 +45,6 @@ #include int mpls_defttl = 255; -int mpls_push_expnull_ip = 0; -int mpls_push_expnull_ip6 = 0; int mpls_mapttl_ip = 1; int mpls_mapttl_ip6 = 0;