CVS commit: src/sys/lib/libkern/arch/powerpc
Module Name:src Committed By: rin Date: Sat Jul 24 05:29:26 UTC 2021 Modified Files: src/sys/lib/libkern/arch/powerpc: Makefile.inc Log Message: For evbppc, use C version of memcpy(3), memcmp(3), and memmove(3) consistently for *.{po,pico,go} (for RUMP), in order to avoid alignment faults for 403. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/lib/libkern/arch/powerpc/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/lib/libkern/arch/powerpc/Makefile.inc diff -u src/sys/lib/libkern/arch/powerpc/Makefile.inc:1.31 src/sys/lib/libkern/arch/powerpc/Makefile.inc:1.32 --- src/sys/lib/libkern/arch/powerpc/Makefile.inc:1.31 Sat Jul 2 03:35:03 2011 +++ src/sys/lib/libkern/arch/powerpc/Makefile.inc Sat Jul 24 05:29:26 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.31 2011/07/02 03:35:03 matt Exp $ +# $NetBSD: Makefile.inc,v 1.32 2021/07/24 05:29:26 rin Exp $ SRCS+= bswap16.c bswap32.c SRCS+= htonl.c htons.c ntohl.c ntohs.c @@ -9,7 +9,9 @@ SRCS+= gprsavrest.S # Disable the asm versions on evbppc because they break the Explora .if ${MACHINE} == "evbppc" -memcpy.o: memcpy.c -memcmp.o: memcmp.c -memmove.o: memmove.c +. for name in memcmp memcpy memmove +.for suffix in o po pico go +${name}.${suffix}: ${name}.c +.endfor +. endfor .endif
CVS commit: src/lib/libc/arch/powerpc/string
Module Name:src Committed By: rin Date: Sat Jul 24 05:27:26 UTC 2021 Modified Files: src/lib/libc/arch/powerpc/string: Makefile.inc Log Message: For evbppc, use C version of bcopy(3), memcpy(3), memcmp(3), and memmove(3) consistently for debug library (*.go) in order to avoid alignment faults for 403. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/powerpc/string/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/powerpc/string/Makefile.inc diff -u src/lib/libc/arch/powerpc/string/Makefile.inc:1.13 src/lib/libc/arch/powerpc/string/Makefile.inc:1.14 --- src/lib/libc/arch/powerpc/string/Makefile.inc:1.13 Sun Mar 14 00:26:10 2010 +++ src/lib/libc/arch/powerpc/string/Makefile.inc Sat Jul 24 05:27:25 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.13 2010/03/14 00:26:10 mrg Exp $ +# $NetBSD: Makefile.inc,v 1.14 2021/07/24 05:27:25 rin Exp $ SRCS+= bzero.S ffs.S strlen.S NO_SRCS+= memset.S @@ -7,18 +7,11 @@ NO_SRCS+= memset.S # the special rules here are to override the suffix rules which seem # to prefer .S files over .c .if ${MACHINE} == "evbppc" -bcopy.o: bcopy.c -bcopy.po: bcopy.c -bcopy.pico: bcopy.c -memcpy.o: memcpy.c -memcpy.po: memcpy.c -memcpy.pico: memcpy.c -memcmp.o: memcmp.c -memcmp.po: memcmp.c -memcmp.pico: memcmp.c -memmove.o: memmove.c -memmove.po: memmove.c -memmove.pico: memmove.c +. for name in bcopy memcmp memcpy memmove +.for suffix in o po pico go +${name}.${suffix}: ${name}.c +.endfor +. endfor .else SRCS+= memcmp.S bcopy.S memcpy.S memmove.S .endif
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: oster Date: Fri Jul 23 22:34:12 UTC 2021 Modified Files: src/sys/dev/raidframe: rf_raid1.c Log Message: The number of components used must be at least 2. An odd number of components is not allowed. PR bin/45162 To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/dev/raidframe/rf_raid1.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/dev/raidframe/rf_raid1.c diff -u src/sys/dev/raidframe/rf_raid1.c:1.38 src/sys/dev/raidframe/rf_raid1.c:1.39 --- src/sys/dev/raidframe/rf_raid1.c:1.38 Fri Jul 23 00:54:45 2021 +++ src/sys/dev/raidframe/rf_raid1.c Fri Jul 23 22:34:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_raid1.c,v 1.38 2021/07/23 00:54:45 oster Exp $ */ +/* $NetBSD: rf_raid1.c,v 1.39 2021/07/23 22:34:12 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rf_raid1.c,v 1.38 2021/07/23 00:54:45 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_raid1.c,v 1.39 2021/07/23 22:34:12 oster Exp $"); #include "rf_raid.h" #include "rf_raid1.h" @@ -65,6 +65,11 @@ rf_ConfigureRAID1(RF_ShutdownList_t **li RF_Raid1ConfigInfo_t *info; RF_RowCol_t i; + /* Sanity check the number of columns... */ + if (raidPtr->numCol < 2 || raidPtr->numCol % 2 != 0) { + return (EINVAL); + } + /* create a RAID level 1 configuration structure */ info = RF_MallocAndAdd(sizeof(*info), raidPtr->cleanupList); if (info == NULL)
CVS commit: src/distrib/evbarm
Module Name:src Committed By: jmcneill Date: Fri Jul 23 21:53:34 UTC 2021 Modified Files: src/distrib/evbarm: Makefile Added Files: src/distrib/evbarm/liveimage: Makefile Makefile.liveimage src/distrib/evbarm/liveimage/armimage: Makefile dhcpcd ec2_init resize_gpt resize_root spec.armimage sshd Log Message: evbarm: Add build.sh live-image support for armv7/aarch64 To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/distrib/evbarm/Makefile cvs rdiff -u -r0 -r1.1 src/distrib/evbarm/liveimage/Makefile \ src/distrib/evbarm/liveimage/Makefile.liveimage cvs rdiff -u -r0 -r1.1 src/distrib/evbarm/liveimage/armimage/Makefile \ src/distrib/evbarm/liveimage/armimage/dhcpcd \ src/distrib/evbarm/liveimage/armimage/ec2_init \ src/distrib/evbarm/liveimage/armimage/resize_gpt \ src/distrib/evbarm/liveimage/armimage/resize_root \ src/distrib/evbarm/liveimage/armimage/spec.armimage \ src/distrib/evbarm/liveimage/armimage/sshd Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/evbarm/Makefile diff -u src/distrib/evbarm/Makefile:1.15 src/distrib/evbarm/Makefile:1.16 --- src/distrib/evbarm/Makefile:1.15 Mon Nov 16 11:38:29 2020 +++ src/distrib/evbarm/Makefile Fri Jul 23 21:53:33 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.15 2020/11/16 11:38:29 rin Exp $ +# $NetBSD: Makefile,v 1.16 2021/07/23 21:53:33 jmcneill Exp $ .include .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" @@ -8,6 +8,7 @@ SUBDIR= gzboot instkernel .if !empty(MACHINE_ARCH:Maarch64*) || !empty(MACHINE_ARCH:Mearmv7hf*) SUBDIR+= installimage +SUBDIR+= liveimage .endif .if !empty(MACHINE_ARCH:Maarch64*) SUBDIR+= isoimage @@ -27,6 +28,9 @@ iso_image: ${MAKEDIRTARGET} isoimage iso_image .endif +live_image: + ${MAKEDIRTARGET} liveimage live_image + install_image: ${MAKEDIRTARGET} installimage install_image Added files: Index: src/distrib/evbarm/liveimage/Makefile diff -u /dev/null src/distrib/evbarm/liveimage/Makefile:1.1 --- /dev/null Fri Jul 23 21:53:34 2021 +++ src/distrib/evbarm/liveimage/Makefile Fri Jul 23 21:53:33 2021 @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.1 2021/07/23 21:53:33 jmcneill Exp $ + +SUBDIR= armimage + +TARGETS+= release live_image + +.include Index: src/distrib/evbarm/liveimage/Makefile.liveimage diff -u /dev/null src/distrib/evbarm/liveimage/Makefile.liveimage:1.1 --- /dev/null Fri Jul 23 21:53:34 2021 +++ src/distrib/evbarm/liveimage/Makefile.liveimage Fri Jul 23 21:53:33 2021 @@ -0,0 +1,16 @@ +# $NetBSD: Makefile.liveimage,v 1.1 2021/07/23 21:53:33 jmcneill Exp $ + +.include + +.if !empty(MACHINE_ARCH:Maarch64*) +KERN_SET= kern-GENERIC64 +EFIBOOT= ${WORKDIR}/usr/mdec/bootaa64.efi +.else +KERN_SET= kern-GENERIC +EFIBOOT= ${WORKDIR}/usr/mdec/bootarm.efi +.endif + +USE_MBR= yes +USE_GPT= yes + +.include "${.CURDIR}/../../../common/bootimage/Makefile.liveimage" Index: src/distrib/evbarm/liveimage/armimage/Makefile diff -u /dev/null src/distrib/evbarm/liveimage/armimage/Makefile:1.1 --- /dev/null Fri Jul 23 21:53:34 2021 +++ src/distrib/evbarm/liveimage/armimage/Makefile Fri Jul 23 21:53:34 2021 @@ -0,0 +1,22 @@ +# $NetBSD: Makefile,v 1.1 2021/07/23 21:53:34 jmcneill Exp $ + +LIVEIMGBASE= NetBSD-${DISTRIBVER}-${MACHINE_ARCH}-live # gives ${IMGBASE}.img + +EMUIMAGEMB?= 1907 # 2GB USB flash memories aren't 2GiB +LIVEIMAGEMB= ${EMUIMAGEMB} +SWAPMB= 0 # No swap +IMAGEHOSTNAME= netbsd + +FILESDIR!= cd ${.CURDIR}/../../../utils/embedded/files ; pwd + +SPEC_EXTRA= ${.CURDIR}/spec.armimage +IMGFILE_EXTRA=\ + ${FILESDIR}/ec2_init etc/rc.d/ec2_init \ + ${FILESDIR}/resize_gpt etc/rc.d/resize_gpt \ + ${.CURDIR}/dhcpcd etc/rc.conf.d/dhcpcd \ + ${.CURDIR}/ec2_init etc/rc.conf.d/ec2_init \ + ${.CURDIR}/resize_gpt etc/rc.conf.d/resize_gpt \ + ${.CURDIR}/resize_root etc/rc.conf.d/resize_root \ + ${.CURDIR}/sshd etc/rc.conf.d/sshd + +.include "${.CURDIR}/../Makefile.liveimage" Index: src/distrib/evbarm/liveimage/armimage/dhcpcd diff -u /dev/null src/distrib/evbarm/liveimage/armimage/dhcpcd:1.1 --- /dev/null Fri Jul 23 21:53:34 2021 +++ src/distrib/evbarm/liveimage/armimage/dhcpcd Fri Jul 23 21:53:34 2021 @@ -0,0 +1,3 @@ +# $NetBSD: dhcpcd,v 1.1 2021/07/23 21:53:34 jmcneill Exp $ + +dhcpcd=YES Index: src/distrib/evbarm/liveimage/armimage/ec2_init diff -u /dev/null src/distrib/evbarm/liveimage/armimage/ec2_init:1.1 --- /dev/null Fri Jul 23 21:53:34 2021 +++ src/distrib/evbarm/liveimage/armimage/ec2_init Fri Jul 23 21:53:34 2021 @@ -0,0 +1,31 @@ +# $NetBSD: ec2_init,v 1.1 2021/07/23 21:53:34 jmcneill Exp $ + +is_ec2() { + val=NO + # Look for the string "amazon" in one of these sysctl nodes + for node in machdep.dmi.system-vendor \ + machdep.dmi.system-version \ + machdep.dmi.bios-version \ + machdep.xen.version ; do + if /sbin/sysctl -q $node; then + nodeval="$(/sbin/sysctl -n
CVS commit: src/sys/arch/arm/fdt
Module Name:src Committed By: jmcneill Date: Fri Jul 23 21:33:35 UTC 2021 Modified Files: src/sys/arch/arm/fdt: acpi_fdt.c Log Message: smbios: Support SMBIOS 2.x tables. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/fdt/acpi_fdt.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/arm/fdt/acpi_fdt.c diff -u src/sys/arch/arm/fdt/acpi_fdt.c:1.20 src/sys/arch/arm/fdt/acpi_fdt.c:1.21 --- src/sys/arch/arm/fdt/acpi_fdt.c:1.20 Thu Jul 22 00:47:55 2021 +++ src/sys/arch/arm/fdt/acpi_fdt.c Fri Jul 23 21:33:35 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_fdt.c,v 1.20 2021/07/22 00:47:55 jmcneill Exp $ */ +/* $NetBSD: acpi_fdt.c,v 1.21 2021/07/23 21:33:35 jmcneill Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -30,7 +30,7 @@ #include "opt_efi.h" #include -__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.20 2021/07/22 00:47:55 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.21 2021/07/23 21:33:35 jmcneill Exp $"); #include #include @@ -140,11 +140,36 @@ acpi_fdt_poweroff(device_t dev) psci_system_off(); } +static int +acpi_fdt_smbios_version(void) +{ + uint8_t *hdr; + int smbver; + + if (smbios_table == 0) { + return 0; + } + + hdr = AcpiOsMapMemory(smbios_table, 24); + if (hdr == NULL) { + return 0; + } + if (smbios3_check_header(hdr)) { + smbver = 3; + } else if (smbios2_check_header(hdr)) { + smbver = 2; + } else { + smbver = 0; + } + AcpiOsUnmapMemory(hdr, 24); + return smbver; +} + static void acpi_fdt_smbios_init(device_t dev) { - struct smb3hdr *sh; uint8_t *ptr; + int smbver; const int chosen = OF_finddevice("/chosen"); if (chosen >= 0) { @@ -154,29 +179,48 @@ acpi_fdt_smbios_init(device_t dev) return; } - sh = AcpiOsMapMemory(smbios_table, sizeof(*sh)); - if (sh == NULL) { - return; - } - if (!smbios3_check_header((uint8_t *)sh)) { - AcpiOsUnmapMemory(sh, sizeof(*sh)); - return; - } + smbver = acpi_fdt_smbios_version(); + if (smbver == 3) { + struct smb3hdr *sh = AcpiOsMapMemory(smbios_table, sizeof(*sh)); + if (sh == NULL) { + return; + } + + ptr = AcpiOsMapMemory(sh->addr, sh->size); + if (ptr != NULL) { + smbios_entry.addr = ptr; + smbios_entry.len = sh->size; + smbios_entry.rev = sh->eprev; + smbios_entry.mjr = sh->majrev; + smbios_entry.min = sh->minrev; + smbios_entry.doc = sh->docrev; + smbios_entry.count = UINT16_MAX; + } - ptr = AcpiOsMapMemory(sh->addr, sh->size); - if (ptr != NULL) { - smbios_entry.addr = ptr; - smbios_entry.len = sh->size; - smbios_entry.rev = sh->eprev; - smbios_entry.mjr = sh->majrev; - smbios_entry.min = sh->minrev; - smbios_entry.doc = sh->docrev; - smbios_entry.count = UINT16_MAX; - - device_printf(dev, "SMBIOS rev. %d.%d.%d @ 0x%lx\n", + aprint_normal_dev(dev, "SMBIOS rev. %d.%d.%d @ 0x%lx\n", sh->majrev, sh->minrev, sh->docrev, (u_long)sh->addr); + AcpiOsUnmapMemory(sh, sizeof(*sh)); + } else if (smbver == 2) { + struct smbhdr *sh = AcpiOsMapMemory(smbios_table, sizeof(*sh)); + if (sh == NULL) { + return; + } + + ptr = AcpiOsMapMemory(sh->addr, sh->size); + if (ptr != NULL) { + smbios_entry.addr = ptr; + smbios_entry.len = sh->size; + smbios_entry.rev = 0; + smbios_entry.mjr = sh->majrev; + smbios_entry.min = sh->minrev; + smbios_entry.doc = 0; + smbios_entry.count = sh->count; + } + + aprint_normal_dev(dev, "SMBIOS rev. %d.%d @ 0x%lx (%d entries)\n", + sh->majrev, sh->minrev, (u_long)sh->addr, sh->count); + AcpiOsUnmapMemory(sh, sizeof(*sh)); } - AcpiOsUnmapMemory(sh, sizeof(*sh)); } static void
CVS commit: src/sys/stand/efiboot
Module Name:src Committed By: jmcneill Date: Fri Jul 23 21:33:00 UTC 2021 Modified Files: src/sys/stand/efiboot: efiacpi.c smbios.c Log Message: efiboot: Add support for SMBIOS 2.x tables. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/stand/efiboot/efiacpi.c cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/smbios.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/stand/efiboot/efiacpi.c diff -u src/sys/stand/efiboot/efiacpi.c:1.9 src/sys/stand/efiboot/efiacpi.c:1.10 --- src/sys/stand/efiboot/efiacpi.c:1.9 Fri May 21 21:53:15 2021 +++ src/sys/stand/efiboot/efiacpi.c Fri Jul 23 21:33:00 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: efiacpi.c,v 1.9 2021/05/21 21:53:15 jmcneill Exp $ */ +/* $NetBSD: efiacpi.c,v 1.10 2021/07/23 21:33:00 jmcneill Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -52,10 +52,11 @@ struct acpi_rdsp { static EFI_GUID Acpi20TableGuid = ACPI_20_TABLE_GUID; static EFI_GUID Smbios3TableGuid = SMBIOS3_TABLE_GUID; +static EFI_GUID SmbiosTableGuid = SMBIOS_TABLE_GUID; static int acpi_enable = 1; static void *acpi_root = NULL; -static void *smbios3_table = NULL; +static void *smbios_table = NULL; int efi_acpi_probe(void) @@ -66,9 +67,13 @@ efi_acpi_probe(void) if (EFI_ERROR(status)) return EIO; - status = LibGetSystemConfigurationTable(, _table); - if (EFI_ERROR(status)) - smbios3_table = NULL; + status = LibGetSystemConfigurationTable(, _table); + if (EFI_ERROR(status)) { + status = LibGetSystemConfigurationTable(, _table); + } + if (EFI_ERROR(status)) { + smbios_table = NULL; + } return 0; } @@ -103,8 +108,8 @@ efi_acpi_get_model(void) memset(model_buf, 0, sizeof(model_buf)); - if (smbios3_table != NULL) { - smbios_init(smbios3_table); + if (smbios_table != NULL) { + smbios_init(smbios_table); buf = model_buf; smbios.cookie = 0; @@ -136,7 +141,7 @@ efi_acpi_show(void) rsdp->oemid[0], rsdp->oemid[1], rsdp->oemid[2], rsdp->oemid[3], rsdp->oemid[4], rsdp->oemid[5]); - if (smbios3_table) + if (smbios_table) printf("SMBIOS: %s\n", efi_acpi_get_model()); } @@ -166,8 +171,8 @@ efi_acpi_create_fdt(void) fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"), "chosen"); fdt_setprop_u64(fdt, fdt_path_offset(fdt, "/chosen"), "netbsd,acpi-root-table", (uint64_t)(uintptr_t)acpi_root); - if (smbios3_table) - fdt_setprop_u64(fdt, fdt_path_offset(fdt, "/chosen"), "netbsd,smbios-table", (uint64_t)(uintptr_t)smbios3_table); + if (smbios_table) + fdt_setprop_u64(fdt, fdt_path_offset(fdt, "/chosen"), "netbsd,smbios-table", (uint64_t)(uintptr_t)smbios_table); fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"), "acpi"); fdt_setprop_string(fdt, fdt_path_offset(fdt, "/acpi"), "compatible", "netbsd,acpi"); Index: src/sys/stand/efiboot/smbios.c diff -u src/sys/stand/efiboot/smbios.c:1.2 src/sys/stand/efiboot/smbios.c:1.3 --- src/sys/stand/efiboot/smbios.c:1.2 Fri Dec 27 09:45:27 2019 +++ src/sys/stand/efiboot/smbios.c Fri Jul 23 21:33:00 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: smbios.c,v 1.2 2019/12/27 09:45:27 msaitoh Exp $ */ +/* $NetBSD: smbios.c,v 1.3 2021/07/23 21:33:00 jmcneill Exp $ */ /* * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -82,7 +82,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smbios.c,v 1.2 2019/12/27 09:45:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smbios.c,v 1.3 2021/07/23 21:33:00 jmcneill Exp $"); #include @@ -91,8 +91,22 @@ __KERNEL_RCSID(0, "$NetBSD: smbios.c,v 1 struct smbios_entry smbios_entry; -void -smbios_init(uint8_t *p) +static void +smbios2_init(uint8_t *p) +{ + const struct smbhdr *sh = (const struct smbhdr *)p; + + smbios_entry.addr = (void *)(uintptr_t)sh->addr; + smbios_entry.len = sh->size; + smbios_entry.rev = 0; + smbios_entry.mjr = sh->majrev; + smbios_entry.min = sh->minrev; + smbios_entry.doc = 0; + smbios_entry.count = sh->count; +} + +static void +smbios3_init(uint8_t *p) { const struct smb3hdr *sh = (const struct smb3hdr *)p; @@ -105,6 +119,16 @@ smbios_init(uint8_t *p) smbios_entry.count = UINT16_MAX; } +void +smbios_init(uint8_t *p) +{ + if (memcmp(p, "_SM3_", 5) == 0) { + smbios3_init(p); + } else if (memcmp(p, "_SM_", 4) == 0) { + smbios2_init(p); + } +} + /* * smbios_find_table() takes a caller supplied smbios struct type and * a pointer to a handle (struct smbtable) returning one if the structure @@ -121,6 +145,10 @@ smbios_find_table(uint8_t type, struct s struct smbtblhdr *hdr; int ret = 0, tcount = 1; + if (smbios_entry.addr == 0) { + return 0; + } + va = smbios_entry.addr; end = va + smbios_entry.len; @@ -173,6 +201,10 @@ smbios_get_string(struct smbtable *st, u char *ret = NULL; int i; + if (smbios_entry.addr == 0) { + return NULL; + } + va = (uint8_t *)st->hdr + st->hdr->size; end = smbios_entry.addr + smbios_entry.len; for (i = 1; va < end && i < indx && *va; i++)
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: oster Date: Fri Jul 23 20:18:24 UTC 2021 Modified Files: src/sys/dev/raidframe: rf_diskqueue.c rf_diskqueue.h rf_fifo.c rf_fifo.h rf_sstf.c rf_sstf.h Log Message: Various disk queue "peek" routines were only ever used in the simulator version of RAIDFrame. Remove them from here. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/dev/raidframe/rf_diskqueue.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/raidframe/rf_diskqueue.h cvs rdiff -u -r1.16 -r1.17 src/sys/dev/raidframe/rf_fifo.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/raidframe/rf_fifo.h cvs rdiff -u -r1.17 -r1.18 src/sys/dev/raidframe/rf_sstf.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/raidframe/rf_sstf.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/raidframe/rf_diskqueue.c diff -u src/sys/dev/raidframe/rf_diskqueue.c:1.60 src/sys/dev/raidframe/rf_diskqueue.c:1.61 --- src/sys/dev/raidframe/rf_diskqueue.c:1.60 Fri Jul 23 00:54:45 2021 +++ src/sys/dev/raidframe/rf_diskqueue.c Fri Jul 23 20:18:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_diskqueue.c,v 1.60 2021/07/23 00:54:45 oster Exp $ */ +/* $NetBSD: rf_diskqueue.c,v 1.61 2021/07/23 20:18:24 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -66,7 +66,7 @@ / #include -__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.60 2021/07/23 00:54:45 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_diskqueue.c,v 1.61 2021/07/23 20:18:24 oster Exp $"); #include @@ -115,36 +115,31 @@ static const RF_DiskQueueSW_t diskqueues rf_FifoCreate, rf_FifoEnqueue, rf_FifoDequeue, - rf_FifoPeek, - rf_FifoPromote}, + rf_FifoPromote}, {"cvscan", /* cvscan */ rf_CvscanCreate, rf_CvscanEnqueue, rf_CvscanDequeue, - rf_CvscanPeek, - rf_CvscanPromote}, + rf_CvscanPromote}, {"sstf", /* shortest seek time first */ rf_SstfCreate, rf_SstfEnqueue, rf_SstfDequeue, - rf_SstfPeek, - rf_SstfPromote}, + rf_SstfPromote}, {"scan", /* SCAN (two-way elevator) */ rf_ScanCreate, rf_SstfEnqueue, rf_ScanDequeue, - rf_ScanPeek, - rf_SstfPromote}, + rf_SstfPromote}, {"cscan", /* CSCAN (one-way elevator) */ rf_CscanCreate, rf_SstfEnqueue, rf_CscanDequeue, - rf_CscanPeek, - rf_SstfPromote}, + rf_SstfPromote}, }; #define NUM_DISK_QUEUE_TYPES (sizeof(diskqueuesw)/sizeof(RF_DiskQueueSW_t)) Index: src/sys/dev/raidframe/rf_diskqueue.h diff -u src/sys/dev/raidframe/rf_diskqueue.h:1.27 src/sys/dev/raidframe/rf_diskqueue.h:1.28 --- src/sys/dev/raidframe/rf_diskqueue.h:1.27 Fri Jul 23 00:54:45 2021 +++ src/sys/dev/raidframe/rf_diskqueue.h Fri Jul 23 20:18:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_diskqueue.h,v 1.27 2021/07/23 00:54:45 oster Exp $ */ +/* $NetBSD: rf_diskqueue.h,v 1.28 2021/07/23 20:18:24 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -89,7 +89,6 @@ struct RF_DiskQueueSW_s { * system */ void(*Enqueue) (void *, RF_DiskQueueData_t *, int); /* enqueue routine */ RF_DiskQueueData_t *(*Dequeue) (void *); /* dequeue routine */ - RF_DiskQueueData_t *(*Peek) (void *); /* peek at head of queue */ /* the rest are optional: they improve performance, but the driver * will deal with it if they don't exist */ Index: src/sys/dev/raidframe/rf_fifo.c diff -u src/sys/dev/raidframe/rf_fifo.c:1.16 src/sys/dev/raidframe/rf_fifo.c:1.17 --- src/sys/dev/raidframe/rf_fifo.c:1.16 Sat Feb 9 03:34:00 2019 +++ src/sys/dev/raidframe/rf_fifo.c Fri Jul 23 20:18:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_fifo.c,v 1.16 2019/02/09 03:34:00 christos Exp $ */ +/* $NetBSD: rf_fifo.c,v 1.17 2021/07/23 20:18:24 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -36,7 +36,7 @@ ***/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.16 2019/02/09 03:34:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.17 2021/07/23 20:18:24 oster Exp $"); #include @@ -147,23 +147,6 @@ rf_FifoDequeue(void *q_in) return (nd); } -/* Return ptr to item at head of queue. Used to examine request - * info without actually dequeueing the request. - */ -RF_DiskQueueData_t * -rf_FifoPeek(void *q_in) -{ - RF_DiskQueueData_t *headElement = NULL; - RF_FifoHeader_t *q = (RF_FifoHeader_t *) q_in; - - RF_ASSERT(q); - if (q->hq_head) - headElement = q->hq_head; - else - if (q->lq_head) - headElement = q->lq_head; - return (headElement); -} /* We sometimes need to promote a low priority access to a regular priority access. * Currently, this is only used when the user wants to write a stripe which is currently * under reconstruction. Index: src/sys/dev/raidframe/rf_fifo.h diff -u src/sys/dev/raidframe/rf_fifo.h:1.6
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Fri Jul 23 17:06:37 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: func.c lint1.h Log Message: lint: rename cstk_t to control_statement Rename the variables as well. Their previous name 'ci' was not easy to understand, the 'i' may have meant 'stack item'. The new name 'cs' simply means 'control statement'. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.114 -r1.115 src/usr.bin/xlint/lint1/func.c cvs rdiff -u -r1.117 -r1.118 src/usr.bin/xlint/lint1/lint1.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/func.c diff -u src/usr.bin/xlint/lint1/func.c:1.114 src/usr.bin/xlint/lint1/func.c:1.115 --- src/usr.bin/xlint/lint1/func.c:1.114 Tue Jul 20 19:35:53 2021 +++ src/usr.bin/xlint/lint1/func.c Fri Jul 23 17:06:37 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: func.c,v 1.114 2021/07/20 19:35:53 rillig Exp $ */ +/* $NetBSD: func.c,v 1.115 2021/07/23 17:06:37 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: func.c,v 1.114 2021/07/20 19:35:53 rillig Exp $"); +__RCSID("$NetBSD: func.c,v 1.115 2021/07/23 17:06:37 rillig Exp $"); #endif #include @@ -76,7 +76,7 @@ bool warn_about_unreachable; bool seen_fallthrough; /* The innermost control statement */ -cstk_t *cstmt; +control_statement *cstmt; /* * Number of arguments which will be checked for usage in following @@ -155,12 +155,12 @@ bool quadflg; void begin_control_statement(control_statement_kind kind) { - cstk_t *ci; + control_statement *cs; - ci = xcalloc(1, sizeof(*ci)); - ci->c_kind = kind; - ci->c_surrounding = cstmt; - cstmt = ci; + cs = xcalloc(1, sizeof(*cs)); + cs->c_kind = kind; + cs->c_surrounding = cstmt; + cstmt = cs; } /* @@ -169,7 +169,7 @@ begin_control_statement(control_statemen void end_control_statement(control_statement_kind kind) { - cstk_t *ci; + control_statement *cs; case_label_t *cl, *next; lint_assert(cstmt != NULL); @@ -177,16 +177,16 @@ end_control_statement(control_statement_ while (cstmt->c_kind != kind) cstmt = cstmt->c_surrounding; - ci = cstmt; - cstmt = ci->c_surrounding; + cs = cstmt; + cstmt = cs->c_surrounding; - for (cl = ci->c_case_labels; cl != NULL; cl = next) { + for (cl = cs->c_case_labels; cl != NULL; cl = next) { next = cl->cl_next; free(cl); } - free(ci->c_switch_type); - free(ci); + free(cs->c_switch_type); + free(cs); } static void @@ -465,32 +465,32 @@ check_case_label_bitand(const tnode_t *c } static void -check_case_label_enum(const tnode_t *tn, const cstk_t *ci) +check_case_label_enum(const tnode_t *tn, const control_statement *cs) { /* similar to typeok_enum in tree.c */ - if (!(tn->tn_type->t_is_enum || ci->c_switch_type->t_is_enum)) + if (!(tn->tn_type->t_is_enum || cs->c_switch_type->t_is_enum)) return; - if (tn->tn_type->t_is_enum && ci->c_switch_type->t_is_enum && - tn->tn_type->t_enum == ci->c_switch_type->t_enum) + if (tn->tn_type->t_is_enum && cs->c_switch_type->t_is_enum && + tn->tn_type->t_enum == cs->c_switch_type->t_enum) return; #if 0 /* not yet ready, see msg_130.c */ /* enum type mismatch: '%s' '%s' '%s' */ - warning(130, type_name(ci->c_switch_type), op_name(EQ), + warning(130, type_name(cs->c_switch_type), op_name(EQ), type_name(tn->tn_type)); #endif } static void -check_case_label(tnode_t *tn, cstk_t *ci) +check_case_label(tnode_t *tn, control_statement *cs) { case_label_t *cl; val_t *v; val_t nv; tspec_t t; - if (ci == NULL) { + if (cs == NULL) { /* case not in switch */ error(195); return; @@ -508,10 +508,10 @@ check_case_label(tnode_t *tn, cstk_t *ci return; } - check_case_label_bitand(tn, ci->c_switch_expr); - check_case_label_enum(tn, ci); + check_case_label_bitand(tn, cs->c_switch_expr); + check_case_label_enum(tn, cs); - lint_assert(ci->c_switch_type != NULL); + lint_assert(cs->c_switch_type != NULL); if (reached && !seen_fallthrough) { if (hflag) @@ -533,11 +533,11 @@ check_case_label(tnode_t *tn, cstk_t *ci */ v = constant(tn, true); (void)memset(, 0, sizeof(nv)); - convert_constant(CASE, 0, ci->c_switch_type, , v); + convert_constant(CASE, 0, cs->c_switch_type, , v); free(v); /* look if we had this value already */ - for (cl = ci->c_case_labels; cl != NULL; cl = cl->cl_next) { + for (cl = cs->c_case_labels; cl != NULL; cl = cl->cl_next) { if (cl->cl_val.v_quad == nv.v_quad) break; } @@ -553,21 +553,21 @@ check_case_label(tnode_t *tn, cstk_t *ci /* append the value to the list of case values */ cl = xcalloc(1, sizeof(*cl)); cl->cl_val = nv; - cl->cl_next = ci->c_case_labels; - ci->c_case_labels = cl; + cl->cl_next = cs->c_case_labels; + cs->c_case_labels = cl; } } void case_label(tnode_t *tn) { - cstk_t *ci; +
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Fri Jul 23 16:48:48 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: decl.c lint1.h Log Message: lint: remove a few unnecessary abbreviations No functional change. To generate a diff of this commit: cvs rdiff -u -r1.208 -r1.209 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.116 -r1.117 src/usr.bin/xlint/lint1/lint1.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.208 src/usr.bin/xlint/lint1/decl.c:1.209 --- src/usr.bin/xlint/lint1/decl.c:1.208 Fri Jul 23 16:43:11 2021 +++ src/usr.bin/xlint/lint1/decl.c Fri Jul 23 16:48:48 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.208 2021/07/23 16:43:11 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.209 2021/07/23 16:48:48 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.208 2021/07/23 16:43:11 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.209 2021/07/23 16:48:48 rillig Exp $"); #endif #include @@ -236,11 +236,7 @@ add_storage_class(scl_t sc) if (dcs->d_scl == NOSCL) { dcs->d_scl = sc; } else { - /* - * multiple storage classes. An error will be reported in - * end_type(). - */ - dcs->d_mscl = true; + dcs->d_multiple_storage_classes = true; } } @@ -284,11 +280,7 @@ add_type(type_t *tp) */ if (dcs->d_type != NULL || dcs->d_abstract_type != NOTSPEC || dcs->d_rank_mod != NOTSPEC || dcs->d_sign_mod != NOTSPEC) { - /* - * remember that an error must be reported in - * end_type(). - */ - dcs->d_terr = true; + dcs->d_invalid_type_combination = true; dcs->d_abstract_type = NOTSPEC; dcs->d_sign_mod = NOTSPEC; dcs->d_rank_mod = NOTSPEC; @@ -302,7 +294,7 @@ add_type(type_t *tp) * something like "struct a int" * struct/union/enum with anything else is not allowed */ - dcs->d_terr = true; + dcs->d_invalid_type_combination = true; return; } @@ -341,11 +333,8 @@ add_type(type_t *tp) * dcs->d_sign_mod */ if (dcs->d_sign_mod != NOTSPEC) - /* - * more than one "signed" and/or "unsigned"; print - * an error in end_type() - */ - dcs->d_terr = true; + /* more than one "signed" and/or "unsigned" */ + dcs->d_invalid_type_combination = true; dcs->d_sign_mod = t; } else if (t == SHORT || t == LONG || t == QUAD) { /* @@ -353,18 +342,17 @@ add_type(type_t *tp) * dcs->d_rank_mod */ if (dcs->d_rank_mod != NOTSPEC) - /* more than one, print error in end_type() */ - dcs->d_terr = true; + dcs->d_invalid_type_combination = true; dcs->d_rank_mod = t; } else if (t == FLOAT || t == DOUBLE) { if (dcs->d_rank_mod == NOTSPEC || dcs->d_rank_mod == LONG) { if (dcs->d_complex_mod != NOTSPEC || (t == FLOAT && dcs->d_rank_mod == LONG)) -dcs->d_terr = true; +dcs->d_invalid_type_combination = true; dcs->d_complex_mod = t; } else { if (dcs->d_abstract_type != NOTSPEC) -dcs->d_terr = true; +dcs->d_invalid_type_combination = true; dcs->d_abstract_type = t; } } else if (t == PTR) { @@ -375,8 +363,7 @@ add_type(type_t *tp) * or "_Complex" in dcs->d_abstract_type */ if (dcs->d_abstract_type != NOTSPEC) - /* more than one, print error in end_type() */ - dcs->d_terr = true; + dcs->d_invalid_type_combination = true; dcs->d_abstract_type = t; } } @@ -491,7 +478,7 @@ tdeferr(type_t *td, tspec_t t) /* Anything other is not accepted. */ - dcs->d_terr = true; + dcs->d_invalid_type_combination = true; return td; } @@ -738,8 +725,8 @@ begin_type(void) dcs->d_const = false; dcs->d_volatile = false; dcs->d_inline = false; - dcs->d_mscl = false; - dcs->d_terr = false; + dcs->d_multiple_storage_classes = false; + dcs->d_invalid_type_combination = false; dcs->d_nonempty_decl = false; dcs->d_notyp = false; } @@ -801,7 +788,7 @@ dcs_merge_declaration_specifiers(void) if (s == NOTSPEC && t == INT) s = SIGNED; if (l != NOTSPEC && t == CHAR) { - dcs->d_terr = true; + dcs->d_invalid_type_combination = true; l = NOTSPEC; } if (l == LONG && t == FLOAT) { @@ -825,7 +812,7 @@ dcs_merge_declaration_specifiers(void) } if (t != INT && t != CHAR && (s != NOTSPEC || l != NOTSPEC)) { - dcs->d_terr = true; + dcs->d_invalid_type_combination = true; l = s = NOTSPEC; } if (l != NOTSPEC) @@ -845,11 +832,11 @@ end_type(void) dcs_merge_declaration_specifiers(); - if (dcs->d_mscl) { + if (dcs->d_multiple_storage_classes) { /* only one storage class allowed */ error(7); } - if (dcs->d_terr) { + if (dcs->d_invalid_type_combination) { /* illegal type combination */ error(4); } Index: src/usr.bin/xlint/lint1/lint1.h diff -u src/usr.bin/xlint/lint1/lint1.h:1.116 src/usr.bin/xlint/lint1/lint1.h:1.117 ---
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Fri Jul 23 16:43:11 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: decl.c lint1.h Log Message: lint: make offset and alignment positive numbers There's no use case for negative alignment or offsets in structures. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.207 -r1.208 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.115 -r1.116 src/usr.bin/xlint/lint1/lint1.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.207 src/usr.bin/xlint/lint1/decl.c:1.208 --- src/usr.bin/xlint/lint1/decl.c:1.207 Thu Jul 15 23:54:22 2021 +++ src/usr.bin/xlint/lint1/decl.c Fri Jul 23 16:43:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.207 2021/07/15 23:54:22 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.208 2021/07/23 16:43:11 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.207 2021/07/15 23:54:22 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.208 2021/07/23 16:43:11 rillig Exp $"); #endif #include @@ -64,7 +64,7 @@ dinfo_t *dcs; static type_t *tdeferr(type_t *, tspec_t); static void settdsym(type_t *, sym_t *); -static void align(int, int); +static void align(u_int, u_int); static sym_t *newtag(sym_t *, scl_t, bool, bool); static bool eqargs(const type_t *, const type_t *, bool *); static bool mnoarg(const type_t *, bool *); @@ -1154,7 +1154,7 @@ declarator_1_struct_union(sym_t *dsym) type_t *tp; tspec_t t; int sz; - int o = 0; /* Appease GCC */ + u_int o = 0; /* Appease GCC */ lint_assert(dsym->s_scl == MOS || dsym->s_scl == MOU); @@ -1231,9 +1231,9 @@ declarator_1_struct_union(sym_t *dsym) * al contains the required alignment, len the length of a bit-field. */ static void -align(int al, int len) +align(u_int al, u_int len) { - int no; + u_int no; /* * The alignment of the current element becomes the alignment of Index: src/usr.bin/xlint/lint1/lint1.h diff -u src/usr.bin/xlint/lint1/lint1.h:1.115 src/usr.bin/xlint/lint1/lint1.h:1.116 --- src/usr.bin/xlint/lint1/lint1.h:1.115 Thu Jul 15 18:13:25 2021 +++ src/usr.bin/xlint/lint1/lint1.h Fri Jul 23 16:43:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lint1.h,v 1.115 2021/07/15 18:13:25 rillig Exp $ */ +/* $NetBSD: lint1.h,v 1.116 2021/07/23 16:43:11 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -360,8 +360,8 @@ typedef struct dinfo { type_t *d_type; /* after end_type() pointer to the type used for all declarators */ sym_t *d_redeclared_symbol; - int d_offset; /* offset of next structure member */ - int d_sou_align_in_bits; /* alignment required for current + u_int d_offset; /* offset of next structure member */ + u_int d_sou_align_in_bits; /* alignment required for current * structure */ scl_t d_ctx; /* context of declaration */ bool d_const : 1; /* const in declaration specifiers */
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Fri Jul 23 15:36:57 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: lex.c Log Message: lint: write canonical form of keywords For keywords that have a single spelling variant (such as __packed), write this form in the source, to make it searchable. This also avoids a few calls to malloc. Previously, some keywords had leading underscores and some hadn't, this was inconsistent. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/usr.bin/xlint/lint1/lex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.55 src/usr.bin/xlint/lint1/lex.c:1.56 --- src/usr.bin/xlint/lint1/lex.c:1.55 Sun Jul 11 19:24:41 2021 +++ src/usr.bin/xlint/lint1/lex.c Fri Jul 23 15:36:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.55 2021/07/11 19:24:41 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.56 2021/07/23 15:36:56 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: lex.c,v 1.55 2021/07/11 19:24:41 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.56 2021/07/23 15:36:56 rillig Exp $"); #endif #include @@ -134,34 +134,26 @@ static struct kwtab { bool kw_attr : 1; /* GCC attribute, keyword */ u_int kw_deco : 3; /* 1 = name, 2 = __name, 4 = __name__ */ } kwtab[] = { -#ifdef INT128_SIZE - kwdef_type( "__int128_t", INT128, 0,1,0,0,1), - kwdef_type( "__uint128_t", UINT128, 0,1,0,0,1), -#endif - kwdef_tqual( "__thread", THREAD, 0,0,1,0,1), + kwdef_gcc_attr( "alias", T_AT_ALIAS), kwdef_keyword( "_Alignas", T_ALIGNAS), kwdef_keyword( "_Alignof", T_ALIGNOF), - kwdef_type( "_Bool", BOOL, 0,1,0,0,1), - kwdef_type( "_Complex", COMPLEX, 0,1,0,0,1), - kwdef_token( "_Generic", T_GENERIC, 0,1,0,0,1), - kwdef_token( "_Noreturn", T_NORETURN, 0,1,0,0,1), - kwdef_tqual( "_Thread_local", THREAD, 0,1,0,0,1), - kwdef_gcc_attr( "alias", T_AT_ALIAS), kwdef_gcc_attr( "aligned", T_AT_ALIGNED), - kwdef_token( "alignof", T_ALIGNOF, 0,0,0,0,4), + kwdef_token( "__alignof__", T_ALIGNOF, 0,0,0,0,1), kwdef_gcc_attr( "alloc_size", T_AT_ALLOC_SIZE), kwdef_gcc_attr( "always_inline",T_AT_ALWAYS_INLINE), kwdef_token( "asm", T_ASM, 0,0,1,0,7), kwdef_token( "attribute", T_ATTRIBUTE, 0,0,1,0,6), kwdef_sclass( "auto", AUTO, 0,0,0,0,1), + kwdef_type( "_Bool", BOOL, 0,1,0,0,1), kwdef_gcc_attr( "bounded", T_AT_BOUNDED), kwdef_keyword( "break", T_BREAK), kwdef_gcc_attr( "buffer", T_AT_BUFFER), - kwdef_token( "builtin_offsetof", T_BUILTIN_OFFSETOF, 0,0,1,0,2), + kwdef_token( "__builtin_offsetof", T_BUILTIN_OFFSETOF, 0,0,1,0,1), kwdef_keyword( "case", T_CASE), kwdef_type( "char", CHAR, 0,0,0,0,1), kwdef_gcc_attr( "cold", T_AT_COLD), kwdef_gcc_attr( "common", T_AT_COMMON), + kwdef_type( "_Complex", COMPLEX, 0,1,0,0,1), kwdef_tqual( "const", CONST, 1,0,0,0,7), kwdef_gcc_attr( "constructor", T_AT_CONSTRUCTOR), kwdef_keyword( "continue", T_CONTINUE), @@ -172,21 +164,25 @@ static struct kwtab { kwdef_type( "double", DOUBLE, 0,0,0,0,1), kwdef_keyword( "else", T_ELSE), kwdef_keyword( "enum", T_ENUM), - kwdef_token( "extension", T_EXTENSION, 0,0,1,0,4), + kwdef_token( "__extension__",T_EXTENSION, 0,0,1,0,1), kwdef_sclass( "extern", EXTERN, 0,0,0,0,1), kwdef_gcc_attr( "fallthrough", T_AT_FALLTHROUGH), kwdef_type( "float", FLOAT, 0,0,0,0,1), kwdef_keyword( "for", T_FOR), kwdef_gcc_attr( "format", T_AT_FORMAT), kwdef_gcc_attr( "format_arg", T_AT_FORMAT_ARG), + kwdef_token( "_Generic", T_GENERIC, 0,1,0,0,1), kwdef_gcc_attr( "gnu_inline", T_AT_GNU_INLINE), kwdef_gcc_attr( "gnu_printf", T_AT_FORMAT_GNU_PRINTF), kwdef_keyword( "goto", T_GOTO), kwdef_gcc_attr( "hot", T_AT_HOT), kwdef_keyword( "if", T_IF), - kwdef_token( "imag", T_IMAG, 0,0,1,0,4), + kwdef_token( "__imag__", T_IMAG, 0,0,1,0,1), kwdef_sclass( "inline", INLINE, 0,1,0,0,7), kwdef_type( "int", INT, 0,0,0,0,1), +#ifdef INT128_SIZE + kwdef_type( "__int128_t", INT128, 0,1,0,0,1), +#endif kwdef_type( "long", LONG, 0,0,0,0,1), kwdef_gcc_attr( "malloc", T_AT_MALLOC), kwdef_gcc_attr( "may_alias", T_AT_MAY_ALIAS), @@ -197,15 +193,16 @@ static struct kwtab { kwdef_gcc_attr( "noinline", T_AT_NOINLINE), kwdef_gcc_attr( "nonnull", T_AT_NONNULL), kwdef_gcc_attr( "nonstring", T_AT_NONSTRING), + kwdef_token( "_Noreturn", T_NORETURN, 0,1,0,0,1), kwdef_gcc_attr( "noreturn", T_AT_NORETURN), kwdef_gcc_attr( "nothrow", T_AT_NOTHROW), kwdef_gcc_attr( "optimize", T_AT_OPTIMIZE), kwdef_gcc_attr( "packed", T_AT_PACKED), - kwdef_token( "packed", T_PACKED, 0,0,0,0,2), + kwdef_token( "__packed", T_PACKED, 0,0,0,0,1), kwdef_gcc_attr( "pcs", T_AT_PCS), kwdef_gcc_attr( "printf", T_AT_FORMAT_PRINTF), kwdef_gcc_attr(
CVS commit: src/tests/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Fri Jul 23 15:21:47 UTC 2021 Modified Files: src/tests/usr.bin/xlint/lint1: decl.c decl.exp Log Message: tests/lint: test lexer for the GCC extension __thread To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/decl.exp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/xlint/lint1/decl.c diff -u src/tests/usr.bin/xlint/lint1/decl.c:1.9 src/tests/usr.bin/xlint/lint1/decl.c:1.10 --- src/tests/usr.bin/xlint/lint1/decl.c:1.9 Thu Jul 15 23:07:05 2021 +++ src/tests/usr.bin/xlint/lint1/decl.c Fri Jul 23 15:21:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.9 2021/07/15 23:07:05 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.10 2021/07/23 15:21:47 rillig Exp $ */ # 3 "decl.c" /* @@ -165,3 +165,9 @@ unsigned long sizes = sizeof(const typeof(signed_long)) + sizeof(const typeof(unsigned_long)) + sizeof(const typeof(unnamed_struct)); + +/* expect+1: syntax error 'int' [249] */ +thread int thread_int; +__thread int thread_int; +/* expect+1: syntax error 'int' [249] */ +__thread__ int thread_int; Index: src/tests/usr.bin/xlint/lint1/decl.exp diff -u src/tests/usr.bin/xlint/lint1/decl.exp:1.5 src/tests/usr.bin/xlint/lint1/decl.exp:1.6 --- src/tests/usr.bin/xlint/lint1/decl.exp:1.5 Wed Jul 14 20:39:13 2021 +++ src/tests/usr.bin/xlint/lint1/decl.exp Fri Jul 23 15:21:47 2021 @@ -9,4 +9,6 @@ decl.c(68): warning: converting 'pointer decl.c(70): warning: illegal combination of pointer (pointer to double) and integer (char), arg #1 [154] decl.c(72): warning: converting 'pointer to pointer to char' to incompatible 'pointer to double' for argument 1 [153] decl.c(80): error: syntax error '"' [249] +decl.c(170): error: syntax error 'int' [249] +decl.c(173): error: syntax error 'int' [249] decl.c(114): warning: static function unused unused [236]
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Fri Jul 23 15:14:49 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: cgram.y Log Message: lint: move single semicolon to external_declaration This aligns more closely with the grammar from GCC's parser. The global cleanup from the grammar rule 'external_declaration: top_level_declaration' is not performed anymore, which doesn't matter since there is nothing to clean up after a single semicolon. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.334 -r1.335 src/usr.bin/xlint/lint1/cgram.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.334 src/usr.bin/xlint/lint1/cgram.y:1.335 --- src/usr.bin/xlint/lint1/cgram.y:1.334 Wed Jul 21 21:24:45 2021 +++ src/usr.bin/xlint/lint1/cgram.y Fri Jul 23 15:14:49 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.334 2021/07/21 21:24:45 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.335 2021/07/23 15:14:49 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.334 2021/07/21 21:24:45 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.335 2021/07/23 15:14:49 rillig Exp $"); #endif #include @@ -1870,8 +1870,7 @@ translation_unit: /* C99 6.9 */ ; external_declaration: /* C99 6.9 */ - asm_statement - | function_definition { + function_definition { global_clean_up_decl(false); clear_warning_flags(); } @@ -1879,6 +1878,16 @@ external_declaration: /* C99 6.9 */ global_clean_up_decl(false); clear_warning_flags(); } + | asm_statement /* GCC extension */ + | T_SEMI { /* GCC extension */ + if (sflag) { + /* empty declaration */ + error(0); + } else if (!tflag) { + /* empty declaration */ + warning(0); + } + } ; /* @@ -1891,16 +1900,7 @@ external_declaration: /* C99 6.9 */ * See 'declaration' for all other declarations. */ top_level_declaration: /* C99 6.9 calls this 'declaration' */ - T_SEMI { - if (sflag) { - /* empty declaration */ - error(0); - } else if (!tflag) { - /* empty declaration */ - warning(0); - } - } - | begin_type end_type notype_init_declarators T_SEMI { + begin_type end_type notype_init_declarators T_SEMI { if (sflag) { /* old style declaration; add 'int' */ error(1);
CVS commit: src/sys/arch/alpha/conf
Module Name:src Committed By: thorpej Date: Fri Jul 23 14:38:58 UTC 2021 Modified Files: src/sys/arch/alpha/conf: GENERIC INSTALL Log Message: Use wildcard matches more consistently, and attach pci, eisa, isa, and usb to their interface attributes, which makes for easier trimming-down with "no" directives. To generate a diff of this commit: cvs rdiff -u -r1.412 -r1.413 src/sys/arch/alpha/conf/GENERIC cvs rdiff -u -r1.117 -r1.118 src/sys/arch/alpha/conf/INSTALL 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/alpha/conf/GENERIC diff -u src/sys/arch/alpha/conf/GENERIC:1.412 src/sys/arch/alpha/conf/GENERIC:1.413 --- src/sys/arch/alpha/conf/GENERIC:1.412 Tue Jun 29 10:22:34 2021 +++ src/sys/arch/alpha/conf/GENERIC Fri Jul 23 14:38:58 2021 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.412 2021/06/29 10:22:34 nia Exp $ +# $NetBSD: GENERIC,v 1.413 2021/07/23 14:38:58 thorpej Exp $ # # This machine description file is used to generate the default NetBSD # kernel. @@ -19,7 +19,7 @@ include "arch/alpha/conf/std.alpha" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -ident "GENERIC-$Revision: 1.412 $" +ident "GENERIC-$Revision: 1.413 $" maxusers 32 @@ -184,11 +184,11 @@ config netbsd root on ? type ? #config netbsd root on ? type nfs mainbus0 at root -cpu* at mainbus0 -qemu* at mainbus0 +cpu* at mainbus? +qemu* at mainbus? # TurboLaser bus support and devices -tlsb* at mainbus0 +tlsb* at mainbus? gbus* at tlsb? node ? offset ? tlsbmem* at tlsb? node ? offset ? kft* at tlsb? node ? offset ? @@ -197,19 +197,19 @@ kft* at tlsb? node ? offset ? mcclock* at gbus? offset ? # MCBUS bus support -mcbus* at mainbus0 +mcbus* at mainbus? mcmem* at mcbus? mid ? #i2c at mcbus? #EV6 Tsunami Core Logic -tsc* at mainbus0 +tsc* at mainbus? tsciic* at tsc? iic* at tsciic? # DECpc AXP150 (Jensen) internal bus support -jensenio* at mainbus0 +jensenio* at mainbus? com* at jensenio? port ? lpt* at jensenio? port ? @@ -217,7 +217,7 @@ mcclock* at jensenio? port ? pckbc* at jensenio? port ? # TURBOchannel host bus adapter support -tcasic* at mainbus0 +tcasic* at mainbus? # TURBOchannel bus support tc* at tcasic? @@ -269,18 +269,10 @@ pckbc* at sableio? port ? fdc* at sableio? port ? # PCI bus support -pci* at apecs? -pci* at cia? -pci* at irongate? -pci* at lca? -pci* at ppb? -pci* at dwlpx? -pci* at mcpcia? -pci* at tsp? -pci* at ttwopci? +pci* at pcibus? # "pcibus" interface attribute # AGP support -agp* at irongate? +agp* at agpbus? # "agpbus" interface attribute # PCI devices @@ -404,11 +396,8 @@ tqphy* at mii? phy ? # TDK Semiconduct ukphy* at mii? phy ? # generic unknown PHYs # ISA/EISA bus support -isa* at jensenio? -eisa* at jensenio? -isa* at pceb? -eisa* at pceb? -isa* at sio? +isa* at isabus? # "isabus" interface attribute +eisa* at eisabus? # "eisabus" interface attribute #isapnp* at isa? # ISA devices @@ -550,11 +539,7 @@ iic* at alipm? slhci* at pcmcia? function ? # ScanLogic SL811HS # USB bus support -usb* at xhci? -usb* at ehci? -usb* at ohci? -usb* at slhci? -usb* at uhci? +usb* at usbus? # "usbus" interface attribute # USB Hubs uhub* at usb? Index: src/sys/arch/alpha/conf/INSTALL diff -u src/sys/arch/alpha/conf/INSTALL:1.117 src/sys/arch/alpha/conf/INSTALL:1.118 --- src/sys/arch/alpha/conf/INSTALL:1.117 Mon Sep 28 03:48:12 2020 +++ src/sys/arch/alpha/conf/INSTALL Fri Jul 23 14:38:58 2021 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.117 2020/09/28 03:48:12 thorpej Exp $ +# $NetBSD: INSTALL,v 1.118 2021/07/23 14:38:58 thorpej Exp $ # # Alpha INSTALL kernel. @@ -86,11 +86,11 @@ options WSEMUL_VT100 config netbsd root on ? type ? mainbus0 at root -cpu* at mainbus0 -qemu* at mainbus0 +cpu* at mainbus? +qemu* at mainbus? # TurboLaser bus support and devices -tlsb* at mainbus0 +tlsb* at mainbus? gbus* at tlsb? node ? offset ? tlsbmem* at tlsb? node ? offset ? kft* at tlsb? node ? offset ? @@ -99,15 +99,15 @@ kft* at tlsb? node ? offset ? mcclock* at gbus? offset ? # MCBUS bus support -mcbus* at mainbus0 +mcbus* at mainbus? mcmem* at mcbus? mid ? #EV6 Tsunami Core Logic -tsc* at mainbus0 +tsc* at mainbus? # DECpc AXP150 (Jensen) internal bus support -jensenio* at mainbus0 +jensenio* at mainbus? com* at jensenio? port ? lpt* at jensenio? port ? @@ -115,7 +115,7 @@ mcclock* at jensenio? port ? pckbc* at jensenio? port ? # TURBOchannel host bus adapter support -tcasic* at mainbus0 +tcasic* at mainbus? # TURBOchannel bus support tc* at tcasic? @@ -164,18 +164,10 @@ pckbc* at sableio? port ? fdc* at sableio? port ? # PCI bus support -pci* at apecs? -pci* at cia? -pci* at irongate? -pci* at lca? -pci* at ppb? -pci* at dwlpx? -pci* at mcpcia? -pci* at tsp? -pci* at ttwopci? +pci* at pcibus? # "pcibus" interface attribute # AGP support -agp* at