diff options
author | 2020-05-10 11:51:58 +0000 | |
---|---|---|
committer | 2020-05-10 11:51:58 +0000 | |
commit | e3df5f77a492c46f63160e2c5f0eeb6667d2fb15 (patch) | |
tree | 22e90f87771c015f5ba0277f7df9dd52554ecb74 | |
parent | fix socket_log() calls, EVENT expands to three comma separated (diff) | |
download | wireguard-openbsd-e3df5f77a492c46f63160e2c5f0eeb6667d2fb15.tar.xz wireguard-openbsd-e3df5f77a492c46f63160e2c5f0eeb6667d2fb15.zip |
Pass boothowto from the bootloader to the kernel by adding a
openbsd,boothowto property under /chosen.
ok patrick@
-rw-r--r-- | sys/arch/armv7/stand/efiboot/efiboot.c | 7 | ||||
-rw-r--r-- | sys/arch/armv7/stand/efiboot/efiboot.h | 4 | ||||
-rw-r--r-- | sys/arch/armv7/stand/efiboot/exec.c | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/sys/arch/armv7/stand/efiboot/efiboot.c b/sys/arch/armv7/stand/efiboot/efiboot.c index 7360d40d6a2..9ffbc411319 100644 --- a/sys/arch/armv7/stand/efiboot/efiboot.c +++ b/sys/arch/armv7/stand/efiboot/efiboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efiboot.c,v 1.29 2020/04/27 20:13:51 kettenis Exp $ */ +/* $OpenBSD: efiboot.c,v 1.30 2020/05/10 11:51:58 kettenis Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net> @@ -474,11 +474,12 @@ static EFI_GUID fdt_guid = FDT_TABLE_GUID; #define efi_guidcmp(_a, _b) memcmp((_a), (_b), sizeof(EFI_GUID)) void * -efi_makebootargs(char *bootargs, uint32_t *board_id) +efi_makebootargs(char *bootargs, int howto, uint32_t *board_id) { u_char bootduid[8]; u_char zero[8] = { 0 }; uint64_t uefi_system_table = htobe64((uintptr_t)ST); + uint32_t boothowto = htobe32(howto); void *node; size_t len; int i; @@ -500,6 +501,8 @@ efi_makebootargs(char *bootargs, uint32_t *board_id) len = strlen(bootargs) + 1; fdt_node_add_property(node, "bootargs", bootargs, len); + fdt_node_add_property(node, "openbsd,boothowto", + &boothowto, sizeof(boothowto)); /* Pass DUID of the boot disk. */ if (bootdev_dip) { diff --git a/sys/arch/armv7/stand/efiboot/efiboot.h b/sys/arch/armv7/stand/efiboot/efiboot.h index b478d15c602..e57712ad40d 100644 --- a/sys/arch/armv7/stand/efiboot/efiboot.h +++ b/sys/arch/armv7/stand/efiboot/efiboot.h @@ -1,4 +1,4 @@ -/* $OpenBSD: efiboot.h,v 1.5 2019/10/25 10:06:40 kettenis Exp $ */ +/* $OpenBSD: efiboot.h,v 1.6 2020/05/10 11:51:58 kettenis Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net> @@ -19,7 +19,7 @@ void efi_cleanup(void); void efi_diskprobe(void); void efi_pxeprobe(void); -void *efi_makebootargs(char *, uint32_t *); +void *efi_makebootargs(char *, int, uint32_t *); void efi_cons_probe(struct consdev *); void efi_cons_init(struct consdev *); int efi_cons_getc(dev_t); diff --git a/sys/arch/armv7/stand/efiboot/exec.c b/sys/arch/armv7/stand/efiboot/exec.c index d7dd1212da7..e3d3d4a35fc 100644 --- a/sys/arch/armv7/stand/efiboot/exec.c +++ b/sys/arch/armv7/stand/efiboot/exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.c,v 1.14 2019/07/22 11:51:30 kettenis Exp $ */ +/* $OpenBSD: exec.c,v 1.15 2020/05/10 11:51:58 kettenis Exp $ */ /* * Copyright (c) 2006, 2016 Mark Kettenis @@ -179,7 +179,7 @@ run_loadfile(uint64_t *marks, int howto) else *++cp = 0; - fdt = efi_makebootargs(args, &board_id); + fdt = efi_makebootargs(args, howto, &board_id); efi_cleanup(); |