Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/stand/efiboot Pull up following revision(s) (requeste...



details:   https://anonhg.NetBSD.org/src/rev/3e5f55ff4ae1
branches:  netbsd-9
changeset: 744172:3e5f55ff4ae1
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jan 26 11:21:58 2020 +0000

description:
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.

diffstat:

 sys/stand/efiboot/Makefile.efiboot  |   4 +-
 sys/stand/efiboot/boot.c            |  12 ++++++----
 sys/stand/efiboot/bootaa64/Makefile |   4 +-
 sys/stand/efiboot/bootarm/Makefile  |   4 +-
 sys/stand/efiboot/efiacpi.c         |  42 +++++++++++++++++++++++++-----------
 sys/stand/efiboot/exec.c            |   9 +++++++-
 sys/stand/efiboot/prompt.c          |  26 ++++++++++++++++------
 7 files changed, 69 insertions(+), 32 deletions(-)

diffs (264 lines):

diff -r 19d36abeaa6f -r 3e5f55ff4ae1 sys/stand/efiboot/Makefile.efiboot
--- a/sys/stand/efiboot/Makefile.efiboot        Sun Jan 26 11:19:36 2020 +0000
+++ b/sys/stand/efiboot/Makefile.efiboot        Sun Jan 26 11:21:58 2020 +0000
@@ -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 @@
 NOSANITIZER=   # defined
 NORELRO=       # defined
 PROG?=         boot.efi
-NEWVERSWHAT?=  "EFI Boot"
+NEWVERSWHAT?=  "efiboot"
 
 EFIDIR= ${S}/external/bsd/gnu-efi/dist
 GNUEFIARCH?= ${MACHINE_CPU}
diff -r 19d36abeaa6f -r 3e5f55ff4ae1 sys/stand/efiboot/boot.c
--- a/sys/stand/efiboot/boot.c  Sun Jan 26 11:19:36 2020 +0000
+++ b/sys/stand/efiboot/boot.c  Sun Jan 26 11:21:58 2020 +0000
@@ -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 <nonaka%netbsd.org@localhost>
@@ -112,6 +112,7 @@
        { "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 @@
        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 @@
 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
diff -r 19d36abeaa6f -r 3e5f55ff4ae1 sys/stand/efiboot/bootaa64/Makefile
--- a/sys/stand/efiboot/bootaa64/Makefile       Sun Jan 26 11:19:36 2020 +0000
+++ b/sys/stand/efiboot/bootaa64/Makefile       Sun Jan 26 11:21:58 2020 +0000
@@ -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
diff -r 19d36abeaa6f -r 3e5f55ff4ae1 sys/stand/efiboot/bootarm/Makefile
--- a/sys/stand/efiboot/bootarm/Makefile        Sun Jan 26 11:19:36 2020 +0000
+++ b/sys/stand/efiboot/bootarm/Makefile        Sun Jan 26 11:21:58 2020 +0000
@@ -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
 
diff -r 19d36abeaa6f -r 3e5f55ff4ae1 sys/stand/efiboot/efiacpi.c
--- a/sys/stand/efiboot/efiacpi.c       Sun Jan 26 11:19:36 2020 +0000
+++ b/sys/stand/efiboot/efiacpi.c       Sun Jan 26 11:21:58 2020 +0000
@@ -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 @@
        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 @@
        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)
 {
diff -r 19d36abeaa6f -r 3e5f55ff4ae1 sys/stand/efiboot/exec.c
--- a/sys/stand/efiboot/exec.c  Sun Jan 26 11:19:36 2020 +0000
+++ b/sys/stand/efiboot/exec.c  Sun Jan 26 11:21:58 2020 +0000
@@ -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 @@
        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_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 @@
 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
diff -r 19d36abeaa6f -r 3e5f55ff4ae1 sys/stand/efiboot/prompt.c
--- a/sys/stand/efiboot/prompt.c        Sun Jan 26 11:19:36 2020 +0000
+++ b/sys/stand/efiboot/prompt.c        Sun Jan 26 11:21:58 2020 +0000
@@ -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 @@
 {
        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 @@
        }
 
 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;
 }



Home | Main Index | Thread Index | Old Index