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
This commit is contained in:
Warner Losh
2025-04-09 15:16:55 -06:00
parent 757dc8ab12
commit b2bd8c9a1d
5 changed files with 13 additions and 6 deletions
+10
View File
@@ -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);
-1
View File
@@ -25,7 +25,6 @@ SRCS= \
hostfs.c \ hostfs.c \
init.c \ init.c \
main.c \ main.c \
util.c \
vers.c vers.c
.if ${MK_FDT} != "no" .if ${MK_FDT} != "no"
+1 -4
View File
@@ -33,10 +33,7 @@ const char *hostdisk_gen_probe(void);
void hostdisk_zfs_probe(void); void hostdisk_zfs_probe(void);
bool hostdisk_zfs_find_default(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 "seg.h"
#include "util.h"
#endif /* KBOOT_H */ #endif /* KBOOT_H */
+1
View File
@@ -11,6 +11,7 @@ SRCS+= host_syscall.S
SRCS+= host_syscalls.c SRCS+= host_syscalls.c
SRCS+= seg.c SRCS+= seg.c
SRCS+= termios.c SRCS+= termios.c
SRCS+= util.c
.sinclude "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc" .sinclude "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc"
@@ -6,7 +6,7 @@
#include "stand.h" #include "stand.h"
#include "host_syscall.h" #include "host_syscall.h"
#include "kboot.h" #include "util.h"
bool bool
file2str(const char *fn, char *buffer, size_t buflen) file2str(const char *fn, char *buffer, size_t buflen)