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:
@@ -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);
|
||||||
@@ -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"
|
||||||
|
|||||||
@@ -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 */
|
||||||
|
|||||||
@@ -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)
|
||||||
Reference in New Issue
Block a user