Module Name: src
Committed By: martin
Date: Sun Jan 26 11:21:59 UTC 2020
Modified Files:
src/sys/stand/efiboot [netbsd-9]: Makefile.efiboot boot.c efiacpi.c
exec.c prompt.c
src/sys/stand/efiboot/bootaa64 [netbsd-9]: Makefile
src/sys/stand/efiboot/bootarm [netbsd-9]: Makefile
Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #653):
sys/stand/efiboot/prompt.c: revision 1.6
sys/stand/efiboot/boot.c: revision 1.20
sys/stand/efiboot/bootarm/Makefile: revision 1.4
sys/stand/efiboot/efiacpi.c: revision 1.6
sys/stand/efiboot/exec.c: revision 1.13
sys/stand/efiboot/Makefile.efiboot: revision 1.10
sys/stand/efiboot/bootaa64/Makefile: revision 1.7
Fix for disappearing counters on graphics consoles
Hide the twiddle while loading efiboot plist
Clean up the banner so it fits in 80 columns and add some extra details
to the "version" command output.
To generate a diff of this commit:
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/sys/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.18 -r1.18.4.1 src/sys/stand/efiboot/boot.c
cvs rdiff -u -r1.3.6.2 -r1.3.6.3 src/sys/stand/efiboot/efiacpi.c
cvs rdiff -u -r1.11 -r1.11.2.1 src/sys/stand/efiboot/exec.c
cvs rdiff -u -r1.4 -r1.4.6.1 src/sys/stand/efiboot/prompt.c
cvs rdiff -u -r1.5 -r1.5.6.1 src/sys/stand/efiboot/bootaa64/Makefile
cvs rdiff -u -r1.1 -r1.1.6.1 src/sys/stand/efiboot/bootarm/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/stand/efiboot/Makefile.efiboot
diff -u src/sys/stand/efiboot/Makefile.efiboot:1.8.2.1 src/sys/stand/efiboot/Makefile.efiboot:1.8.2.2
--- src/sys/stand/efiboot/Makefile.efiboot:1.8.2.1 Sun Dec 8 13:13:06 2019
+++ src/sys/stand/efiboot/Makefile.efiboot Sun Jan 26 11:21:58 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.8.2.1 2019/12/08 13:13:06 martin Exp $
+# $NetBSD: Makefile.efiboot,v 1.8.2.2 2020/01/26 11:21:58 martin Exp $
S= ${.CURDIR}/../../..
@@ -8,7 +8,7 @@ NOLIBCSANITIZER=# defined
NOSANITIZER= # defined
NORELRO= # defined
PROG?= boot.efi
-NEWVERSWHAT?= "EFI Boot"
+NEWVERSWHAT?= "efiboot"
EFIDIR= ${S}/external/bsd/gnu-efi/dist
GNUEFIARCH?= ${MACHINE_CPU}
Index: src/sys/stand/efiboot/boot.c
diff -u src/sys/stand/efiboot/boot.c:1.18 src/sys/stand/efiboot/boot.c:1.18.4.1
--- src/sys/stand/efiboot/boot.c:1.18 Sun Apr 21 22:30:41 2019
+++ src/sys/stand/efiboot/boot.c Sun Jan 26 11:21:58 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.18 2019/04/21 22:30:41 thorpej Exp $ */
+/* $NetBSD: boot.c,v 1.18.4.1 2020/01/26 11:21:58 martin Exp $ */
/*-
* Copyright (c) 2016 Kimihiro Nonaka <[email protected]>
@@ -112,6 +112,7 @@ const struct boot_command commands[] = {
{ "reboot", command_reset, "reboot|reset" },
{ "reset", command_reset, NULL },
{ "version", command_version, "version" },
+ { "ver", command_version, NULL },
{ "help", command_help, "help|?" },
{ "?", command_help, NULL },
{ "quit", command_quit, "quit" },
@@ -262,12 +263,13 @@ command_version(char *arg)
char *ufirmware;
int rv;
- printf("EFI version: %d.%02d\n",
+ printf("Version: %s (%s)\n", bootprog_rev, bootprog_kernrev);
+ printf("EFI: %d.%02d\n",
ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff);
ufirmware = NULL;
rv = ucs2_to_utf8(ST->FirmwareVendor, &ufirmware);
if (rv == 0) {
- printf("EFI Firmware: %s (rev 0x%x)\n", ufirmware,
+ printf("Firmware: %s (rev 0x%x)\n", ufirmware,
ST->FirmwareRevision);
FreePool(ufirmware);
}
@@ -369,8 +371,8 @@ void
print_banner(void)
{
printf("\n\n"
- ">> %s, Revision %s (from NetBSD %s)\n",
- bootprog_name, bootprog_rev, bootprog_kernrev);
+ ">> %s, Revision %s\n",
+ bootprog_name, bootprog_rev);
}
static void
Index: src/sys/stand/efiboot/efiacpi.c
diff -u src/sys/stand/efiboot/efiacpi.c:1.3.6.2 src/sys/stand/efiboot/efiacpi.c:1.3.6.3
--- src/sys/stand/efiboot/efiacpi.c:1.3.6.2 Sun Dec 8 13:13:06 2019
+++ src/sys/stand/efiboot/efiacpi.c Sun Jan 26 11:21:58 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: efiacpi.c,v 1.3.6.2 2019/12/08 13:13:06 martin Exp $ */
+/* $NetBSD: efiacpi.c,v 1.3.6.3 2020/01/26 11:21:58 martin Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,6 +34,18 @@
#include "efifdt.h"
#include "smbios.h"
+struct acpi_rdsp {
+ char signature[8];
+ uint8_t checksum;
+ char oemid[6];
+ uint8_t revision;
+ uint32_t rsdtphys;
+ uint32_t length;
+ uint64_t xsdtphys;
+ uint8_t extcsum;
+ uint8_t reserved[3];
+};
+
#include <libfdt.h>
#define ACPI_FDT_SIZE (128 * 1024)
@@ -66,18 +78,6 @@ efi_acpi_available(void)
return acpi_root != NULL;
}
-void
-efi_acpi_show(void)
-{
- if (!efi_acpi_available())
- return;
-
- printf("ACPI: RSDP %p", acpi_root);
- if (smbios3_table)
- printf(", SMBIOS %p", smbios3_table);
- printf("\n");
-}
-
static char model_buf[128];
static const char *
@@ -111,6 +111,22 @@ efi_acpi_get_model(void)
return model_buf;
}
+void
+efi_acpi_show(void)
+{
+ struct acpi_rdsp *rsdp = acpi_root;
+
+ if (!efi_acpi_available())
+ return;
+
+ printf("ACPI: v%02d %c%c%c%c%c%c\n", rsdp->revision,
+ rsdp->oemid[0], rsdp->oemid[1], rsdp->oemid[2],
+ rsdp->oemid[3], rsdp->oemid[4], rsdp->oemid[5]);
+
+ if (smbios3_table)
+ printf("SMBIOS: %s", efi_acpi_get_model());
+}
+
int
efi_acpi_create_fdt(void)
{
Index: src/sys/stand/efiboot/exec.c
diff -u src/sys/stand/efiboot/exec.c:1.11 src/sys/stand/efiboot/exec.c:1.11.2.1
--- src/sys/stand/efiboot/exec.c:1.11 Wed Jul 24 11:40:36 2019
+++ src/sys/stand/efiboot/exec.c Sun Jan 26 11:21:58 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.11 2019/07/24 11:40:36 jmcneill Exp $ */
+/* $NetBSD: exec.c,v 1.11.2.1 2020/01/26 11:21:58 martin Exp $ */
/*-
* Copyright (c) 2019 Jason R. Thorpe
@@ -34,6 +34,8 @@
#include <sys/reboot.h>
+extern char twiddle_toggle;
+
u_long load_offset = 0;
#define FDT_SPACE (4 * 1024 * 1024)
@@ -127,6 +129,7 @@ load_efibootplist(bool default_fallback)
u_long plist_size = 0;
prop_dictionary_t plist = NULL, oplist = NULL;
bool load_quietly = false;
+ bool old_twiddle_toggle = twiddle_toggle;
const char *path = get_efibootplist_path();
if (path == NULL || strlen(path) == 0) {
@@ -136,6 +139,8 @@ load_efibootplist(bool default_fallback)
load_quietly = true;
}
+ twiddle_toggle = load_quietly;
+
/*
* Fudge the size so we can ensure the resulting buffer
* is NUL-terminated for convenience.
@@ -157,6 +162,8 @@ load_efibootplist(bool default_fallback)
out:
oplist = efibootplist;
+ twiddle_toggle = old_twiddle_toggle;
+
/*
* If we had a failure, create an empty one for
* convenience. But a failure should not clobber
Index: src/sys/stand/efiboot/prompt.c
diff -u src/sys/stand/efiboot/prompt.c:1.4 src/sys/stand/efiboot/prompt.c:1.4.6.1
--- src/sys/stand/efiboot/prompt.c:1.4 Wed Oct 31 23:49:34 2018
+++ src/sys/stand/efiboot/prompt.c Sun Jan 26 11:21:58 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: prompt.c,v 1.4 2018/10/31 23:49:34 jmcneill Exp $ */
+/* $NetBSD: prompt.c,v 1.4.6.1 2020/01/26 11:21:58 martin Exp $ */
/*
* Copyright (c) 1996, 1997
@@ -74,23 +74,27 @@ awaitkey(int timeout, int tell)
{
int i = timeout * POLL_FREQ;
int last_secs = -1, secs;
+ int last_len = -1, n;
+ char buf[32];
char c = 0;
for (;;) {
if (tell) {
- char buf[32];
int len;
secs = (i + POLL_FREQ - 1) / POLL_FREQ;
if (secs != last_secs) {
- len = snprintf(buf, sizeof(buf), "%d seconds. ", (i + POLL_FREQ - 1) / POLL_FREQ);
- if (len > 0 && len < sizeof(buf)) {
+ if (last_len != -1) {
char *p = buf;
- printf("%s", buf);
- while (*p)
+ for (n = 0; n < last_len; n++)
*p++ = '\b';
+ *p = '\0';
printf("%s", buf);
}
+ len = snprintf(buf, sizeof(buf), "%d seconds. ", (i + POLL_FREQ - 1) / POLL_FREQ);
+ if (len > 0 && len < sizeof(buf))
+ printf("%s", buf);
+ last_len = len;
last_secs = secs;
}
}
@@ -108,8 +112,16 @@ awaitkey(int timeout, int tell)
}
out:
- if (tell)
+ if (tell) {
+ if (last_len != -1) {
+ char *p = buf;
+ for (n = 0; n < last_len; n++)
+ *p++ = '\b';
+ *p = '\0';
+ printf("%s", buf);
+ }
printf("0 seconds. \n");
+ }
return c;
}
Index: src/sys/stand/efiboot/bootaa64/Makefile
diff -u src/sys/stand/efiboot/bootaa64/Makefile:1.5 src/sys/stand/efiboot/bootaa64/Makefile:1.5.6.1
--- src/sys/stand/efiboot/bootaa64/Makefile:1.5 Sun Oct 28 10:17:47 2018
+++ src/sys/stand/efiboot/bootaa64/Makefile Sun Jan 26 11:21:59 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.5 2018/10/28 10:17:47 jmcneill Exp $
+# $NetBSD: Makefile,v 1.5.6.1 2020/01/26 11:21:59 martin Exp $
PROG= bootaa64.efi
OBJFMT= binary
-NEWVERSWHAT= "EFI Boot (aarch64)"
+NEWVERSWHAT= "efiboot (arm64)"
EXTRA_SOURCES= efibootaa64.c
EXTRA_SOURCES+= cache.S
Index: src/sys/stand/efiboot/bootarm/Makefile
diff -u src/sys/stand/efiboot/bootarm/Makefile:1.1 src/sys/stand/efiboot/bootarm/Makefile:1.1.6.1
--- src/sys/stand/efiboot/bootarm/Makefile:1.1 Sat Mar 30 12:48:50 2019
+++ src/sys/stand/efiboot/bootarm/Makefile Sun Jan 26 11:21:59 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.1 2019/03/30 12:48:50 jmcneill Exp $
+# $NetBSD: Makefile,v 1.1.6.1 2020/01/26 11:21:59 martin Exp $
PROG= bootarm.efi
OBJFMT= binary
-NEWVERSWHAT= "EFI Boot (arm)"
+NEWVERSWHAT= "efiboot (arm)"
GNUEFIARCH= arm
LIBGNUEFI_ARCH= arm