From owner-svn-src-all@freebsd.org Thu Feb 20 00:46:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 491EC249A55; Thu, 20 Feb 2020 00:46:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48NG9r1Fydz3PbF; Thu, 20 Feb 2020 00:46:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8D701965E; Thu, 20 Feb 2020 00:46:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01K0kNW9061988; Thu, 20 Feb 2020 00:46:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01K0kM68061982; Thu, 20 Feb 2020 00:46:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002200046.01K0kM68061982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 20 Feb 2020 00:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358136 - in head/stand: efi/loader i386/libi386 i386/loader libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: efi/loader i386/libi386 i386/loader libsa X-SVN-Commit-Revision: 358136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2020 00:46:24 -0000 Author: imp Date: Thu Feb 20 00:46:22 2020 New Revision: 358136 URL: https://svnweb.freebsd.org/changeset/base/358136 Log: Move smbios.c to libsa. smbios used to be an i386 only kinda weird quirk to the x86 architecture. But UEFI picked it up, dusted it off and now it's many other locations. Make it base technology by moving it to libsa and fixing up the compliation. The code has issues with unaligned access still, but that will be addressed in a followup commit. Differential Revision: https://reviews.freebsd.org/D23660 Added: head/stand/libsa/smbios.c (contents, props changed) - copied, changed from r358135, head/stand/i386/libi386/smbios.c head/stand/libsa/smbios.h (contents, props changed) - copied, changed from r358135, head/stand/i386/libi386/smbios.h Deleted: head/stand/i386/libi386/smbios.c head/stand/i386/libi386/smbios.h Modified: head/stand/efi/loader/Makefile head/stand/i386/libi386/Makefile head/stand/i386/loader/main.c head/stand/libsa/Makefile Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Thu Feb 20 00:46:16 2020 (r358135) +++ head/stand/efi/loader/Makefile Thu Feb 20 00:46:22 2020 (r358136) @@ -22,7 +22,6 @@ SRCS= autoload.c \ framebuffer.c \ main.c \ self_reloc.c \ - smbios.c \ vers.c CFLAGS+= -I${.CURDIR}/../loader @@ -45,8 +44,6 @@ CWARNFLAGS.main.c+= -Wno-format .PATH: ${.CURDIR}/../loader .PATH: ${.CURDIR}/../loader/arch/${MACHINE} -# For smbios.c XXX need to abstract properly -.PATH: ${BOOTSRC}/i386/libi386 .include "${.CURDIR}/../loader/arch/${MACHINE}/Makefile.inc" CFLAGS+= -I${.CURDIR} @@ -56,18 +53,6 @@ CFLAGS+= -I${EFISRC}/include/${MACHINE} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -DEFI - -.if !defined(BOOT_HIDE_SERIAL_NUMBERS) -# Export serial numbers, UUID, and asset tag from loader. -CFLAGS+= -DSMBIOS_SERIAL_NUMBERS -.if defined(BOOT_LITTLE_ENDIAN_UUID) -# Use little-endian UUID format as defined in SMBIOS 2.6. -CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID -.elif defined(BOOT_NETWORK_ENDIAN_UUID) -# Use network-endian UUID format for backward compatibility. -CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID -.endif -.endif .if defined(HAVE_FDT) && ${MK_FDT} != "no" .include "${BOOTSRC}/fdt.mk" Modified: head/stand/i386/libi386/Makefile ============================================================================== --- head/stand/i386/libi386/Makefile Thu Feb 20 00:46:16 2020 (r358135) +++ head/stand/i386/libi386/Makefile Thu Feb 20 00:46:22 2020 (r358136) @@ -9,7 +9,7 @@ SRCS= bio.c biosacpi.c biosdisk.c biosmem.c biospnp.c comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.S \ - smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c + time.c vidconsole.c amd64_tramp.S spinconsole.c .PATH: ${ZFSSRC} SRCS+= devicename_stubs.c CFLAGS+= -I${ZFSSRC} @@ -26,18 +26,6 @@ CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} .ifdef(BOOT_BIOSDISK_DEBUG) # Make the disk code more talkative CFLAGS+= -DDISK_DEBUG -.endif - -.if !defined(BOOT_HIDE_SERIAL_NUMBERS) -# Export serial numbers, UUID, and asset tag from loader. -CFLAGS+= -DSMBIOS_SERIAL_NUMBERS -.if defined(BOOT_LITTLE_ENDIAN_UUID) -# Use little-endian UUID format as defined in SMBIOS 2.6. -CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID -.elif defined(BOOT_NETWORK_ENDIAN_UUID) -# Use network-endian UUID format for backward compatibility. -CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID -.endif .endif # terminal emulation Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Thu Feb 20 00:46:16 2020 (r358135) +++ head/stand/i386/loader/main.c Thu Feb 20 00:46:22 2020 (r358136) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "common/bootargs.h" #include "libi386/libi386.h" -#include "libi386/smbios.h" +#include #include "btxv86.h" #ifdef LOADER_ZFS_SUPPORT Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Thu Feb 20 00:46:16 2020 (r358135) +++ head/stand/libsa/Makefile Thu Feb 20 00:46:22 2020 (r358136) @@ -137,6 +137,20 @@ CLEANFILES+= ${SAFE_INCS} ${STAND_H_INC} ${OTHER_INC} SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ fstat.c close.c lseek.c open.c read.c write.c readdir.c +# SMBios routines +SRCS+= smbios.c +.if !defined(BOOT_HIDE_SERIAL_NUMBERS) +# Export serial numbers, UUID, and asset tag from loader. +CFLAGS.smbios.c+= -DSMBIOS_SERIAL_NUMBERS +.if defined(BOOT_LITTLE_ENDIAN_UUID) +# Use little-endian UUID format as defined in SMBIOS 2.6. +CFLAGS.smbios.c+= -DSMBIOS_LITTLE_ENDIAN_UUID +.elif defined(BOOT_NETWORK_ENDIAN_UUID) +# Use network-endian UUID format for backward compatibility. +CFLAGS.smbios.c+= -DSMBIOS_NETWORK_ENDIAN_UUID +.endif +.endif + # network routines SRCS+= arp.c ether.c ip.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c Copied and modified: head/stand/libsa/smbios.c (from r358135, head/stand/i386/libi386/smbios.c) ============================================================================== Copied and modified: head/stand/libsa/smbios.h (from r358135, head/stand/i386/libi386/smbios.h) ==============================================================================