From nobody Fri Oct 08 06:10:35 2021 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A9F2D12D2B44; Fri, 8 Oct 2021 06:10:37 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQd8r46khz3Kpv; Fri, 8 Oct 2021 06:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4D9D21FCA; Fri, 8 Oct 2021 06:10:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1986AZ2H006923; Fri, 8 Oct 2021 06:10:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1986AZUx006922; Fri, 8 Oct 2021 06:10:35 GMT (envelope-from git) Date: Fri, 8 Oct 2021 06:10:35 GMT Message-Id: <202110080610.1986AZUx006922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 7f31297d105c - stable/12 - Move smbios.c to libsa. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7f31297d105cd0dae9d862c814dfa75cca331bb3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7f31297d105cd0dae9d862c814dfa75cca331bb3 commit 7f31297d105cd0dae9d862c814dfa75cca331bb3 Author: Warner Losh AuthorDate: 2020-02-20 00:46:22 +0000 Commit: Kyle Evans CommitDate: 2021-10-08 02:42:13 +0000 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. (cherry picked from commit a64f0b83e5ee1c9f7ac5782a3d3f9f1c7b368e41) --- stand/efi/loader/Makefile | 15 --------------- stand/i386/libi386/Makefile | 14 +------------- stand/i386/loader/main.c | 2 +- stand/libsa/Makefile | 14 ++++++++++++++ stand/{i386/libi386 => libsa}/smbios.c | 0 stand/{i386/libi386 => libsa}/smbios.h | 0 6 files changed, 16 insertions(+), 29 deletions(-) diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index d290cae5d4c8..6ee613e7bfea 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -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} @@ -57,18 +54,6 @@ 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" LIBEFI_FDT= ${BOOTOBJ}/efi/fdt/libefi_fdt.a diff --git a/stand/i386/libi386/Makefile b/stand/i386/libi386/Makefile index 58128e962822..75e6448ca717 100644 --- a/stand/i386/libi386/Makefile +++ b/stand/i386/libi386/Makefile @@ -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} @@ -25,18 +25,6 @@ CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} 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 - # Include simple terminal emulation (cons25-compatible) CFLAGS+= -DTERM_EMU diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c index 67d1fe1b2b20..a4a3bde3cc7c 100644 --- a/stand/i386/loader/main.c +++ b/stand/i386/loader/main.c @@ -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 diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index 0ca994386f47..63dbc6e7414c 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -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 diff --git a/stand/i386/libi386/smbios.c b/stand/libsa/smbios.c similarity index 100% rename from stand/i386/libi386/smbios.c rename to stand/libsa/smbios.c diff --git a/stand/i386/libi386/smbios.h b/stand/libsa/smbios.h similarity index 100% rename from stand/i386/libi386/smbios.h rename to stand/libsa/smbios.h