Module Name: src Committed By: msaitoh Date: Thu Oct 7 12:52:27 UTC 2021
Modified Files: src/sys/arch/x86/x86: bus_dma.c bus_space.c consinit.c coretemp.c cpu.c cpu_rng.c db_memrw.c efi.c errata.c est.c identcpu.c intel_busclock.c intr.c ioapic.c lapic.c linux_trap.c mp.c mpacpi.c mpbios.c mtrr_i686.c multiboot2.c pmap.c powernow.c procfs_machdep.c spectre.c svs.c sys_machdep.c syscall.c viac7temp.c x86_autoconf.c x86_ipmi.c x86_machdep.c x86_tlb.c Log Message: KNF. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/sys/arch/x86/x86/bus_dma.c cvs rdiff -u -r1.45 -r1.46 src/sys/arch/x86/x86/bus_space.c cvs rdiff -u -r1.33 -r1.34 src/sys/arch/x86/x86/consinit.c cvs rdiff -u -r1.37 -r1.38 src/sys/arch/x86/x86/coretemp.c cvs rdiff -u -r1.201 -r1.202 src/sys/arch/x86/x86/cpu.c cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/cpu_rng.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/db_memrw.c \ src/sys/arch/x86/x86/linux_trap.c src/sys/arch/x86/x86/powernow.c cvs rdiff -u -r1.21 -r1.22 src/sys/arch/x86/x86/efi.c cvs rdiff -u -r1.26 -r1.27 src/sys/arch/x86/x86/errata.c cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x86/x86/est.c cvs rdiff -u -r1.121 -r1.122 src/sys/arch/x86/x86/identcpu.c cvs rdiff -u -r1.24 -r1.25 src/sys/arch/x86/x86/intel_busclock.c cvs rdiff -u -r1.155 -r1.156 src/sys/arch/x86/x86/intr.c cvs rdiff -u -r1.64 -r1.65 src/sys/arch/x86/x86/ioapic.c cvs rdiff -u -r1.85 -r1.86 src/sys/arch/x86/x86/lapic.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/x86/mp.c cvs rdiff -u -r1.107 -r1.108 src/sys/arch/x86/x86/mpacpi.c cvs rdiff -u -r1.70 -r1.71 src/sys/arch/x86/x86/mpbios.c cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x86/x86/mtrr_i686.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/x86/multiboot2.c cvs rdiff -u -r1.411 -r1.412 src/sys/arch/x86/x86/pmap.c cvs rdiff -u -r1.41 -r1.42 src/sys/arch/x86/x86/procfs_machdep.c cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x86/x86/spectre.c cvs rdiff -u -r1.39 -r1.40 src/sys/arch/x86/x86/svs.c cvs rdiff -u -r1.56 -r1.57 src/sys/arch/x86/x86/sys_machdep.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x86/x86/syscall.c \ src/sys/arch/x86/x86/x86_tlb.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/x86/viac7temp.c cvs rdiff -u -r1.84 -r1.85 src/sys/arch/x86/x86/x86_autoconf.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/x86/x86_ipmi.c cvs rdiff -u -r1.148 -r1.149 src/sys/arch/x86/x86/x86_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/bus_dma.c diff -u src/sys/arch/x86/x86/bus_dma.c:1.82 src/sys/arch/x86/x86/bus_dma.c:1.83 --- src/sys/arch/x86/x86/bus_dma.c:1.82 Sat Mar 14 18:08:38 2020 +++ src/sys/arch/x86/x86/bus_dma.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.82 2020/03/14 18:08:38 ad Exp $ */ +/* $NetBSD: bus_dma.c,v 1.83 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2007, 2020 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.82 2020/03/14 18:08:38 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.83 2021/10/07 12:52:27 msaitoh Exp $"); /* * The following is included because _bus_dma_uiomove is derived from @@ -212,8 +212,8 @@ _bus_dmamem_alloc_range(bus_dma_tag_t t, * Allocate pages from the VM system. * We accept boundaries < size, splitting in multiple segments * if needed. uvm_pglistalloc does not, so compute an appropriate - * boundary: next power of 2 >= size - */ + * boundary: next power of 2 >= size + */ if (boundary == 0) uboundary = 0; @@ -1172,8 +1172,8 @@ _bus_dmamem_unmap(bus_dma_tag_t t, void eva = sva + size; /* - * mark pages cacheable again. - */ + * mark pages cacheable again. + */ for (va = sva; va < eva; va += PAGE_SIZE) { pte = kvtopte(va); opte = *pte; Index: src/sys/arch/x86/x86/bus_space.c diff -u src/sys/arch/x86/x86/bus_space.c:1.45 src/sys/arch/x86/x86/bus_space.c:1.46 --- src/sys/arch/x86/x86/bus_space.c:1.45 Sat Apr 25 15:26:18 2020 +++ src/sys/arch/x86/x86/bus_space.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space.c,v 1.45 2020/04/25 15:26:18 bouyer Exp $ */ +/* $NetBSD: bus_space.c,v 1.46 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.45 2020/04/25 15:26:18 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.46 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -57,7 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: bus_space.c, * could lead to performance improvements, and help catch problems * with drivers that would creep up on other architectures. */ -#ifdef BUS_SPACE_DEBUG +#ifdef BUS_SPACE_DEBUG #define BUS_SPACE_ALIGNED_ADDRESS(p, t) \ ((((u_long)(p)) & (sizeof(t)-1)) == 0) Index: src/sys/arch/x86/x86/consinit.c diff -u src/sys/arch/x86/x86/consinit.c:1.33 src/sys/arch/x86/x86/consinit.c:1.34 --- src/sys/arch/x86/x86/consinit.c:1.33 Sat May 2 16:44:36 2020 +++ src/sys/arch/x86/x86/consinit.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: consinit.c,v 1.33 2020/05/02 16:44:36 bouyer Exp $ */ +/* $NetBSD: consinit.c,v 1.34 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 1998 @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.33 2020/05/02 16:44:36 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.34 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_kgdb.h" #include "opt_puc.h" @@ -277,7 +277,7 @@ void kgdb_port_init(void) { #if (NCOM > 0) - if(!strcmp(kgdb_devname, "com")) { + if (!strcmp(kgdb_devname, "com")) { com_kgdb_attach(x86_bus_space_io, comkgdbaddr, comkgdbrate, COM_FREQ, COM_TYPE_NORMAL, comkgdbmode); } Index: src/sys/arch/x86/x86/coretemp.c diff -u src/sys/arch/x86/x86/coretemp.c:1.37 src/sys/arch/x86/x86/coretemp.c:1.38 --- src/sys/arch/x86/x86/coretemp.c:1.37 Fri Mar 27 09:47:03 2020 +++ src/sys/arch/x86/x86/coretemp.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: coretemp.c,v 1.37 2020/03/27 09:47:03 msaitoh Exp $ */ +/* $NetBSD: coretemp.c,v 1.38 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.37 2020/03/27 09:47:03 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.38 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -334,7 +334,7 @@ coretemp_refresh(struct sysmon_envsys *s static void coretemp_refresh_xcall(void *arg0, void *arg1) { - struct coretemp_softc *sc = arg0; + struct coretemp_softc *sc = arg0; envsys_data_t *edata = arg1; uint64_t msr; Index: src/sys/arch/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.201 src/sys/arch/x86/x86/cpu.c:1.202 --- src/sys/arch/x86/x86/cpu.c:1.201 Sat Aug 7 16:19:08 2021 +++ src/sys/arch/x86/x86/cpu.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.201 2021/08/07 16:19:08 thorpej Exp $ */ +/* $NetBSD: cpu.c,v 1.202 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 2000-2020 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.201 2021/08/07 16:19:08 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.202 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -1341,7 +1341,7 @@ cpu_get_tsc_freq(struct cpu_info *ci) #endif if (freq == 0) { /* - * Work out the approximate overhead involved below. + * Work out the approximate overhead involved below. * Discard the result of the first go around the * loop. */ Index: src/sys/arch/x86/x86/cpu_rng.c diff -u src/sys/arch/x86/x86/cpu_rng.c:1.19 src/sys/arch/x86/x86/cpu_rng.c:1.20 --- src/sys/arch/x86/x86/cpu_rng.c:1.19 Thu Jul 30 17:26:23 2020 +++ src/sys/arch/x86/x86/cpu_rng.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_rng.c,v 1.19 2020/07/30 17:26:23 riastradh Exp $ */ +/* $NetBSD: cpu_rng.c,v 1.20 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -154,7 +154,7 @@ cpu_rng_rdseed(uint64_t *out) uint32_t lo, hi; __asm __volatile("rdseed %0; setc %1" : "=r"(lo), "=qm"(rndsts)); - if (rndsts != 1) + if (rndsts != 1) return 0; __asm __volatile("rdseed %0; setc %1" : "=r"(hi), "=qm"(rndsts)); if (rndsts != 1) Index: src/sys/arch/x86/x86/db_memrw.c diff -u src/sys/arch/x86/x86/db_memrw.c:1.11 src/sys/arch/x86/x86/db_memrw.c:1.12 --- src/sys/arch/x86/x86/db_memrw.c:1.11 Sun Apr 21 06:37:21 2019 +++ src/sys/arch/x86/x86/db_memrw.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: db_memrw.c,v 1.11 2019/04/21 06:37:21 maxv Exp $ */ +/* $NetBSD: db_memrw.c,v 1.12 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc. @@ -48,12 +48,12 @@ * Jason R. Thorpe <thor...@zembu.com>. * * Basic copy to amd64 by fvdl. - * + * * i386 and amd64 merge by jym. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.11 2019/04/21 06:37:21 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.12 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/proc.h> Index: src/sys/arch/x86/x86/linux_trap.c diff -u src/sys/arch/x86/x86/linux_trap.c:1.11 src/sys/arch/x86/x86/linux_trap.c:1.12 --- src/sys/arch/x86/x86/linux_trap.c:1.11 Sun Feb 19 21:06:35 2012 +++ src/sys/arch/x86/x86/linux_trap.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_trap.c,v 1.11 2012/02/19 21:06:35 rmind Exp $ */ +/* $NetBSD: linux_trap.c,v 1.12 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.11 2012/02/19 21:06:35 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.12 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -97,25 +97,25 @@ struct linux_user_desc { /* Note 255 is bogus */ static const int trapno_to_x86_vec[] = { - LINUX_T_INVALID_OP, /* 0 T_PRIVINFLT */ - LINUX_T_INT3, /* 1 T_BPTFLT */ - LINUX_T_COPROC_ERROR, /* 2 T_ARITHTRAP */ - LINUX_T_SPURIOUS_INTERRUPT, /* 3 T_ASTFLT XXX: ??? */ - LINUX_T_GENERAL_PROT_FAULT, /* 4 T_PROTFLT */ - LINUX_T_DEBUG, /* 5 T_TRCTRAP */ - LINUX_T_PAGE_FAULT, /* 6 T_PAGEFLT */ - LINUX_T_ALIGN_CHECK, /* 7 T_ALIGNFLT */ - LINUX_T_DIVIDE, /* 8 T_DIVIDE */ - LINUX_T_NMI, /* 9 T_NMI */ - LINUX_T_OVERFLOW, /* 10 T_OFLOW */ - LINUX_T_BOUNDS, /* 11 T_BOUND */ - LINUX_T_DEVICE_NOT_AVAIL, /* 12 T_DNA */ - LINUX_T_DOUBLE_FAULT, /* 13 T_DOUBLEFLT */ - LINUX_T_COPROC_SEG_OVERRUN, /* 14 T_FPOPFLT */ - LINUX_T_INVALID_TSS, /* 15 T_TSSFLT */ - LINUX_T_SEG_NOT_PRESENT, /* 16 T_SEGNPFLT */ - LINUX_T_STACK_SEG_FAULT, /* 17 T_STKFLT */ - LINUX_T_MACHINE_CHECK /* 18 T_RESERVED XXX: ??? */ + LINUX_T_INVALID_OP, /* 0 T_PRIVINFLT */ + LINUX_T_INT3, /* 1 T_BPTFLT */ + LINUX_T_COPROC_ERROR, /* 2 T_ARITHTRAP */ + LINUX_T_SPURIOUS_INTERRUPT, /* 3 T_ASTFLT XXX: ??? */ + LINUX_T_GENERAL_PROT_FAULT, /* 4 T_PROTFLT */ + LINUX_T_DEBUG, /* 5 T_TRCTRAP */ + LINUX_T_PAGE_FAULT, /* 6 T_PAGEFLT */ + LINUX_T_ALIGN_CHECK, /* 7 T_ALIGNFLT */ + LINUX_T_DIVIDE, /* 8 T_DIVIDE */ + LINUX_T_NMI, /* 9 T_NMI */ + LINUX_T_OVERFLOW, /* 10 T_OFLOW */ + LINUX_T_BOUNDS, /* 11 T_BOUND */ + LINUX_T_DEVICE_NOT_AVAIL, /* 12 T_DNA */ + LINUX_T_DOUBLE_FAULT, /* 13 T_DOUBLEFLT */ + LINUX_T_COPROC_SEG_OVERRUN, /* 14 T_FPOPFLT */ + LINUX_T_INVALID_TSS, /* 15 T_TSSFLT */ + LINUX_T_SEG_NOT_PRESENT, /* 16 T_SEGNPFLT */ + LINUX_T_STACK_SEG_FAULT, /* 17 T_STKFLT */ + LINUX_T_MACHINE_CHECK /* 18 T_RESERVED XXX: ??? */ }; /* For the nmi and reserved below linux does not post a signal. */ @@ -124,19 +124,19 @@ static const int linux_x86_vec_to_sig[] SIGTRAP, /* 1 LINUX_T_DEBUG */ /*nmi*/ SIGSEGV, /* 2 LINUX_T_NMI */ SIGTRAP, /* 3 LINUX_T_INT3 */ - SIGSEGV, /* 4 LINUX_T_OVERFLOW */ + SIGSEGV, /* 4 LINUX_T_OVERFLOW */ SIGSEGV, /* 5 LINUX_T_BOUNDS */ SIGILL, /* 6 LINUX_T_INVALIDOP */ SIGSEGV, /* 7 LINUX_T_DEVICE_NOT_AVAIL */ - SIGSEGV, /* 8 LINUX_T_DOUBLE_FAULT */ + SIGSEGV, /* 8 LINUX_T_DOUBLE_FAULT */ SIGFPE, /* 9 LINUX_T_COPROC_SEG_OVERRUN */ SIGSEGV, /* 10 LINUX_T_INVALID_TSS */ SIGBUS, /* 11 LINUX_T_SEG_NOT_PRESENT */ - SIGBUS, /* 12 LINUX_T_STACK_SEG_FAULT */ + SIGBUS, /* 12 LINUX_T_STACK_SEG_FAULT */ SIGSEGV, /* 13 LINUX_T_GENERAL_PROT_FAULT */ SIGSEGV, /* 14 LINUX_T_PAGE_FAULT */ /*resv*/SIGSEGV, /* 15 LINUX_T_SPURIOUS_INTERRUPT */ - SIGFPE, /* 16 LINUX_T_COPROC_ERROR */ + SIGFPE, /* 16 LINUX_T_COPROC_ERROR */ SIGSEGV, /* 17 LINUX_T_ALIGN_CHECK */ SIGSEGV /* 18 LINUX_T_MACHINE_CHECK */ }; @@ -158,7 +158,7 @@ linux_trapsignal(struct lwp *l, ksiginfo nksi = *ksi; nksi.ksi_trap = trapno_to_x86_vec[ksi->ksi_trap]; if (nksi.ksi_trap < __arraycount(linux_x86_vec_to_sig)) { - nksi.ksi_signo + nksi.ksi_signo = linux_x86_vec_to_sig[nksi.ksi_trap]; } else { uprintf("Unhandled sig type %d\n", Index: src/sys/arch/x86/x86/powernow.c diff -u src/sys/arch/x86/x86/powernow.c:1.11 src/sys/arch/x86/x86/powernow.c:1.12 --- src/sys/arch/x86/x86/powernow.c:1.11 Sun Oct 25 16:39:00 2020 +++ src/sys/arch/x86/x86/powernow.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: powernow.c,v 1.11 2020/10/25 16:39:00 nia Exp $ */ +/* $NetBSD: powernow.c,v 1.12 2021/10/07 12:52:27 msaitoh Exp $ */ /* $OpenBSD: powernow-k8.c,v 1.8 2006/06/16 05:58:50 gwk Exp $ */ /*- @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: powernow.c,v 1.11 2020/10/25 16:39:00 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: powernow.c,v 1.12 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -95,7 +95,7 @@ static struct powernow_k7_quirk { uint32_t rcpusig; /* Correct cpu signature */ uint32_t pcpusig; /* PST cpu signature */ } powernow_k7_quirk[] = { - { 0x680, 0x780 }, /* Reported by Olaf 'Rhialto' Seibert */ + { 0x680, 0x780 }, /* Reported by Olaf 'Rhialto' Seibert */ { 0x6a0, 0x781 }, /* Reported by Eric Schnoebelen */ { 0x6a0, 0x7a0 }, /* Reported by Nino Dehne */ { 0, 0 } @@ -493,7 +493,7 @@ powernow_k7_states(device_t self, unsign __func__, cpusig, pst->signature)); cpusig_ok = powernow_k7_check(cpusig, - pst->signature); + pst->signature); if ((cpusig_ok != false && (fid == pst->fid && vid == pst->vid))) { @@ -754,7 +754,7 @@ powernow_k8_states(device_t self, unsign p += sizeof(struct powernow_psb_s); - for(i = 0; i < psb->n_pst; ++i) { + for (i = 0; i < psb->n_pst; ++i) { pst = (struct powernow_pst_s *)p; Index: src/sys/arch/x86/x86/efi.c diff -u src/sys/arch/x86/x86/efi.c:1.21 src/sys/arch/x86/x86/efi.c:1.22 --- src/sys/arch/x86/x86/efi.c:1.21 Tue Dec 10 02:06:07 2019 +++ src/sys/arch/x86/x86/efi.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: efi.c,v 1.21 2019/12/10 02:06:07 manu Exp $ */ +/* $NetBSD: efi.c,v 1.22 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.21 2019/12/10 02:06:07 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.22 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/kmem.h> #include <sys/param.h> @@ -51,12 +51,12 @@ const struct uuid EFI_UUID_ACPI10 = EFI_ const struct uuid EFI_UUID_SMBIOS = EFI_TABLE_SMBIOS; const struct uuid EFI_UUID_SMBIOS3 = EFI_TABLE_SMBIOS3; -static vaddr_t efi_getva(paddr_t); -static void efi_relva(paddr_t, vaddr_t); +static vaddr_t efi_getva(paddr_t); +static void efi_relva(paddr_t, vaddr_t); struct efi_cfgtbl *efi_getcfgtblhead(void); -void efi_aprintcfgtbl(void); -void efi_aprintuuid(const struct uuid *); -bool efi_uuideq(const struct uuid *, const struct uuid *); +void efi_aprintcfgtbl(void); +void efi_aprintuuid(const struct uuid *); +bool efi_uuideq(const struct uuid *, const struct uuid *); static bool efi_is32x64 = false; static paddr_t efi_systbl_pa; @@ -77,8 +77,8 @@ efi_getva(paddr_t pa) vaddr_t va; int rv; - rv = _x86_memio_map(x86_bus_space_mem, pa, - PAGE_SIZE, 0, (bus_space_handle_t *)&va); + rv = _x86_memio_map(x86_bus_space_mem, pa, + PAGE_SIZE, 0, (bus_space_handle_t *)&va); if (rv != 0) { aprint_debug("efi: unable to allocate va\n"); return 0; @@ -405,7 +405,7 @@ efi_init(void) return; } bootmethod_efi = true; -#if NPCI > 0 +#if NPCI > 0 pci_mapreg_map_enable_decode = true; /* PR port-amd64/53286 */ #endif } Index: src/sys/arch/x86/x86/errata.c diff -u src/sys/arch/x86/x86/errata.c:1.26 src/sys/arch/x86/x86/errata.c:1.27 --- src/sys/arch/x86/x86/errata.c:1.26 Sat May 18 07:49:31 2019 +++ src/sys/arch/x86/x86/errata.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: errata.c,v 1.26 2019/05/18 07:49:31 maxv Exp $ */ +/* $NetBSD: errata.c,v 1.27 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: errata.c,v 1.26 2019/05/18 07:49:31 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: errata.c,v 1.27 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/types.h> #include <sys/systm.h> @@ -127,7 +127,7 @@ static const uint8_t x86_errata_set7[] = static const uint8_t x86_errata_set8[] = { BH_E4, CH_CG, CH_CG, CH_D0, CH_D0, DH_CG, DH_CG, DH_CG, DH_D0, DH_D0, DH_E3, DH_E3, DH_E6, DH_E6, JH_E1, JH_E6, - JH_E6, SH_B0, SH_B3, SH_C0, SH_C0, SH_CG, SH_CG, SH_CG, + JH_E6, SH_B0, SH_B3, SH_C0, SH_C0, SH_CG, SH_CG, SH_CG, SH_D0, SH_D0, SH_D0, SH_E4, SH_E4, SH_E5, OINK }; @@ -361,7 +361,7 @@ static errata_t errata[] = { }, }; -static bool +static bool x86_errata_testmsr(struct cpu_info *ci, errata_t *e) { uint64_t val; @@ -376,7 +376,7 @@ x86_errata_testmsr(struct cpu_info *ci, return TRUE; } -static bool +static bool x86_errata_setmsr(struct cpu_info *ci, errata_t *e) { uint64_t val; Index: src/sys/arch/x86/x86/est.c diff -u src/sys/arch/x86/x86/est.c:1.32 src/sys/arch/x86/x86/est.c:1.33 --- src/sys/arch/x86/x86/est.c:1.32 Sun Oct 25 16:39:00 2020 +++ src/sys/arch/x86/x86/est.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: est.c,v 1.32 2020/10/25 16:39:00 nia Exp $ */ +/* $NetBSD: est.c,v 1.33 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 2003 Michael Eriksson. * All rights reserved. @@ -76,7 +76,7 @@ * http://www.codemonkey.org.uk/projects/cpufreq/cpufreq-2.4.22-pre6-1.gz */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: est.c,v 1.32 2020/10/25 16:39:00 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: est.c,v 1.33 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -1206,10 +1206,10 @@ est_tables(device_t self) aprint_normal_dev(self, "cur = 0x%x\n", cur); #endif - /* - * Generate a fake table with the power states we know, + /* + * Generate a fake table with the power states we know, * interpolating the voltages and frequencies between the - * high and low values. The (milli)voltages are always + * high and low values. The (milli)voltages are always * rounded up when computing the table. */ minfreq = MSR2FREQINC(idlo); Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.121 src/sys/arch/x86/x86/identcpu.c:1.122 --- src/sys/arch/x86/x86/identcpu.c:1.121 Mon Apr 12 02:23:01 2021 +++ src/sys/arch/x86/x86/identcpu.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.121 2021/04/12 02:23:01 mrg Exp $ */ +/* $NetBSD: identcpu.c,v 1.122 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.121 2021/04/12 02:23:01 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.122 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_xen.h" @@ -548,7 +548,7 @@ cpu_probe_c3(struct cpu_info *ci) if (cpu_vendor != CPUVENDOR_IDT || CPUID_TO_FAMILY(ci->ci_signature) < 6) - return; + return; family = CPUID_TO_FAMILY(ci->ci_signature); model = CPUID_TO_MODEL(ci->ci_signature); @@ -586,7 +586,7 @@ cpu_probe_c3(struct cpu_info *ci) ci->ci_feat_val[4] = lfunc; /* Check for and enable RNG */ if (lfunc & CPUID_VIA_HAS_RNG) { - if (!(lfunc & CPUID_VIA_DO_RNG)) { + if (!(lfunc & CPUID_VIA_DO_RNG)) { rng_enable++; ci->ci_feat_val[4] |= CPUID_VIA_DO_RNG; } @@ -1135,7 +1135,7 @@ identify_hypervisor(void) const char *p; int i; - switch(vm_guest) { + switch (vm_guest) { case VM_GUEST_XENPV: case VM_GUEST_XENPVH: /* guest type already known, no bios info */ Index: src/sys/arch/x86/x86/intel_busclock.c diff -u src/sys/arch/x86/x86/intel_busclock.c:1.24 src/sys/arch/x86/x86/intel_busclock.c:1.25 --- src/sys/arch/x86/x86/intel_busclock.c:1.24 Thu Jul 2 05:11:50 2015 +++ src/sys/arch/x86/x86/intel_busclock.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_busclock.c,v 1.24 2015/07/02 05:11:50 msaitoh Exp $ */ +/* $NetBSD: intel_busclock.c,v 1.25 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.24 2015/07/02 05:11:50 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.25 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -95,7 +95,7 @@ p3_get_bus_clock(struct cpu_info *ci) uint32_t model; model = CPUID_TO_MODEL(ci->ci_signature); - + switch (model) { case 0x9: /* Pentium M (130 nm, Banias) */ bus_clock = 10000; Index: src/sys/arch/x86/x86/intr.c diff -u src/sys/arch/x86/x86/intr.c:1.155 src/sys/arch/x86/x86/intr.c:1.156 --- src/sys/arch/x86/x86/intr.c:1.155 Mon Aug 9 21:20:50 2021 +++ src/sys/arch/x86/x86/intr.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.155 2021/08/09 21:20:50 andvar Exp $ */ +/* $NetBSD: intr.c,v 1.156 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.155 2021/08/09 21:20:50 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.156 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_intrdebug.h" #include "opt_multiprocessor.h" @@ -458,7 +458,7 @@ intr_allocate_slot_cpu(struct cpu_info * start = NUM_LEGACY_IRQS; /* don't step over Xen's slots */ if (vm_guest == VM_GUEST_XENPVH) - max = SIR_XENIPL_VM; + max = SIR_XENIPL_VM; /* * intr_allocate_slot has checked for an existing mapping. * Now look for a free slot. @@ -555,7 +555,7 @@ intr_allocate_slot(struct pic *pic, int #if 0 if (ci == NULL || ci->ci_nintrhand > lci->ci_nintrhand) { - ci = lci; + ci = lci; } #else ci = &cpu_info_primary; @@ -938,7 +938,7 @@ intr_establish_xname(int legacy_irq, str pic->pic_name, type == IST_EDGE ? "edge" : "level", pin, level, device_xname(ci->ci_dev), slot, idt_vec); - return (ih); + return ih; } void * @@ -1904,7 +1904,8 @@ intr_set_affinity(struct intrsource *isp if (new_idtvec == 0) return EBUSY; DPRINTF(("interrupt from cpu%d vec %d to cpu%d vec %d\n", - cpu_index(oldci), old_idtvec, cpu_index(newci), new_idtvec)); + cpu_index(oldci), old_idtvec, cpu_index(newci), + new_idtvec)); } else { new_idtvec = isp->is_idtvec; } @@ -2104,7 +2105,7 @@ interrupt_get_assigned(const char *intri mutex_enter(&cpu_lock); isp = intr_get_io_intrsource(intrid); - if (isp != NULL) + if (isp != NULL) isp->is_pic->pic_intr_get_assigned(intrid, cpuset); mutex_exit(&cpu_lock); } Index: src/sys/arch/x86/x86/ioapic.c diff -u src/sys/arch/x86/x86/ioapic.c:1.64 src/sys/arch/x86/x86/ioapic.c:1.65 --- src/sys/arch/x86/x86/ioapic.c:1.64 Sat Apr 25 15:26:18 2020 +++ src/sys/arch/x86/x86/ioapic.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ioapic.c,v 1.64 2020/04/25 15:26:18 bouyer Exp $ */ +/* $NetBSD: ioapic.c,v 1.65 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.64 2020/04/25 15:26:18 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.65 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_ddb.h" @@ -112,8 +112,8 @@ bool ioapic_trymask(struct pic *, int); static void ioapic_addroute(struct pic *, struct cpu_info *, int, int, int); static void ioapic_delroute(struct pic *, struct cpu_info *, int, int, int); -struct ioapic_softc *ioapics; /* head of linked list */ -int nioapics = 0; /* number attached */ +struct ioapic_softc *ioapics; /* head of linked list */ +int nioapics = 0; /* number attached */ static int ioapic_vecbase; static inline u_long @@ -422,7 +422,7 @@ apic_set_redir(struct ioapic_softc *sc, if (delmode == IOAPIC_REDLO_DEL_FIXED || delmode == IOAPIC_REDLO_DEL_LOPRI) { - if (pp->ip_type == IST_NONE) { + if (pp->ip_type == IST_NONE) { redlo |= IOAPIC_REDLO_MASK; } else { redhi = (ci->ci_cpuid << IOAPIC_REDHI_DEST_SHIFT); Index: src/sys/arch/x86/x86/lapic.c diff -u src/sys/arch/x86/x86/lapic.c:1.85 src/sys/arch/x86/x86/lapic.c:1.86 --- src/sys/arch/x86/x86/lapic.c:1.85 Tue Oct 27 08:57:11 2020 +++ src/sys/arch/x86/x86/lapic.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lapic.c,v 1.85 2020/10/27 08:57:11 ryo Exp $ */ +/* $NetBSD: lapic.c,v 1.86 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2000, 2008, 2020 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.85 2020/10/27 08:57:11 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.86 2021/10/07 12:52:27 msaitoh Exp $"); #include "acpica.h" #include "ioapic.h" @@ -98,8 +98,8 @@ void lapic_clockintr(void *, struct int static void lapic_delay(unsigned int); static uint32_t lapic_gettick(void); -static void lapic_setup_bsp(paddr_t); -static void lapic_map(paddr_t); +static void lapic_setup_bsp(paddr_t); +static void lapic_map(paddr_t); static void lapic_hwmask(struct pic *, int); static void lapic_hwunmask(struct pic *, int); @@ -889,7 +889,7 @@ i82489_ipi(int vec, int target, int dl) result = (i82489_readreg(LAPIC_ICRLO) & LAPIC_DLSTAT_BUSY) ? EBUSY : 0; #else /* Don't wait - if it doesn't go, we're in big trouble anyway. */ - result = 0; + result = 0; #endif splx(s); Index: src/sys/arch/x86/x86/mp.c diff -u src/sys/arch/x86/x86/mp.c:1.6 src/sys/arch/x86/x86/mp.c:1.7 --- src/sys/arch/x86/x86/mp.c:1.6 Sat Aug 7 16:19:08 2021 +++ src/sys/arch/x86/x86/mp.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mp.c,v 1.6 2021/08/07 16:19:08 thorpej Exp $ */ +/* $NetBSD: mp.c,v 1.7 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mp.c,v 1.6 2021/08/07 16:19:08 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mp.c,v 1.7 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_multiprocessor.h" #include "opt_acpi.h" @@ -81,7 +81,7 @@ static int intr_find_pcibridge(int, pcit #if NPCI > 0 int mp_pci_scan(device_t self, struct pcibus_attach_args *pba, - cfprint_t print) + cfprint_t print) { int i, cnt; struct mp_bus *mpb; Index: src/sys/arch/x86/x86/mpacpi.c diff -u src/sys/arch/x86/x86/mpacpi.c:1.107 src/sys/arch/x86/x86/mpacpi.c:1.108 --- src/sys/arch/x86/x86/mpacpi.c:1.107 Sat Aug 7 16:19:08 2021 +++ src/sys/arch/x86/x86/mpacpi.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mpacpi.c,v 1.107 2021/08/07 16:19:08 thorpej Exp $ */ +/* $NetBSD: mpacpi.c,v 1.108 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.107 2021/08/07 16:19:08 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.108 2021/10/07 12:52:27 msaitoh Exp $"); #include "acpica.h" #include "opt_acpi.h" @@ -152,7 +152,7 @@ mpacpi_cpuprint(void *aux, const char *p if (pnp) aprint_normal("cpu at %s", pnp); aprint_normal(" apid %d", caa->cpu_number); - return (UNCONF); + return UNCONF; } static int @@ -163,7 +163,7 @@ mpacpi_ioapicprint(void *aux, const char if (pnp) aprint_normal("ioapic at %s", pnp); aprint_normal(" apid %d", aaa->apic_id); - return (UNCONF); + return UNCONF; } /* @@ -564,7 +564,7 @@ static int mpacpi_pciroute(struct mpacpi_pcibus *mpr) { ACPI_PCI_ROUTING_TABLE *ptrp; - ACPI_HANDLE linkdev; + ACPI_HANDLE linkdev; char *p; struct mp_intr_map *mpi, *iter; struct mp_bus *mpb; @@ -890,7 +890,7 @@ mpacpi_print_intr(struct mp_intr_map *mp } snprintb(buf, sizeof(buf), inttype_fmt, mpi->type); printf(" (type %s", buf); - + snprintb(buf, sizeof(buf), flagtype_fmt, mpi->flags); printf(" flags %s)\n", buf); @@ -1060,14 +1060,14 @@ mpacpi_findintr_linkdev(struct mp_intr_m */ if (pol == ACPI_ACTIVE_LOW) pol = MPS_INTPO_ACTLO; - else + else pol = MPS_INTPO_ACTHI; - + if (trig == ACPI_EDGE_SENSITIVE) trig = MPS_INTTR_EDGE; else trig = MPS_INTTR_LEVEL; - + mip->flags = pol | (trig << 2); mip->global_int = irq; pic = intr_findpic(irq); Index: src/sys/arch/x86/x86/mpbios.c diff -u src/sys/arch/x86/x86/mpbios.c:1.70 src/sys/arch/x86/x86/mpbios.c:1.71 --- src/sys/arch/x86/x86/mpbios.c:1.70 Sat Aug 7 16:19:08 2021 +++ src/sys/arch/x86/x86/mpbios.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mpbios.c,v 1.70 2021/08/07 16:19:08 thorpej Exp $ */ +/* $NetBSD: mpbios.c,v 1.71 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mpbios.c,v 1.70 2021/08/07 16:19:08 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mpbios.c,v 1.71 2021/10/07 12:52:27 msaitoh Exp $"); #include "acpica.h" #include "lapic.h" @@ -149,10 +149,10 @@ int mpbios_nioapic; /* descriptions of MP basetable entries */ struct mpbios_baseentry { - uint8_t type; - uint8_t length; + uint8_t type; + uint8_t length; uint16_t count; - const char *name; + const char *name; }; static const char *loc_where[] = { @@ -163,10 +163,10 @@ static const char *loc_where[] = { struct mp_map { - vaddr_t baseva; - int vsize; - paddr_t pa; - paddr_t pg; + vaddr_t baseva; + int vsize; + paddr_t pa; + paddr_t pg; int psize; }; @@ -199,7 +199,7 @@ static void mpbios_dflt_conf_cpu(device_ static void mpbios_dflt_conf_bus(device_t, const struct dflt_conf_entry *); static void mpbios_dflt_conf_ioapic(device_t); static void mpbios_dflt_conf_int(device_t, const struct dflt_conf_entry *, - const int *); + const int *); static void mpbios_cpu(const uint8_t *, device_t); static void mpbios_bus(const uint8_t *, device_t); @@ -228,7 +228,7 @@ mp_cpuprint(void *aux, const char *pnp) if (pnp) aprint_normal("cpu at %s", pnp); aprint_normal(" apid %d", caa->cpu_number); - return (UNCONF); + return UNCONF; } int @@ -239,7 +239,7 @@ mp_ioapicprint(void *aux, const char *pn if (pnp) aprint_normal("ioapic at %s", pnp); aprint_normal(" apid %d", aaa->apic_id); - return (UNCONF); + return UNCONF; } /* @@ -285,12 +285,12 @@ mpbios_unmap(struct mp_map *handle) int mpbios_probe(device_t self) { - paddr_t ebda, memtop; + paddr_t ebda, memtop; paddr_t cthpa; int cthlen; const uint8_t *mpbios_page; - int scan_loc; + int scan_loc; struct mp_map t; @@ -550,7 +550,7 @@ static const uint8_t dflt_lint_tab[2] = void mpbios_scan(device_t self, int *ncpup) { - const uint8_t *position, *end; + const uint8_t *position, *end; size_t i; int count; int type; @@ -632,7 +632,7 @@ mpbios_scan(device_t self, int *ncpup) KASSERT(mp_nbus != 0); mp_busses = kmem_zalloc(sizeof(struct mp_bus) * mp_nbus, - KM_SLEEP); + KM_SLEEP); KASSERT(mp_busses != NULL); /* INTIN0 */ @@ -649,7 +649,7 @@ mpbios_scan(device_t self, int *ncpup) intr_cnt++; mp_intrs = kmem_zalloc(sizeof(struct mp_intr_map) * intr_cnt, - KM_SLEEP); + KM_SLEEP); KASSERT(mp_intrs != NULL); mp_nintr = intr_cnt; @@ -877,7 +877,7 @@ mpbios_dflt_conf_ioapic(device_t self) static void mpbios_dflt_conf_int(device_t self, const struct dflt_conf_entry *dflt_conf, - const int *dflt_bus_irq) + const int *dflt_bus_irq) { struct mpbios_int mpi; size_t i; @@ -901,7 +901,7 @@ mpbios_dflt_conf_int(device_t self, cons mpi.dst_apic_id = DFLT_IOAPIC_ID; mpi.dst_apic_int = 0; mpbios_int((u_int8_t *)&mpi, MPS_MCT_IOINT, - &mp_intrs[cur_intr++]); + &mp_intrs[cur_intr++]); } /* @@ -938,12 +938,12 @@ mpbios_dflt_conf_int(device_t self, cons mpi.src_bus_irq = (uint8_t)dflt_bus_irq[i]; if (level_inv & (1U << mpi.src_bus_irq)) mpi.int_flags = (MPS_INTTR_LEVEL << 2) - | MPS_INTPO_ACTHI; + | MPS_INTPO_ACTHI; else mpi.int_flags = 0; /* conforms to bus spec. */ mpi.dst_apic_int = (uint8_t)i; mpbios_int((u_int8_t *)&mpi, MPS_MCT_IOINT, - &mp_intrs[cur_intr++]); + &mp_intrs[cur_intr++]); } } @@ -959,7 +959,7 @@ mpbios_dflt_conf_int(device_t self, cons mpi.int_type = dflt_lint_tab[i]; mpi.dst_apic_int = (uint8_t)i; mpbios_int((u_int8_t *)&mpi, MPS_MCT_LINT, - &mp_intrs[cur_intr++]); + &mp_intrs[cur_intr++]); } } Index: src/sys/arch/x86/x86/mtrr_i686.c diff -u src/sys/arch/x86/x86/mtrr_i686.c:1.31 src/sys/arch/x86/x86/mtrr_i686.c:1.32 --- src/sys/arch/x86/x86/mtrr_i686.c:1.31 Fri Jan 31 08:21:11 2020 +++ src/sys/arch/x86/x86/mtrr_i686.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mtrr_i686.c,v 1.31 2020/01/31 08:21:11 maxv Exp $ */ +/* $NetBSD: mtrr_i686.c,v 1.32 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2000, 2011 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mtrr_i686.c,v 1.31 2020/01/31 08:21:11 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mtrr_i686.c,v 1.32 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_multiprocessor.h" @@ -490,8 +490,8 @@ i686_mtrr_validate(struct mtrr *mtrrp, s || mtrrp->type > MTRR_TYPE_WB) && (mtrrp->flags & MTRR_VALID)) return EINVAL; - /* - * If write-combining is requested, make sure that the WC feature + /* + * If write-combining is requested, make sure that the WC feature * is supported by the processor. */ if (mtrrp->type == MTRR_TYPE_WC && @@ -639,9 +639,9 @@ i686_mtrr_setone(struct mtrr *mtrrp, str } if (((high >= curlow && high < curhigh) || (low >= curlow && low < curhigh)) && - (i686_mtrr_conflict(mtrr_var[i].type, mtrrp->type) || + (i686_mtrr_conflict(mtrr_var[i].type, mtrrp->type) || ((mtrr_var[i].flags & MTRR_PRIVATE) && - (!(mtrrp->flags & MTRR_PRIVATE) || (p == NULL) || + (!(mtrrp->flags & MTRR_PRIVATE) || (p == NULL) || (mtrr_var[i].owner != p->p_pid))))) { return EBUSY; } Index: src/sys/arch/x86/x86/multiboot2.c diff -u src/sys/arch/x86/x86/multiboot2.c:1.7 src/sys/arch/x86/x86/multiboot2.c:1.8 --- src/sys/arch/x86/x86/multiboot2.c:1.7 Sun Oct 3 18:47:16 2021 +++ src/sys/arch/x86/x86/multiboot2.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: multiboot2.c,v 1.7 2021/10/03 18:47:16 fcambus Exp $ */ +/* $NetBSD: multiboot2.c,v 1.8 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: multiboot2.c,v 1.7 2021/10/03 18:47:16 fcambus Exp $"); +__KERNEL_RCSID(0, "$NetBSD: multiboot2.c,v 1.8 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_multiboot.h" @@ -72,7 +72,7 @@ typedef Elf_Addr locore_Elf_Addr; * it causes EFI to try to handle interrupts while the kernel * already took that over, hence we get a reboot. */ -#define BS_PRINT(efisystbl, wstring) \ +#define BS_PRINT(efisystbl, wstring) \ efi_systbl->st_coutif->ei_outputstring(efi_systbl->st_coutif, \ (efi_char *)__UNCONST(wstring)) @@ -81,7 +81,7 @@ struct multiboot_symbols { uint32_t s_symsize; uint32_t s_strstart; uint32_t s_strsize; -}; +}; void multiboot2_copy_syms(struct multiboot_tag_elf_sections *, struct multiboot_symbols *, @@ -93,7 +93,7 @@ void multiboot2_copy_syms(struct multibo void multiboot2_pre_reloc(char *); void multiboot2_post_reloc(void); void multiboot2_print_info(void); -bool multiboot2_ksyms_addsyms_elf(void); +bool multiboot2_ksyms_addsyms_elf(void); extern int biosbasemem; extern int biosextmem; @@ -104,11 +104,11 @@ extern int boothowto; extern struct bootinfo bootinfo; extern int end; extern int * esym; -extern char start; +extern char start; -/* +/* * There is no way to perform dynamic allocation - * at this time, hence we need to waste memory, + * at this time, hence we need to waste memory, * with the hope data will fit. */ char multiboot_info[16384] = "\0\0\0\0"; @@ -169,7 +169,7 @@ exit_bs: } void -multiboot2_copy_syms(struct multiboot_tag_elf_sections *mbt_elf, +multiboot2_copy_syms(struct multiboot_tag_elf_sections *mbt_elf, struct multiboot_symbols *ms, bool *has_symsp, int **esymp, void *endp, vaddr_t kernbase) @@ -229,15 +229,15 @@ multiboot2_copy_syms(struct multiboot_ta * that if the tables start before the kernel's end address, * they will not grow over this address. */ - if ((void *)(uintptr_t)symaddr < endp && + if ((void *)(uintptr_t)symaddr < endp && (void *)(uintptr_t)straddr < endp) { cp1src = symaddr; cp1size = symsize; cp2src = straddr; cp2size = strsize; - } else if ((void *)(uintptr_t)symaddr > endp && + } else if ((void *)(uintptr_t)symaddr > endp && (void *)(uintptr_t)straddr < endp) { cp1src = symaddr; cp1size = symsize; cp2src = straddr; cp2size = strsize; - } else if ((void *)(uintptr_t)symaddr < endp && + } else if ((void *)(uintptr_t)symaddr < endp && (void *)(uintptr_t)straddr > endp) { cp1src = straddr; cp1size = strsize; cp2src = symaddr; cp2size = symsize; @@ -332,7 +332,7 @@ multiboot2_pre_reloc(char *mbi) /* Broken */ if (has_bs) - efi_exit_bs(efi_systbl, efi_ih); + efi_exit_bs(efi_systbl, efi_ih); if (mbt_elf) multiboot2_copy_syms(mbt_elf, @@ -348,7 +348,7 @@ multiboot2_pre_reloc(char *mbi) static struct btinfo_common * bootinfo_init(int type, int len) { - int i; + int i; struct bootinfo *bip = (struct bootinfo *)&bootinfo; vaddr_t data; @@ -391,38 +391,38 @@ mbi_cmdline(struct multiboot_tag_string char *cl; if (optstr_get(cmdline, "console", bic.devname, sizeof(bic.devname))) { - if (strncmp(bic.devname, "com", sizeof(bic.devname)) == 0) { - char opt[10]; - - if (optstr_get(cmdline, "console_speed", - opt, sizeof(opt))) - bic.speed = strtoul(opt, NULL, 10); - else - bic.speed = 0; /* Use default speed. */ - - if (optstr_get(cmdline, "console_addr", - opt, sizeof(opt))) { - if (opt[0] == '0' && opt[1] == 'x') - bic.addr = strtoul(opt + 2, NULL, 16); - else - bic.addr = strtoul(opt, NULL, 10); - } else { - bic.addr = 0; /* Use default address. */ + if (strncmp(bic.devname, "com", sizeof(bic.devname)) == 0) { + char opt[10]; + + if (optstr_get(cmdline, "console_speed", + opt, sizeof(opt))) + bic.speed = strtoul(opt, NULL, 10); + else + bic.speed = 0; /* Use default speed. */ + + if (optstr_get(cmdline, "console_addr", + opt, sizeof(opt))) { + if (opt[0] == '0' && opt[1] == 'x') + bic.addr = strtoul(opt + 2, NULL, 16); + else + bic.addr = strtoul(opt, NULL, 10); + } else { + bic.addr = 0; /* Use default address. */ } - bootinfo_add((struct btinfo_common *)&bic, - BTINFO_CONSOLE, sizeof(bic)); + bootinfo_add((struct btinfo_common *)&bic, + BTINFO_CONSOLE, sizeof(bic)); - } + } if (strncmp(bic.devname, "pc", sizeof(bic.devname)) == 0) - bootinfo_add((struct btinfo_common *)&bic, - BTINFO_CONSOLE, sizeof(bic)); - } + bootinfo_add((struct btinfo_common *)&bic, + BTINFO_CONSOLE, sizeof(bic)); + } if (optstr_get(cmdline, "root", bir.devname, sizeof(bir.devname))) - bootinfo_add((struct btinfo_common *)&bir, BTINFO_ROOTDEVICE, - sizeof(bir)); + bootinfo_add((struct btinfo_common *)&bir, BTINFO_ROOTDEVICE, + sizeof(bir)); /* * Parse boot flags (-s and friends) @@ -492,19 +492,19 @@ mbi_modules(char *mbi, uint32_t mbi_size static void mbi_basic_meminfo(struct multiboot_tag_basic_meminfo *mbt) { - /* Make sure we don't override user-set variables. */ - if (biosbasemem == 0) { - biosbasemem = mbt->mem_lower; + /* Make sure we don't override user-set variables. */ + if (biosbasemem == 0) { + biosbasemem = mbt->mem_lower; #ifdef __i386__ - biosmem_implicit = 1; + biosmem_implicit = 1; #endif - } - if (biosextmem == 0) { - biosextmem = mbt->mem_upper; + } + if (biosextmem == 0) { + biosextmem = mbt->mem_upper; #ifdef __i386__ - biosmem_implicit = 1; + biosmem_implicit = 1; #endif - } + } return; } @@ -517,9 +517,9 @@ mbi_bootdev(struct multiboot_tag_bootdev bid.labelsector = -1; bid.biosdev = mbt->biosdev; bid.partition = mbt->slice; - + bootinfo_add((struct btinfo_common *)&bid, - BTINFO_BOOTDISK, sizeof(bid)); + BTINFO_BOOTDISK, sizeof(bid)); } static void @@ -594,9 +594,9 @@ mbi_framebuffer(struct multiboot_tag_fra struct btinfo_framebuffer *bif) { bif->physaddr = mbt->common.framebuffer_addr; - bif->width = mbt->common.framebuffer_width; - bif->height = mbt->common.framebuffer_height; - bif->depth = mbt->common.framebuffer_bpp; + bif->width = mbt->common.framebuffer_width; + bif->height = mbt->common.framebuffer_height; + bif->depth = mbt->common.framebuffer_bpp; bif->stride = mbt->common.framebuffer_pitch; return; @@ -609,9 +609,8 @@ mbi_efi32(struct multiboot_tag_efi32 *mb bie.systblpa = mbt->pointer; bie.flags = BI_EFI_32BIT; - - bootinfo_add((struct btinfo_common *)&bie, - BTINFO_EFI, sizeof(bie)); + + bootinfo_add((struct btinfo_common *)&bie, BTINFO_EFI, sizeof(bie)); } static void @@ -620,9 +619,8 @@ mbi_efi64(struct multiboot_tag_efi64 *mb struct btinfo_efi bie; bie.systblpa = mbt->pointer; - - bootinfo_add((struct btinfo_common *)&bie, - BTINFO_EFI, sizeof(bie)); + + bootinfo_add((struct btinfo_common *)&bie, BTINFO_EFI, sizeof(bie)); } static void @@ -672,7 +670,7 @@ multiboot2_post_reloc(void) cp - mbi < mbi_size; cp += roundup(mbt->size, MULTIBOOT_INFO_ALIGN)) { mbt = (struct multiboot_tag *)cp; - switch(mbt->type) { + switch (mbt->type) { case MULTIBOOT_TAG_TYPE_CMDLINE: mbi_cmdline((void *)mbt); break; @@ -726,7 +724,7 @@ multiboot2_post_reloc(void) if (has_fbinfo) bootinfo_add((struct btinfo_common *)&fbinfo, - BTINFO_FRAMEBUFFER, sizeof(fbinfo)); + BTINFO_FRAMEBUFFER, sizeof(fbinfo)); if (module_count > 0) mbi_modules(mbi, mbi_size, module_count); @@ -746,7 +744,7 @@ mbi_hexdump(char *addr, size_t len) printf(" %p ", addr + i); for (j = 0; j < 16 && i + j < len; j++) { char *cp = addr + i + j; - printf("%s%s%x", + printf("%s%s%x", (i+j) % 4 ? "" : " ", (unsigned char)*cp < 0x10 ? "0" : "", (unsigned char)*cp); @@ -894,10 +892,10 @@ multiboot2_print_info(void) if (entry_version != 0) break; - + for (mmap = ((struct multiboot_tag_mmap *)mbt)->entries; - (char *)mmap - (char *)mbt < mbt->size; - mmap = (void *)((char *)mmap + entry_size)) + (char *)mmap - (char *)mbt < mbt->size; + mmap = (void *)((char *)mmap + entry_size)) printf(" 0x%016"PRIx64" @ 0x%016"PRIx64" " "type 0x%x\n", (uint64_t)mmap->len, (uint64_t)mmap->addr, @@ -952,7 +950,7 @@ multiboot2_print_info(void) case MULTIBOOT_TAG_TYPE_SMBIOS: printf("major = %d, minor = %d\n", ((struct multiboot_tag_smbios *)mbt)->major, - ((struct multiboot_tag_smbios *)mbt)->minor); + ((struct multiboot_tag_smbios *)mbt)->minor); #ifdef DEBUG mbi_hexdump((char *)mbt, mbt->size); #endif @@ -985,7 +983,7 @@ multiboot2_print_info(void) printf("\n"); break; case MULTIBOOT_TAG_TYPE_EFI32_IH: - printf("0x%"PRIx32"\n", + printf("0x%"PRIx32"\n", ((struct multiboot_tag_efi32_ih *)mbt)->pointer); break; case MULTIBOOT_TAG_TYPE_EFI64_IH: Index: src/sys/arch/x86/x86/pmap.c diff -u src/sys/arch/x86/x86/pmap.c:1.411 src/sys/arch/x86/x86/pmap.c:1.412 --- src/sys/arch/x86/x86/pmap.c:1.411 Mon Aug 2 12:56:23 2021 +++ src/sys/arch/x86/x86/pmap.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.411 2021/08/02 12:56:23 andvar Exp $ */ +/* $NetBSD: pmap.c,v 1.412 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc. @@ -130,7 +130,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.411 2021/08/02 12:56:23 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.412 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_user_ldt.h" #include "opt_lockdebug.h" @@ -232,7 +232,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.4 * * pg->uobject->vmobjlock, pg->uanon->an_lock * - * For managed pages, these per-object locks are taken by the VM system + * For managed pages, these per-object locks are taken by the VM system * before calling into the pmap module - either a read or write hold. * The lock hold prevent pages from changing identity while the pmap is * operating on them. For example, the same lock is held across a call @@ -2887,7 +2887,7 @@ pmap_create(void) pmap->pm_ldt = NULL; pmap->pm_ldt_sel = GSYSSEL(GLDT_SEL, SEL_KPL); - return (pmap); + return pmap; } /* @@ -3285,10 +3285,10 @@ retry: mutex_enter(&cpu_lock); } - /* + /* * Now that we have cpu_lock, ensure the LDT status is the same. */ - if (pmap1->pm_ldt != NULL) { + if (pmap1->pm_ldt != NULL) { if (new_ldt == NULL) { /* A wild LDT just appeared. */ mutex_exit(&cpu_lock); @@ -3434,7 +3434,7 @@ pmap_activate(struct lwp *l) #define KASSERT_PDIRPA(pmap) \ KASSERT(pmap_pdirpa(pmap, 0) == pmap_pte2pa(rcr3())) #else -#define KASSERT_PDIRPA(pmap) KASSERT(true) /* nothing to do */ +#define KASSERT_PDIRPA(pmap) KASSERT(true) /* nothing to do */ #endif /* @@ -4145,7 +4145,7 @@ pmap_remove_locked(struct pmap *pmap, va if (!pmap_pdes_valid(va, pdes, &pde, &lvl)) { /* Skip a range corresponding to an invalid pde. */ blkendva = (va & ptp_frames[lvl - 1]) + nbpd[lvl - 1]; - continue; + continue; } KASSERT(lvl == 1); @@ -4323,7 +4323,7 @@ pmap_pp_remove(struct pmap_page *pp, pad sum |= (uintptr_t)atomic_load_relaxed(&pp->pp_pte.pte_ptp); sum |= (uintptr_t)atomic_load_relaxed(&pp->pp_pvlist.lh_first); if (sum == 0) { - return; + return; } kpreempt_disable(); @@ -4826,7 +4826,7 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t npte = ma | protection_codes[prot] | PTE_P; npte |= pmap_pat_flags(flags); if (wired) - npte |= PTE_WIRED; + npte |= PTE_WIRED; if (va < VM_MAXUSER_ADDRESS) npte |= PTE_U; @@ -4901,9 +4901,9 @@ pmap_enter_ma(struct pmap *pmap, vaddr_t samepage = false; new_embedded = false; - if (new_pp != NULL) { - error = pmap_enter_pv(pmap, new_pp, ptp, va, &new_pve, - &old_pve, &samepage, &new_embedded, tree); + if (new_pp != NULL) { + error = pmap_enter_pv(pmap, new_pp, ptp, va, &new_pve, + &old_pve, &samepage, &new_embedded, tree); /* * If a new pv_entry was needed and none was available, we @@ -6155,9 +6155,9 @@ pmap_ept_enter(struct pmap *pmap, vaddr_ samepage = false; new_embedded = false; - if (new_pp != NULL) { - error = pmap_enter_pv(pmap, new_pp, ptp, va, &new_pve, - &old_pve, &samepage, &new_embedded, tree); + if (new_pp != NULL) { + error = pmap_enter_pv(pmap, new_pp, ptp, va, &new_pve, + &old_pve, &samepage, &new_embedded, tree); /* * If a new pv_entry was needed and none was available, we @@ -6482,7 +6482,7 @@ pmap_ept_remove(struct pmap *pmap, vaddr if (lvl != 0) { /* Skip a range corresponding to an invalid pde. */ blkendva = (va & ptp_frames[lvl - 1]) + nbpd[lvl - 1]; - continue; + continue; } /* PA of the PTP */ Index: src/sys/arch/x86/x86/procfs_machdep.c diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.41 src/sys/arch/x86/x86/procfs_machdep.c:1.42 --- src/sys/arch/x86/x86/procfs_machdep.c:1.41 Sat Jul 10 17:33:28 2021 +++ src/sys/arch/x86/x86/procfs_machdep.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_machdep.c,v 1.41 2021/07/10 17:33:28 msaitoh Exp $ */ +/* $NetBSD: procfs_machdep.c,v 1.42 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.41 2021/07/10 17:33:28 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.42 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -280,7 +280,7 @@ procfs_getonecpufeatures(struct cpu_info /* x86_features[2] is for Transmeta */ /* x86_features[3] is Linux defined mapping */ - + procfs_getonefeatreg(ci->ci_feat_val[1], x86_features[4], p + diff, left); diff = last - *left; Index: src/sys/arch/x86/x86/spectre.c diff -u src/sys/arch/x86/x86/spectre.c:1.35 src/sys/arch/x86/x86/spectre.c:1.36 --- src/sys/arch/x86/x86/spectre.c:1.35 Sat May 2 11:37:17 2020 +++ src/sys/arch/x86/x86/spectre.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: spectre.c,v 1.35 2020/05/02 11:37:17 maxv Exp $ */ +/* $NetBSD: spectre.c,v 1.36 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 2018-2019 NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.35 2020/05/02 11:37:17 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.36 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_spectre.h" @@ -440,7 +440,7 @@ v4_detect_method(void) if (cpu_info_primary.ci_max_ext_cpuid < 0x80000008) { break; } - x86_cpuid(0x80000008, descs); + x86_cpuid(0x80000008, descs); if (descs[1] & CPUID_CAPEX_SSB_NO) { /* Not vulnerable to SpectreV4. */ v4_mitigation_method = V4_MITIGATION_AMD_SSB_NO; Index: src/sys/arch/x86/x86/svs.c diff -u src/sys/arch/x86/x86/svs.c:1.39 src/sys/arch/x86/x86/svs.c:1.40 --- src/sys/arch/x86/x86/svs.c:1.39 Sun Jul 19 07:35:08 2020 +++ src/sys/arch/x86/x86/svs.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: svs.c,v 1.39 2020/07/19 07:35:08 maxv Exp $ */ +/* $NetBSD: svs.c,v 1.40 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 2018-2020 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.39 2020/07/19 07:35:08 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.40 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_svs.h" #include "opt_user_ldt.h" @@ -60,7 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.39 * entries containing the userland pages. * * ~~~~~~~~~~ The UTLS Page ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * + * * We use a special per-cpu page that we call UTLS, for User Thread Local * Storage. Each CPU has one UTLS page. This page has two VAs: * @@ -138,7 +138,7 @@ __KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.39 * During a context switch, svs_lwp_switch() gets called first. This function * does the kenter job described above, not in the kernel page tables (that * are currently loaded), but in the user page tables (that are not loaded). - * + * * VIRTUAL ADDRESSES PHYSICAL ADDRESSES * * +-----------------------------+ Index: src/sys/arch/x86/x86/sys_machdep.c diff -u src/sys/arch/x86/x86/sys_machdep.c:1.56 src/sys/arch/x86/x86/sys_machdep.c:1.57 --- src/sys/arch/x86/x86/sys_machdep.c:1.56 Fri Jun 19 16:20:22 2020 +++ src/sys/arch/x86/x86/sys_machdep.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_machdep.c,v 1.56 2020/06/19 16:20:22 maxv Exp $ */ +/* $NetBSD: sys_machdep.c,v 1.57 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 1998, 2007, 2009, 2017 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.56 2020/06/19 16:20:22 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.57 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_mtrr.h" #include "opt_user_ldt.h" @@ -434,7 +434,7 @@ x86_set_ioperm(struct lwp *l, void *args void *new; void *old; - error = kauth_authorize_machdep(l->l_cred, KAUTH_MACHDEP_IOPERM_SET, + error = kauth_authorize_machdep(l->l_cred, KAUTH_MACHDEP_IOPERM_SET, NULL, NULL, NULL, NULL); if (error) return error; @@ -479,7 +479,7 @@ x86_get_mtrr(struct lwp *l, void *args, if (mtrr_funcs == NULL) return ENOSYS; - error = kauth_authorize_machdep(l->l_cred, KAUTH_MACHDEP_MTRR_GET, + error = kauth_authorize_machdep(l->l_cred, KAUTH_MACHDEP_MTRR_GET, NULL, NULL, NULL, NULL); if (error) return error; @@ -514,7 +514,7 @@ x86_set_mtrr(struct lwp *l, void *args, if (mtrr_funcs == NULL) return ENOSYS; - error = kauth_authorize_machdep(l->l_cred, KAUTH_MACHDEP_MTRR_SET, + error = kauth_authorize_machdep(l->l_cred, KAUTH_MACHDEP_MTRR_SET, NULL, NULL, NULL, NULL); if (error) return error; @@ -626,7 +626,7 @@ x86_set_sdbase(void *arg, char which, lw pcb = lwp_getpcb(l); kpreempt_disable(); - switch(which) { + switch (which) { case 'f': pcb->pcb_fs = base; if (l == curlwp) @@ -682,7 +682,7 @@ x86_get_sdbase(void *arg, char which) pcb = lwp_getpcb(curlwp); - switch(which) { + switch (which) { case 'f': base = pcb->pcb_fs; break; @@ -698,7 +698,8 @@ x86_get_sdbase(void *arg, char which) } int -sys_sysarch(struct lwp *l, const struct sys_sysarch_args *uap, register_t *retval) +sys_sysarch(struct lwp *l, const struct sys_sysarch_args *uap, + register_t *retval) { /* { syscallarg(int) op; @@ -706,8 +707,8 @@ sys_sysarch(struct lwp *l, const struct } */ int error = 0; - switch(SCARG(uap, op)) { - case X86_IOPL: + switch (SCARG(uap, op)) { + case X86_IOPL: error = x86_iopl(l, SCARG(uap, parms), retval); break; @@ -715,20 +716,20 @@ sys_sysarch(struct lwp *l, const struct /* * On amd64, this is done via netbsd32_sysarch. */ - case X86_GET_LDT: + case X86_GET_LDT: error = x86_get_ldt(l, SCARG(uap, parms), retval); break; - case X86_SET_LDT: + case X86_SET_LDT: error = x86_set_ldt(l, SCARG(uap, parms), retval); break; #endif - case X86_GET_IOPERM: + case X86_GET_IOPERM: error = x86_get_ioperm(l, SCARG(uap, parms), retval); break; - case X86_SET_IOPERM: + case X86_SET_IOPERM: error = x86_set_ioperm(l, SCARG(uap, parms), retval); break; @@ -770,6 +771,6 @@ cpu_lwp_setprivate(lwp_t *l, void *addr) if ((l->l_proc->p_flag & PK_32) == 0) { return x86_set_sdbase(addr, 'f', l, true); } -#endif +#endif return x86_set_sdbase(addr, 'g', l, true); } Index: src/sys/arch/x86/x86/syscall.c diff -u src/sys/arch/x86/x86/syscall.c:1.18 src/sys/arch/x86/x86/syscall.c:1.19 --- src/sys/arch/x86/x86/syscall.c:1.18 Sat Apr 6 11:54:21 2019 +++ src/sys/arch/x86/x86/syscall.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: syscall.c,v 1.18 2019/04/06 11:54:21 kamil Exp $ */ +/* $NetBSD: syscall.c,v 1.19 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 1998, 2000, 2009 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.18 2019/04/06 11:54:21 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.19 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -76,7 +76,7 @@ cpu_spawn_return(struct lwp *l) userret(l); } - + /* * syscall(frame): * System call request from POSIX system call gate interface to kernel. Index: src/sys/arch/x86/x86/x86_tlb.c diff -u src/sys/arch/x86/x86/x86_tlb.c:1.18 src/sys/arch/x86/x86/x86_tlb.c:1.19 --- src/sys/arch/x86/x86/x86_tlb.c:1.18 Sun Mar 22 00:16:16 2020 +++ src/sys/arch/x86/x86/x86_tlb.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_tlb.c,v 1.18 2020/03/22 00:16:16 ad Exp $ */ +/* $NetBSD: x86_tlb.c,v 1.19 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2008-2020 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v 1.18 2020/03/22 00:16:16 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v 1.19 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -99,18 +99,18 @@ typedef struct { #define TP_SET_USERPMAP(tp) ((tp)->tp_store[TP_USERPMAP] |= 1) #define TP_SET_GLOBAL(tp) ((tp)->tp_store[TP_GLOBAL] |= 1) -#define TP_SET_DONE(tp) \ -do { \ - uintptr_t v = atomic_load_relaxed(&(tp)->tp_store[TP_DONE]); \ - atomic_store_relaxed(&(tp)->tp_store[TP_DONE], v | 1); \ -} while (/* CONSTCOND */ 0); +#define TP_SET_DONE(tp) \ + do { \ + uintptr_t v = atomic_load_relaxed(&(tp)->tp_store[TP_DONE]); \ + atomic_store_relaxed(&(tp)->tp_store[TP_DONE], v | 1); \ + } while (/* CONSTCOND */ 0); #define TP_CLEAR(tp) memset(__UNVOLATILE(tp), 0, sizeof(*(tp))); /* * TLB shootdown state. */ -static volatile pmap_tlb_packet_t * volatile pmap_tlb_packet __cacheline_aligned; +static volatile pmap_tlb_packet_t *volatile pmap_tlb_packet __cacheline_aligned; static volatile u_int pmap_tlb_pendcount __cacheline_aligned; static struct evcnt pmap_tlb_evcnt __cacheline_aligned; @@ -432,7 +432,7 @@ pmap_tlb_shootnow(void) return; } } - + /* * Ownership of the global pointer provides serialization of the * update to the count and the event counter. With those values Index: src/sys/arch/x86/x86/viac7temp.c diff -u src/sys/arch/x86/x86/viac7temp.c:1.8 src/sys/arch/x86/x86/viac7temp.c:1.9 --- src/sys/arch/x86/x86/viac7temp.c:1.8 Sun Aug 10 16:44:34 2014 +++ src/sys/arch/x86/x86/viac7temp.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: viac7temp.c,v 1.8 2014/08/10 16:44:34 tls Exp $ */ +/* $NetBSD: viac7temp.c,v 1.9 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2009 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.8 2014/08/10 16:44:34 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.9 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -44,8 +44,8 @@ __KERNEL_RCSID(0, "$NetBSD: viac7temp.c, struct viac7temp_softc { device_t sc_dev; struct cpu_info *sc_ci; - struct sysmon_envsys *sc_sme; - envsys_data_t sc_sensor; + struct sysmon_envsys *sc_sme; + envsys_data_t sc_sensor; }; static int viac7temp_match(device_t, cfdata_t, void *); Index: src/sys/arch/x86/x86/x86_autoconf.c diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.84 src/sys/arch/x86/x86/x86_autoconf.c:1.85 --- src/sys/arch/x86/x86/x86_autoconf.c:1.84 Thu Jul 9 22:45:54 2020 +++ src/sys/arch/x86/x86/x86_autoconf.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_autoconf.c,v 1.84 2020/07/09 22:45:54 jdolecek Exp $ */ +/* $NetBSD: x86_autoconf.c,v 1.85 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.84 2020/07/09 22:45:54 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.85 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -95,8 +95,8 @@ is_valid_disk(device_t dv) { if (device_class(dv) != DV_DISK) - return (0); - + return 0; + return (device_is_a(dv, "dk") || device_is_a(dv, "sd") || device_is_a(dv, "wd") || @@ -292,7 +292,7 @@ match_bootdisk(device_t dv, struct btinf DPRINTF(("%s: no label %s\n", __func__, device_xname(dv))); return 0; } - + if ((tmpvn = opendisk(dv)) == NULL) { DPRINTF(("%s: can't open %s\n", __func__, device_xname(dv))); return 0; @@ -319,7 +319,7 @@ match_bootdisk(device_t dv, struct btinf closeout: VOP_CLOSE(tmpvn, FREAD, NOCRED); vput(tmpvn); - return (found); + return found; } /* @@ -340,7 +340,7 @@ findroot(void) if (booted_device) return; - + if (lookup_bootinfo(BTINFO_NETIF) != NULL) { /* * We got netboot interface information, but device_register() @@ -409,7 +409,7 @@ findroot(void) */ if ((biw->biosdev & 0x80) == 0 || match_bootwedge(dv, biw) == 0) - continue; + continue; goto bootwedge_found; } @@ -456,7 +456,7 @@ findroot(void) /* XXX device_unit() abuse */ if ((bid->biosdev & 0x80) != 0 || device_unit(dv) != bid->biosdev) - continue; + continue; goto bootdisk_found; } @@ -468,7 +468,7 @@ findroot(void) */ if ((bid->biosdev & 0x80) == 0 || match_bootdisk(dv, bid) == 0) - continue; + continue; goto bootdisk_found; } Index: src/sys/arch/x86/x86/x86_ipmi.c diff -u src/sys/arch/x86/x86/x86_ipmi.c:1.2 src/sys/arch/x86/x86/x86_ipmi.c:1.3 --- src/sys/arch/x86/x86/x86_ipmi.c:1.2 Wed Jul 21 23:16:09 2021 +++ src/sys/arch/x86/x86/x86_ipmi.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_ipmi.c,v 1.2 2021/07/21 23:16:09 jmcneill Exp $ */ +/* $NetBSD: x86_ipmi.c,v 1.3 2021/10/07 12:52:27 msaitoh Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -52,7 +52,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: x86_ipmi.c,v 1.2 2021/07/21 23:16:09 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_ipmi.c,v 1.3 2021/10/07 12:52:27 msaitoh Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -145,11 +145,11 @@ ipmi_smbios_probe(struct smbios_ipmi *pi if (platform != NULL && strcmp(platform, "ProLiant MicroServer") == 0 && pipmi->smipmi_base_address != 0) { - ia->iaa_if_iospacing = 1; - ia->iaa_if_iobase = pipmi->smipmi_base_address & ~0x7; - ia->iaa_if_iotype = 'i'; - return; - } + ia->iaa_if_iospacing = 1; + ia->iaa_if_iobase = pipmi->smipmi_base_address & ~0x7; + ia->iaa_if_iotype = 'i'; + return; + } if (pipmi->smipmi_base_flags == 0x7f) { /* IBM 325 eServer workaround */ @@ -169,12 +169,12 @@ scan_sig(long start, long end, int skip, while (start < end) { va = ISA_HOLE_VADDR(start); if (memcmp(va, data, len) == 0) - return (va); - + return va; + start += skip; - } - - return (NULL); + } + + return NULL; } int Index: src/sys/arch/x86/x86/x86_machdep.c diff -u src/sys/arch/x86/x86/x86_machdep.c:1.148 src/sys/arch/x86/x86/x86_machdep.c:1.149 --- src/sys/arch/x86/x86/x86_machdep.c:1.148 Fri Feb 19 03:28:53 2021 +++ src/sys/arch/x86/x86/x86_machdep.c Thu Oct 7 12:52:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_machdep.c,v 1.148 2021/02/19 03:28:53 christos Exp $ */ +/* $NetBSD: x86_machdep.c,v 1.149 2021/10/07 12:52:27 msaitoh Exp $ */ /*- * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.148 2021/02/19 03:28:53 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.149 2021/10/07 12:52:27 msaitoh Exp $"); #include "opt_modular.h" #include "opt_physmem.h" @@ -283,7 +283,7 @@ module_init_md(void) #endif bi->len); #endif - break; + break; default: aprint_debug("Skipping non-ELF module\n"); break; @@ -704,7 +704,7 @@ x86_parse_clusters(struct btinfo_memmap /* * XXX XXX: Avoid the ISA I/O MEM. - * + * * Some laptops (for example, Toshiba Satellite2550X) report * this area as valid. */ @@ -843,7 +843,7 @@ x86_add_xen_clusters(void) for (int i = 0; i < hvm_start_info->memmap_entries; i++) { if (map_entry[i].size < PAGE_SIZE) continue; - switch(map_entry[i].type) { + switch (map_entry[i].type) { case XEN_HVM_MEMMAP_TYPE_RAM: x86_add_cluster(map_entry[i].addr, map_entry[i].size, BIM_Memory); @@ -1050,7 +1050,7 @@ init_x86_vm(paddr_t pa_kend) #endif seg_end = pa_kstart; } - + /* First hunk */ if (seg_start != seg_end) { x86_load_region(seg_start, seg_end); @@ -1074,9 +1074,9 @@ init_x86_msgbuf(void) psize_t sz = round_page(MSGBUFSIZE); psize_t reqsz = sz; uvm_physseg_t x; - - search_again: - for (x = uvm_physseg_get_first(); + +search_again: + for (x = uvm_physseg_get_first(); uvm_physseg_valid_p(x); x = uvm_physseg_get_next(x)) { @@ -1226,7 +1226,7 @@ get_booted_kernel(void) return bibp ? bibp->bootpath : NULL; } -/* +/* * machine dependent system variables. */ static int @@ -1236,7 +1236,7 @@ sysctl_machdep_booted_kernel(SYSCTLFN_AR struct sysctlnode node; bibp = lookup_bootinfo(BTINFO_BOOTPATH); - if(!bibp) + if (!bibp) return ENOENT; /* ??? */ node = *rnode; @@ -1513,10 +1513,10 @@ cpu_initclocks(void) int x86_cpu_is_lcall(const void *ip) { - static const uint8_t lcall[] = { 0x9a, 0, 0, 0, 0 }; + static const uint8_t lcall[] = { 0x9a, 0, 0, 0, 0 }; int error; - const size_t sz = sizeof(lcall) + 2; - uint8_t tmp[sizeof(lcall) + 2]; + const size_t sz = sizeof(lcall) + 2; + uint8_t tmp[sizeof(lcall) + 2]; if ((error = copyin(ip, tmp, sz)) != 0) return error; @@ -1525,10 +1525,10 @@ x86_cpu_is_lcall(const void *ip) return EINVAL; switch (tmp[sz - 2]) { - case (uint8_t)0x07: /* NetBSD */ + case (uint8_t)0x07: /* NetBSD */ case (uint8_t)0x87: /* BSD/OS */ return 0; default: return EINVAL; - } + } }