From nobody Wed Apr 09 21:17:53 2025 X-Original-To: dev-commits-src-main@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 4ZXwlQ2ZLdz5sP0f; Wed, 09 Apr 2025 21:17:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZXwlP5WjQz3tHk; Wed, 09 Apr 2025 21:17:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744233473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/8s1rE3Dom0UDlfessr3ZHaMJNjtl8rsrM9NAXlF2G4=; b=QaJNA6aC6kTKefz2+Q0OYBUwYbuoU3FWtwkCrjf//BYyqZ4CixnbasOq2EtuWo8pIYvxFz 046Mhx/5GNK1RWoibSvQUig8PaBsJisewMo635bXSyF5ZVTEThlVNlewP2yaewBBaJne2c WxQ/ehQsiKSkxsqqbKO9S8e846PsnFyPEf6WuNUgt5RU5RKEeGpIYbyqkAbz18YMSkhfKC LnITbj6/MrERf9+C7Z2kywuQ7OQDznrbFwbnFluj0lfZO0CHILDeLisP835gw2yMIu9Y1V ZemQKQKKY7H1PdwFe/U+LSXZIiplOm6sn1Y0EtURk7hd4eYcURaVmzi6mGQBxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744233473; a=rsa-sha256; cv=none; b=deqwbUihuYSminG8BbptDt4nC0Q+jMcQCX6+pTRQFEWZleXOyC2O5bRgqvNTL7bZT3u+t5 ECsZb2S2/5HVPz+M0WgCj2frOYL6yyMVaAaPQ3lvLL/E7P9bfrnWtZ3j6UFkHjOrp24Mbw adfrSakb+p6uuBiATTu/oEaZEhuX72Z7DqeAgQVYgN2J5gacwZchbYbYC3vtxCLfRx5eXn Coj4zjv56qTbfEFChLqEzT4pZdd8WZ6FDdkIzkLzZckfyzXkIsErwbP69HYUIVqhXPdTYY OU/x9IwY6BvCUz8iBUa2EMu3UxuVQeAsWGcwgCCz28JXPzYSh816oUXi4y/Qgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744233473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/8s1rE3Dom0UDlfessr3ZHaMJNjtl8rsrM9NAXlF2G4=; b=rwa+XjqO580zQ9qQINwbBLA8cPOEIGM0qfMcG+PYXKedZrexN1LbX5D+IYMEw9vdNgoBds hUm+UmZmaRnumS3acUrOOppUjOiwZP3K+BpMcMv39vb7jS3xr9kOfj19/WttsjIQIbjljG /QJsJ79oVtF5vNBCwZuNkddnZO9ea5+1FEwxxfoPAuAzVJlKphO7R3gmjAgUk94L6IEj3v 6oJV0uxobj0gIlGF7f97T+ehH7pPYoc/RuZvsGrL++17HL/udi79/w+LfCguTrSeHGQ2VL quRABDK82Bn1rG6TUnCIuiuMD0CSpfDh4KdoQdxSIJO8RWVXFK3qmRWW/EtI7A== 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 4ZXwlP4lgHzb4H; Wed, 09 Apr 2025 21:17:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 539LHrsl077993; Wed, 9 Apr 2025 21:17:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 539LHrF6077990; Wed, 9 Apr 2025 21:17:53 GMT (envelope-from git) Date: Wed, 9 Apr 2025 21:17:53 GMT Message-Id: <202504092117.539LHrF6077990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b2bd8c9a1d87 - main - kboot: Move str* util routines to libkboot List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2bd8c9a1d87ee60f13715370824c56f5ab7a4d2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b2bd8c9a1d87ee60f13715370824c56f5ab7a4d2 commit b2bd8c9a1d87ee60f13715370824c56f5ab7a4d2 Author: Warner Losh AuthorDate: 2025-04-09 21:16:55 +0000 Commit: Warner Losh CommitDate: 2025-04-09 21:16:55 +0000 kboot: Move str* util routines to libkboot These are needed for the next round of EFI support for amd64 (partially shared with aarch64, but only partially because the Linux host interfaces are different to get the same info). Sponsored by: Netflix --- stand/kboot/include/util.h | 10 ++++++++++ stand/kboot/kboot/Makefile | 1 - stand/kboot/kboot/kboot.h | 5 +---- stand/kboot/libkboot/Makefile | 1 + stand/kboot/{kboot => libkboot}/util.c | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/stand/kboot/include/util.h b/stand/kboot/include/util.h new file mode 100644 index 000000000000..ca71277bc66a --- /dev/null +++ b/stand/kboot/include/util.h @@ -0,0 +1,10 @@ +/*- + * Copyright (c) 2022, Netflix, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +bool file2str(const char *fn, char *buffer, size_t buflen); +bool file2u64(const char *fn, uint64_t *val); diff --git a/stand/kboot/kboot/Makefile b/stand/kboot/kboot/Makefile index 0f6bb994711d..19bae09df5ea 100644 --- a/stand/kboot/kboot/Makefile +++ b/stand/kboot/kboot/Makefile @@ -25,7 +25,6 @@ SRCS= \ hostfs.c \ init.c \ main.c \ - util.c \ vers.c .if ${MK_FDT} != "no" diff --git a/stand/kboot/kboot/kboot.h b/stand/kboot/kboot/kboot.h index 2a6e98ae5513..cbacf8d1e453 100644 --- a/stand/kboot/kboot/kboot.h +++ b/stand/kboot/kboot/kboot.h @@ -33,10 +33,7 @@ const char *hostdisk_gen_probe(void); void hostdisk_zfs_probe(void); bool hostdisk_zfs_find_default(void); -/* util.c */ -bool file2str(const char *fn, char *buffer, size_t buflen); -bool file2u64(const char *fn, uint64_t *val); - #include "seg.h" +#include "util.h" #endif /* KBOOT_H */ diff --git a/stand/kboot/libkboot/Makefile b/stand/kboot/libkboot/Makefile index 7acec951107a..249bfef817c5 100644 --- a/stand/kboot/libkboot/Makefile +++ b/stand/kboot/libkboot/Makefile @@ -11,6 +11,7 @@ SRCS+= host_syscall.S SRCS+= host_syscalls.c SRCS+= seg.c SRCS+= termios.c +SRCS+= util.c .sinclude "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc" diff --git a/stand/kboot/kboot/util.c b/stand/kboot/libkboot/util.c similarity index 97% rename from stand/kboot/kboot/util.c rename to stand/kboot/libkboot/util.c index 7d467a29b059..0100a7cc5d8a 100644 --- a/stand/kboot/kboot/util.c +++ b/stand/kboot/libkboot/util.c @@ -6,7 +6,7 @@ #include "stand.h" #include "host_syscall.h" -#include "kboot.h" +#include "util.h" bool file2str(const char *fn, char *buffer, size_t buflen)