aboutsummaryrefslogtreecommitdiff
path: root/stand
diff options
context:
space:
mode:
Diffstat (limited to 'stand')
-rw-r--r--stand/common/disk.c2
-rw-r--r--stand/common/gfx_fb.c1
-rw-r--r--stand/defaults/loader.conf.55
-rw-r--r--stand/efi/acpica/acpi_detect.c69
-rw-r--r--stand/efi/acpica/include/acpi_detect.h41
-rw-r--r--stand/efi/boot1/boot1.c4
-rw-r--r--stand/efi/loader/Makefile5
-rw-r--r--stand/efi/loader/arch/amd64/multiboot2.c2
-rw-r--r--stand/efi/loader/arch/amd64/trap.c1
-rw-r--r--stand/efi/loader/bootinfo.c5
-rw-r--r--stand/efi/loader/copy.c4
-rw-r--r--stand/efi/loader/efi_main.c2
-rw-r--r--stand/efi/loader/framebuffer.c7
-rw-r--r--stand/efi/loader/main.c75
-rw-r--r--stand/fonts/INDEX.fonts3
-rw-r--r--stand/kboot/kboot/hostdisk.c2
-rw-r--r--stand/libofw/devicename.c2
-rw-r--r--stand/libsa/dev.c2
-rw-r--r--stand/libsa/zfs/zfs.c2
-rw-r--r--stand/uboot/devicename.c2
20 files changed, 159 insertions, 77 deletions
diff --git a/stand/common/disk.c b/stand/common/disk.c
index 1baf91efaa49..c1650f0fa1ec 100644
--- a/stand/common/disk.c
+++ b/stand/common/disk.c
@@ -468,7 +468,7 @@ disk_parsedev(struct devdesc **idev, const char *devspec, const char **path)
if (*cp != '\0' && *cp != ':')
return (EINVAL);
- dev = calloc(sizeof(*dev), 1);
+ dev = malloc(sizeof(*dev));
if (dev == NULL)
return (ENOMEM);
dev->dd.d_unit = unit;
diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c
index 659bf8540422..3de0a8b631ee 100644
--- a/stand/common/gfx_fb.c
+++ b/stand/common/gfx_fb.c
@@ -276,7 +276,6 @@ void
gfx_fb_setcolors(teken_attr_t *attr, ev_sethook_t sethook,
ev_unsethook_t unsethook)
{
- const char *ptr;
bool need_setattr = false;
/*
diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5
index dc1c8f7f44e0..b1661e8c1101 100644
--- a/stand/defaults/loader.conf.5
+++ b/stand/defaults/loader.conf.5
@@ -21,7 +21,7 @@
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
-.Dd June 12, 2025
+.Dd September 2, 2025
.Dt LOADER.CONF 5
.Os
.Sh NAME
@@ -127,6 +127,9 @@ since those flags apply to all boot loaders.
.It Ar boot_verbose
Set to "yes" to get the same effect as boot -v or booting verbose from the
loader menu.
+See the
+.Va kern.msgbufsize
+tuneable to ensure enough space for the increased number of messages.
.It Ar exec
Immediately executes a
.Xr loader 8
diff --git a/stand/efi/acpica/acpi_detect.c b/stand/efi/acpica/acpi_detect.c
new file mode 100644
index 000000000000..1f15a882ff9d
--- /dev/null
+++ b/stand/efi/acpica/acpi_detect.c
@@ -0,0 +1,69 @@
+/*-
+ * Copyright (c) 2014 Ed Maste <emaste@freebsd.org>
+ * Copyright (c) 2025 Kayla Powell <kpowkitty@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <machine/_inttypes.h>
+#include <efi.h>
+#include <acpi.h>
+#include "acpi_detect.h"
+
+/* For ACPI rsdp discovery. */
+EFI_GUID acpi = ACPI_TABLE_GUID;
+EFI_GUID acpi20 = ACPI_20_TABLE_GUID;
+ACPI_TABLE_RSDP *rsdp;
+
+void
+acpi_detect(void)
+{
+ char buf[24];
+ int revision;
+
+ feature_enable(FEATURE_EARLY_ACPI);
+ if ((rsdp = efi_get_table(&acpi20)) == NULL)
+ if ((rsdp = efi_get_table(&acpi)) == NULL)
+ return;
+
+ sprintf(buf, "0x%016"PRIxPTR, (uintptr_t)rsdp);
+ setenv("acpi.rsdp", buf, 1);
+ revision = rsdp->Revision;
+ if (revision == 0)
+ revision = 1;
+ sprintf(buf, "%d", revision);
+ setenv("acpi.revision", buf, 1);
+ strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId));
+ buf[sizeof(rsdp->OemId)] = '\0';
+ setenv("acpi.oem", buf, 1);
+ sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress);
+ setenv("acpi.rsdt", buf, 1);
+ if (revision >= 2) {
+ /* XXX extended checksum? */
+ sprintf(buf, "0x%016llx",
+ (unsigned long long)rsdp->XsdtPhysicalAddress);
+ setenv("acpi.xsdt", buf, 1);
+ sprintf(buf, "%d", rsdp->Length);
+ setenv("acpi.xsdt_length", buf, 1);
+ }
+}
diff --git a/stand/efi/acpica/include/acpi_detect.h b/stand/efi/acpica/include/acpi_detect.h
new file mode 100644
index 000000000000..246e790be9fb
--- /dev/null
+++ b/stand/efi/acpica/include/acpi_detect.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2025 Kayla Powell <kpowkitty@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef ACPI_DETECT_H
+#define ACPI_DETECT_H
+
+#include <efi.h>
+#include <efilib.h>
+
+struct ACPI_TABLE_RSDP; // forward declaration
+
+extern EFI_GUID acpi;
+extern EFI_GUID acpi20;
+extern ACPI_TABLE_RSDP *rsdp;
+
+void acpi_detect(void);
+
+#endif
diff --git a/stand/efi/boot1/boot1.c b/stand/efi/boot1/boot1.c
index b93c6b425160..c906b430c0d6 100644
--- a/stand/efi/boot1/boot1.c
+++ b/stand/efi/boot1/boot1.c
@@ -299,9 +299,9 @@ efi_exit(EFI_STATUS s)
}
void
-exit(int error __unused)
+exit(int error)
{
- efi_exit(EFI_LOAD_ERROR);
+ efi_exit(errno_to_efi_status(error));
}
/*
diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile
index ae2ffc475730..b4520b957b74 100644
--- a/stand/efi/loader/Makefile
+++ b/stand/efi/loader/Makefile
@@ -30,6 +30,10 @@ SRCS= autoload.c \
gfx_fb.c \
8x16.c
+SRCS+= acpi_detect.c
+.PATH: ${EFISRC}/acpica
+CFLAGS+= -I${EFISRC}/acpica/include
+
CFLAGS+= -I${.CURDIR}/../loader
.if ${MK_LOADER_ZFS} != "no"
CFLAGS+= -I${ZFSSRC}
@@ -61,6 +65,7 @@ CWARNFLAGS.main.c+= -Wno-format
.PATH: ${.CURDIR}/../loader/arch/${__arch}
.include "${.CURDIR}/../loader/arch/${__arch}/Makefile.inc"
+CFLAGS+= -Wall
CFLAGS+= -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/arch/${__arch}
CFLAGS+= -I${EFISRC}/include
diff --git a/stand/efi/loader/arch/amd64/multiboot2.c b/stand/efi/loader/arch/amd64/multiboot2.c
index eb7362293406..6216fac42e4a 100644
--- a/stand/efi/loader/arch/amd64/multiboot2.c
+++ b/stand/efi/loader/arch/amd64/multiboot2.c
@@ -79,7 +79,6 @@ loadfile(char *filename, uint64_t dest, struct preloaded_file **result)
void *multiboot = NULL;
ssize_t search_size;
struct multiboot_header *header;
- char *cmdline;
struct mb2hdr hdr;
bool keep_bs = false;
@@ -495,7 +494,6 @@ static int
obj_loadfile(char *filename, uint64_t dest, struct preloaded_file **result)
{
struct preloaded_file *mfp, *kfp, *rfp;
- struct kernel_module *kmp;
int error;
/* See if there's a multiboot kernel loaded */
diff --git a/stand/efi/loader/arch/amd64/trap.c b/stand/efi/loader/arch/amd64/trap.c
index 61feb76e2dca..37e7e9d263a7 100644
--- a/stand/efi/loader/arch/amd64/trap.c
+++ b/stand/efi/loader/arch/amd64/trap.c
@@ -87,7 +87,6 @@ report_exc(struct trapframe *tf)
struct frame *fp;
uintptr_t pc, base;
char buf[80];
- int ret;
base = (uintptr_t)boot_img->ImageBase;
/*
diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c
index b8f1a2ffd56c..7931622c2df6 100644
--- a/stand/efi/loader/bootinfo.c
+++ b/stand/efi/loader/bootinfo.c
@@ -67,9 +67,8 @@
static int
bi_getboothowto(char *kargs)
{
-#ifdef EFI
- const char *sw, *tmp;
- char *opts;
+#if defined(EFI) && (defined(__i386__) || defined(__amd64__))
+ const char *tmp;
int speed, port;
char buf[50];
#endif
diff --git a/stand/efi/loader/copy.c b/stand/efi/loader/copy.c
index e4ad865a4acd..7452726565ad 100644
--- a/stand/efi/loader/copy.c
+++ b/stand/efi/loader/copy.c
@@ -248,7 +248,7 @@ static int
command_staging_slop(int argc, char *argv[])
{
char *endp;
- u_long new, prev;
+ u_long new;
if (argc > 2) {
goto err;
@@ -405,7 +405,9 @@ efi_check_space(vm_offset_t end)
return (true);
}
+#if defined(__amd64__) || defined(__i386__)
before_staging:
+#endif
/* Try allocating space before the previous allocation */
if (staging < nr_pages * EFI_PAGE_SIZE)
goto expand;
diff --git a/stand/efi/loader/efi_main.c b/stand/efi/loader/efi_main.c
index 2a5120dc89d7..6eea6f25c152 100644
--- a/stand/efi/loader/efi_main.c
+++ b/stand/efi/loader/efi_main.c
@@ -49,7 +49,7 @@ void
exit(int status)
{
- efi_exit(EFI_LOAD_ERROR);
+ efi_exit(errno_to_efi_status(status));
}
static CHAR16 *
diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c
index 141a29305f7c..fc61ed15ba3c 100644
--- a/stand/efi/loader/framebuffer.c
+++ b/stand/efi/loader/framebuffer.c
@@ -630,7 +630,7 @@ efi_find_framebuffer(teken_gfx_t *gfx_state)
gfx_state->tg_fb_type = FB_UGA;
gfx_state->tg_private = uga;
} else {
- return (1);
+ return (efi_status_to_errno(status));
}
}
@@ -644,9 +644,12 @@ efi_find_framebuffer(teken_gfx_t *gfx_state)
break;
default:
- return (1);
+ return (EINVAL);
}
+ if (rv != 0)
+ return (rv);
+
gfx_state->tg_fb.fb_addr = efifb.fb_addr;
gfx_state->tg_fb.fb_size = efifb.fb_size;
gfx_state->tg_fb.fb_height = efifb.fb_height;
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index 436676368447..2e51f15f0b5f 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -69,6 +69,8 @@
#include "actypes.h"
#include "actbl.h"
+#include <acpi_detect.h>
+
#include "loader_efi.h"
struct arch_switch archsw = { /* MI/MD interface boundary */
@@ -83,8 +85,6 @@ struct arch_switch archsw = { /* MI/MD interface boundary */
.arch_zfs_probe = efi_zfs_probe,
};
-EFI_GUID acpi = ACPI_TABLE_GUID;
-EFI_GUID acpi20 = ACPI_20_TABLE_GUID;
EFI_GUID devid = DEVICE_PATH_PROTOCOL;
EFI_GUID imgid = LOADED_IMAGE_PROTOCOL;
EFI_GUID mps = MPS_TABLE_GUID;
@@ -120,11 +120,6 @@ UINT16 boot_current;
*/
EFI_LOADED_IMAGE *boot_img;
-/*
- * RSDP base table.
- */
-ACPI_TABLE_RSDP *rsdp;
-
static bool
has_keyboard(void)
{
@@ -315,9 +310,9 @@ probe_md_currdev(void)
static bool
try_as_currdev(pdinfo_t *hd, pdinfo_t *pp)
{
+#ifdef EFI_ZFS_BOOT
uint64_t guid;
-#ifdef EFI_ZFS_BOOT
/*
* If there's a zpool on this device, try it as a ZFS
* filesystem, which has somewhat different setup than all
@@ -505,8 +500,7 @@ match_boot_info(char *boot_info, size_t bisz)
* a drop to the OK boot loader prompt is possible.
*/
static int
-find_currdev(bool do_bootmgr, bool is_last,
- char *boot_info, size_t boot_info_sz)
+find_currdev(bool do_bootmgr, char *boot_info, size_t boot_info_sz)
{
pdinfo_t *dp, *pp;
EFI_DEVICE_PATH *devpath, *copy;
@@ -864,7 +858,7 @@ static int
check_acpi_spcr(void)
{
ACPI_TABLE_SPCR *spcr;
- int br, db, io, rs, rw, sb, xo, pv, pd;
+ int br, db, io, rs, rw, xo, pv, pd;
uintmax_t mm;
const char *dt, *pa;
char *val = NULL;
@@ -896,7 +890,6 @@ check_acpi_spcr(void)
/* Uart settings */
pa = acpi_uart_parity(spcr->Parity);
- sb = spcr->StopBits;
db = 8;
/*
@@ -1121,6 +1114,8 @@ read_loader_env(const char *name, char *def_fn, bool once)
printf(" Reading loader env vars from %s\n", fn);
parse_loader_efi_config(boot_img->DeviceHandle, fn);
}
+
+ free(freeme);
}
caddr_t
@@ -1130,39 +1125,6 @@ ptov(uintptr_t x)
}
static void
-acpi_detect(void)
-{
- char buf[24];
- int revision;
-
- feature_enable(FEATURE_EARLY_ACPI);
- if ((rsdp = efi_get_table(&acpi20)) == NULL)
- if ((rsdp = efi_get_table(&acpi)) == NULL)
- return;
-
- sprintf(buf, "0x%016"PRIxPTR, (uintptr_t)rsdp);
- setenv("acpi.rsdp", buf, 1);
- revision = rsdp->Revision;
- if (revision == 0)
- revision = 1;
- sprintf(buf, "%d", revision);
- setenv("acpi.revision", buf, 1);
- strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId));
- buf[sizeof(rsdp->OemId)] = '\0';
- setenv("acpi.oem", buf, 1);
- sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress);
- setenv("acpi.rsdt", buf, 1);
- if (revision >= 2) {
- /* XXX extended checksum? */
- sprintf(buf, "0x%016llx",
- (unsigned long long)rsdp->XsdtPhysicalAddress);
- setenv("acpi.xsdt", buf, 1);
- sprintf(buf, "%d", rsdp->Length);
- setenv("acpi.xsdt_length", buf, 1);
- }
-}
-
-static void
efi_smbios_detect(void)
{
VOID *smbios_v2_ptr = NULL;
@@ -1201,12 +1163,12 @@ EFI_STATUS
main(int argc, CHAR16 *argv[])
{
int howto, i, uhowto;
- bool has_kbd, is_last;
+ bool has_kbd;
char *s;
EFI_DEVICE_PATH *imgpath;
CHAR16 *text;
EFI_STATUS rv;
- size_t sz, bosz = 0, bisz = 0;
+ size_t sz, bisz = 0;
UINT16 boot_order[100];
char boot_info[4096];
char buf[32];
@@ -1404,17 +1366,13 @@ main(int argc, CHAR16 *argv[])
printf(" %04x%s", boot_order[i],
boot_order[i] == boot_current ? "[*]" : "");
printf("\n");
- is_last = boot_order[(sz / sizeof(boot_order[0])) - 1] == boot_current;
- bosz = sz;
} else if (uefi_boot_mgr) {
/*
* u-boot doesn't set BootOrder, but otherwise participates in the
* boot manager protocol. So we fake it here and don't consider it
* a failure.
*/
- bosz = sizeof(boot_order[0]);
boot_order[0] = boot_current;
- is_last = true;
}
}
@@ -1463,7 +1421,7 @@ main(int argc, CHAR16 *argv[])
* the boot protocol and also allow an escape hatch for users wishing
* to try something different.
*/
- if (find_currdev(uefi_boot_mgr, is_last, boot_info, bisz) != 0)
+ if (find_currdev(uefi_boot_mgr, boot_info, bisz) != 0)
if (uefi_boot_mgr &&
!interactive_interrupt("Failed to find bootable partition"))
return (EFI_NOT_FOUND);
@@ -1858,6 +1816,8 @@ command_chain(int argc, char *argv[])
EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL;
EFI_HANDLE loaderhandle;
EFI_LOADED_IMAGE *loaded_image;
+ UINTN ExitDataSize;
+ CHAR16 *ExitData = NULL;
EFI_STATUS status;
struct stat st;
struct devdesc *dev;
@@ -1973,9 +1933,16 @@ command_chain(int argc, char *argv[])
}
dev_cleanup();
- status = BS->StartImage(loaderhandle, NULL, NULL);
+
+ status = BS->StartImage(loaderhandle, &ExitDataSize, &ExitData);
if (status != EFI_SUCCESS) {
- command_errmsg = "StartImage failed";
+ printf("StartImage failed (%lu)", EFI_ERROR_CODE(status));
+ if (ExitData != NULL) {
+ printf(": %S", ExitData);
+ BS->FreePool(ExitData);
+ }
+ putchar('\n');
+ command_errmsg = "";
free(loaded_image->LoadOptions);
loaded_image->LoadOptions = NULL;
status = BS->UnloadImage(loaded_image);
diff --git a/stand/fonts/INDEX.fonts b/stand/fonts/INDEX.fonts
index 66a6d8a9a3f5..fc035c6b2e4e 100644
--- a/stand/fonts/INDEX.fonts
+++ b/stand/fonts/INDEX.fonts
@@ -60,9 +60,6 @@ FONT:en:8x16v.fnt
16x32.fnt:en:Terminus BSD Console, size 32
16x32.fnt:da:Terminus BSD-konsol, størrelse 32
16x32.fnt:de:Terminus BSD Console, Größe 32
-32x64.fnt:en:Spleen BSD Console, size 64
-32x64.fnt:da:Spleen BSD-konsol, størrelse 64
-32x64.fnt:de:Spleen BSD Console, Größe 64
# (fset 'langnew
# "\M-}\C-p\C-k\C-y\C-m\C-y\M-}")
diff --git a/stand/kboot/kboot/hostdisk.c b/stand/kboot/kboot/hostdisk.c
index fc98bf534519..a9117d4c1c9d 100644
--- a/stand/kboot/kboot/hostdisk.c
+++ b/stand/kboot/kboot/hostdisk.c
@@ -465,7 +465,7 @@ hostdisk_parsedev(struct devdesc **idev, const char *devspec, const char **path)
return (EINVAL);
}
free(fn);
- dev = calloc(sizeof(*dev), 1);
+ dev = malloc(sizeof(*dev));
if (dev == NULL)
return (ENOMEM);
dev->d_unit = 0;
diff --git a/stand/libofw/devicename.c b/stand/libofw/devicename.c
index 46a9717fdda5..f6419632c6bc 100644
--- a/stand/libofw/devicename.c
+++ b/stand/libofw/devicename.c
@@ -98,7 +98,7 @@ ofw_common_parsedev(struct devdesc **dev, const char *devspec, const char **path
if (ofw_path_to_handle(devspec, ofwtype, &rem_path) == -1)
return (ENOENT);
- idev = calloc(sizeof(struct ofw_devdesc), 1);
+ idev = malloc(sizeof(struct ofw_devdesc));
if (idev == NULL) {
printf("ofw_parsedev: malloc failed\n");
return (ENOMEM);
diff --git a/stand/libsa/dev.c b/stand/libsa/dev.c
index 4f6932e96c48..1edc843d508c 100644
--- a/stand/libsa/dev.c
+++ b/stand/libsa/dev.c
@@ -72,7 +72,7 @@ default_parsedev(struct devdesc **dev, const char *devspec,
int unit, err;
char *cp;
- idev = calloc(sizeof(struct devdesc), 1);
+ idev = malloc(sizeof(struct devdesc));
if (idev == NULL)
return (ENOMEM);
diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c
index 2f7c1caaa4b5..70a102f6425d 100644
--- a/stand/libsa/zfs/zfs.c
+++ b/stand/libsa/zfs/zfs.c
@@ -1643,7 +1643,7 @@ zfs_parsedev(struct devdesc **idev, const char *devspec, const char **path)
spa = spa_find_by_name(poolname);
if (!spa)
return (ENXIO);
- dev = calloc(sizeof(*dev), 1);
+ dev = malloc(sizeof(*dev));
if (dev == NULL)
return (ENOMEM);
dev->pool_guid = spa->spa_guid;
diff --git a/stand/uboot/devicename.c b/stand/uboot/devicename.c
index 23670d7593a2..4ee9c7fd72c4 100644
--- a/stand/uboot/devicename.c
+++ b/stand/uboot/devicename.c
@@ -102,7 +102,7 @@ uboot_parsedev(struct uboot_devdesc **dev, const char *devspec,
}
if (dv == NULL)
return(ENOENT);
- idev = calloc(sizeof(struct uboot_devdesc), 1);
+ idev = malloc(sizeof(struct uboot_devdesc));
err = 0;
np = (devspec + strlen(dv->dv_name));