Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/gnu-efi/dist Import gnu-efi-3.0.14



details:   https://anonhg.NetBSD.org/src/rev/5740a1072179
branches:  trunk
changeset: 1023889:5740a1072179
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Sep 30 18:50:09 2021 +0000

description:
Import gnu-efi-3.0.14

diffstat:

 sys/external/bsd/gnu-efi/dist/Make.defaults                |    8 +-
 sys/external/bsd/gnu-efi/dist/Make.rules                   |   10 +-
 sys/external/bsd/gnu-efi/dist/Makefile                     |    2 +-
 sys/external/bsd/gnu-efi/dist/apps/bltgrid.c               |    5 +-
 sys/external/bsd/gnu-efi/dist/apps/lfbgrid.c               |   10 +-
 sys/external/bsd/gnu-efi/dist/apps/modelist.c              |    4 +-
 sys/external/bsd/gnu-efi/dist/apps/setjmp.c                |    9 +-
 sys/external/bsd/gnu-efi/dist/gnuefi/Makefile              |    4 +-
 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-aarch64.S    |    4 +-
 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-arm.S        |    4 +-
 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-ia32.S       |    7 +-
 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-ia64.S       |    4 +-
 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-mips64el.S   |    4 +-
 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-riscv64.S    |  138 +++
 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-x86_64.S     |    5 +-
 sys/external/bsd/gnu-efi/dist/gnuefi/elf_riscv64_efi.lds   |   79 ++
 sys/external/bsd/gnu-efi/dist/gnuefi/reloc_riscv64.c       |   93 ++
 sys/external/bsd/gnu-efi/dist/inc/efi.h                    |   24 +-
 sys/external/bsd/gnu-efi/dist/inc/eficonex.h               |  113 +++
 sys/external/bsd/gnu-efi/dist/inc/efidevp.h                |   98 ++-
 sys/external/bsd/gnu-efi/dist/inc/efierr.h                 |    3 +-
 sys/external/bsd/gnu-efi/dist/inc/efilink.h                |    9 +-
 sys/external/bsd/gnu-efi/dist/inc/efiprot.h                |   17 +-
 sys/external/bsd/gnu-efi/dist/inc/efirtlib.h               |   18 +-
 sys/external/bsd/gnu-efi/dist/inc/efisetjmp.h              |    6 +-
 sys/external/bsd/gnu-efi/dist/inc/efishell.h               |  451 +++++++++++++
 sys/external/bsd/gnu-efi/dist/inc/lib.h                    |   94 ++
 sys/external/bsd/gnu-efi/dist/inc/libsmbios.h              |   21 +-
 sys/external/bsd/gnu-efi/dist/inc/mips64el/efibind.h       |    6 +-
 sys/external/bsd/gnu-efi/dist/inc/riscv64/efibind.h        |  133 +++
 sys/external/bsd/gnu-efi/dist/inc/riscv64/efilibplat.h     |    9 +
 sys/external/bsd/gnu-efi/dist/inc/riscv64/efisetjmp_arch.h |   40 +
 sys/external/bsd/gnu-efi/dist/lib/Makefile                 |    4 +-
 sys/external/bsd/gnu-efi/dist/lib/cmdline.c                |    8 +-
 sys/external/bsd/gnu-efi/dist/lib/data.c                   |   27 +-
 sys/external/bsd/gnu-efi/dist/lib/error.c                  |    6 +-
 sys/external/bsd/gnu-efi/dist/lib/guid.c                   |    6 +-
 sys/external/bsd/gnu-efi/dist/lib/pause.c                  |   17 +
 sys/external/bsd/gnu-efi/dist/lib/riscv64/initplat.c       |   13 +
 sys/external/bsd/gnu-efi/dist/lib/riscv64/math.c           |   64 +
 sys/external/bsd/gnu-efi/dist/lib/riscv64/setjmp.S         |   71 ++
 sys/external/bsd/gnu-efi/dist/lib/runtime/efirtlib.c       |   30 +-
 sys/external/bsd/gnu-efi/dist/lib/runtime/rtstr.c          |   27 +-
 sys/external/bsd/gnu-efi/dist/lib/smbios.c                 |    4 +-
 sys/external/bsd/gnu-efi/dist/lib/str.c                    |    8 +-
 45 files changed, 1601 insertions(+), 116 deletions(-)

diffs (truncated from 2453 to 300 lines):

diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/Make.defaults
--- a/sys/external/bsd/gnu-efi/dist/Make.defaults       Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/Make.defaults       Thu Sep 30 18:50:09 2021 +0000
@@ -62,12 +62,12 @@
 
 # Host/target identification
 OS           := $(shell uname -s)
-HOSTARCH     ?= $(shell $(HOSTCC) -dumpmachine | cut -f1 -d- | sed -e s,i[3456789]86,ia32, -e 's,armv7.*,arm,' )
-ARCH         ?= $(shell $(HOSTCC) -dumpmachine | cut -f1 -d- | sed -e s,i[3456789]86,ia32, -e 's,armv7.*,arm,' )
+HOSTARCH     ?= $(shell $(HOSTCC) -dumpmachine | cut -f1 -d- | sed -e s,i[3456789]86,ia32, -e 's,armv[67].*,arm,' )
+ARCH         ?= $(shell $(HOSTCC) -dumpmachine | cut -f1 -d- | sed -e s,i[3456789]86,ia32, -e 's,armv[67].*,arm,' )
 
 # Get ARCH from the compiler if cross compiling 
 ifneq ($(CROSS_COMPILE),)
-  override ARCH := $(shell $(CC) -dumpmachine | cut -f1 -d-| sed -e s,i[3456789]86,ia32, -e 's,armv7.*,arm,' )
+  override ARCH := $(shell $(CC) -dumpmachine | cut -f1 -d-| sed -e s,i[3456789]86,ia32, -e 's,armv[67].*,arm,' )
 endif
 
 # FreeBSD (and possibly others) reports amd64 instead of x86_64
@@ -142,10 +142,12 @@
 ifneq ($(ARCH),aarch64)
 ifneq ($(ARCH),arm)
 ifneq ($(ARCH),mips64el)
+ifneq ($(ARCH),riscv64)
 export HAVE_EFI_OBJCOPY=y
 endif
 endif
 endif
+endif
 
 ifneq ($(ARCH),arm)
 export LIBGCC=$(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/Make.rules
--- a/sys/external/bsd/gnu-efi/dist/Make.rules  Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/Make.rules  Thu Sep 30 18:50:09 2021 +0000
@@ -51,8 +51,14 @@
 %.o: %.c
        $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
 
-%.S: %.c
+%.s: %.c
        $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -S $< -o $@
 
-%.E: %.c
+%.i: %.c
        $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@
+
+%.o: %.S
+       $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+%.s: %.S
+       $(CC) $(INCDIR) $(CFLAGS) $(CPPFLAGS) -E $< -o $@
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/Makefile
--- a/sys/external/bsd/gnu-efi/dist/Makefile    Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/Makefile    Thu Sep 30 18:50:09 2021 +0000
@@ -34,7 +34,7 @@
 #    SUCH DAMAGE.
 #
 
-VERSION = 3.0.8
+VERSION = 3.0.14
 
 MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
 SRCDIR = $(dir $(MKFILE_PATH))
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/apps/bltgrid.c
--- a/sys/external/bsd/gnu-efi/dist/apps/bltgrid.c      Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/apps/bltgrid.c      Thu Sep 30 18:50:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bltgrid.c,v 1.1.1.1 2018/08/16 18:17:47 jmcneill Exp $ */
+/*     $NetBSD: bltgrid.c,v 1.1.1.2 2021/09/30 18:50:09 jmcneill Exp $ */
 
 #include <efi.h>
 #include <efilib.h>
@@ -48,7 +48,7 @@
                UINTN SizeOfInfo;
                rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo,
                                        &info);
-               if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) {
+               if (rc == EFI_NOT_STARTED) {
                        Print(L"gop->QueryMode() returned %r\n", rc);
                        Print(L"Trying to start GOP with SetMode().\n");
                        rc = uefi_call_wrapper(gop->SetMode, 2, gop,
@@ -86,6 +86,7 @@
                                  info->HorizontalResolution,
                                  info->VerticalResolution,
                                  0);
+               FreePool(PixelBuffer);
                return;
        }
        Print(L"Never found the active video mode?\n");
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/apps/lfbgrid.c
--- a/sys/external/bsd/gnu-efi/dist/apps/lfbgrid.c      Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/apps/lfbgrid.c      Thu Sep 30 18:50:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfbgrid.c,v 1.1.1.1 2018/08/16 18:17:47 jmcneill Exp $ */
+/*     $NetBSD: lfbgrid.c,v 1.1.1.2 2021/09/30 18:50:09 jmcneill Exp $ */
 
 #include <efi.h>
 #include <efilib.h>
@@ -53,7 +53,8 @@
        UINTN NumPixels;
        UINT32 *PixelBuffer;
        UINT32 CopySize, BufferSize;
-#if defined(__x86_64__) || defined(__aarch64__)
+#if defined(__x86_64__) || defined(__aarch64__) || \
+    (defined (__riscv) && __riscv_xlen == 64)
        UINT64 FrameBufferAddr;
 #elif defined(__i386__) || defined(__arm__)
        UINT32 FrameBufferAddr;
@@ -72,7 +73,7 @@
                UINTN SizeOfInfo;
                rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo,
                                        &info);
-               if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) {
+               if (rc == EFI_NOT_STARTED) {
                        Print(L"gop->QueryMode() returned %r\n", rc);
                        Print(L"Trying to start GOP with SetMode().\n");
                        rc = uefi_call_wrapper(gop->SetMode, 2, gop,
@@ -116,7 +117,8 @@
                        Print(L"No linear framebuffer on this device.\n");
                        return;
                }
-#if defined(__x86_64__) || defined(__aarch64__)
+#if defined(__x86_64__) || defined(__aarch64__) || \
+    (defined (__riscv) && __riscv_xlen == 64)
                FrameBufferAddr = (UINT64)gop->Mode->FrameBufferBase;
 #elif defined(__i386__) || defined(__arm__)
                FrameBufferAddr = (UINT32)(UINT64)gop->Mode->FrameBufferBase;
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/apps/modelist.c
--- a/sys/external/bsd/gnu-efi/dist/apps/modelist.c     Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/apps/modelist.c     Thu Sep 30 18:50:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: modelist.c,v 1.1.1.2 2018/08/16 18:17:47 jmcneill Exp $        */
+/*     $NetBSD: modelist.c,v 1.1.1.3 2021/09/30 18:50:09 jmcneill Exp $        */
 
 #include <efi.h>
 #include <efilib.h>
@@ -24,7 +24,7 @@
                UINTN SizeOfInfo;
                rc = uefi_call_wrapper(gop->QueryMode, 4, gop, i, &SizeOfInfo,
                                        &info);
-               if (EFI_ERROR(rc) && rc == EFI_NOT_STARTED) {
+               if (rc == EFI_NOT_STARTED) {
                        Print(L"gop->QueryMode() returned %r\n", rc);
                        Print(L"Trying to start GOP with SetMode().\n");
                        rc = uefi_call_wrapper(gop->SetMode, 2, gop,
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/apps/setjmp.c
--- a/sys/external/bsd/gnu-efi/dist/apps/setjmp.c       Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/apps/setjmp.c       Thu Sep 30 18:50:09 2021 +0000
@@ -1,8 +1,9 @@
-/*     $NetBSD: setjmp.c,v 1.1.1.1 2018/08/16 18:17:47 jmcneill Exp $  */
+/*     $NetBSD: setjmp.c,v 1.1.1.2 2021/09/30 18:50:09 jmcneill Exp $  */
 
 
 #include <efi.h>
 #include <efilib.h>
+#include <efisetjmp.h>
 
 EFI_STATUS
 efi_main(
@@ -14,12 +15,12 @@
        int rc;
 
        InitializeLib(image_handle, systab);
-       rc = setjmp(&env);
+       rc = setjmp(env);
        Print(L"setjmp() = %d\n", rc);
 
        if (rc == 3) {
                Print(L"3 worked\n");
-               longjmp(&env, 0);
+               longjmp(env, 0);
                return 0;
        }
 
@@ -28,6 +29,6 @@
                return 0;
        }
 
-       longjmp(&env, 3);
+       longjmp(env, 3);
        return 0;
 }
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/gnuefi/Makefile
--- a/sys/external/bsd/gnu-efi/dist/gnuefi/Makefile     Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/gnuefi/Makefile     Thu Sep 30 18:50:09 2021 +0000
@@ -54,7 +54,9 @@
 
 all:   $(TARGETS)
 
-libgnuefi.a: $(patsubst %,libgnuefi.a(%),$(OBJS))
+libgnuefi.a: $(OBJS)
+       $(AR) $(ARFLAGS) $@ $^
+
 
 clean:
        rm -f $(TARGETS) *~ *.o $(OBJS)
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-aarch64.S
--- a/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-aarch64.S   Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-aarch64.S   Thu Sep 30 18:50:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crt0-efi-aarch64.S,v 1.1.1.1 2018/08/16 18:17:47 jmcneill Exp $        */
+/*     $NetBSD: crt0-efi-aarch64.S,v 1.1.1.2 2021/09/30 18:50:09 jmcneill Exp $        */
 
 /*
  * crt0-efi-aarch64.S - PE/COFF header for AArch64 EFI applications
@@ -36,7 +36,7 @@
        .short  2                               // nr_sections
        .long   0                               // TimeDateStamp
        .long   0                               // PointerToSymbolTable
-       .long   1                               // NumberOfSymbols
+       .long   0                               // NumberOfSymbols
        .short  section_table - optional_header // SizeOfOptionalHeader
        .short  0x206                           // Characteristics.
                                                // IMAGE_FILE_DEBUG_STRIPPED |
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-arm.S
--- a/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-arm.S       Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-arm.S       Thu Sep 30 18:50:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crt0-efi-arm.S,v 1.1.1.1 2018/08/16 18:17:47 jmcneill Exp $    */
+/*     $NetBSD: crt0-efi-arm.S,v 1.1.1.2 2021/09/30 18:50:09 jmcneill Exp $    */
 
 /*
  * crt0-efi-arm.S - PE/COFF header for ARM EFI applications
@@ -36,7 +36,7 @@
        .short  2                               // nr_sections
        .long   0                               // TimeDateStamp
        .long   0                               // PointerToSymbolTable
-       .long   1                               // NumberOfSymbols
+       .long   0                               // NumberOfSymbols
        .short  section_table - optional_header // SizeOfOptionalHeader
        .short  0x306                           // Characteristics.
                                                // IMAGE_FILE_32BIT_MACHINE |
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-ia32.S
--- a/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-ia32.S      Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-ia32.S      Thu Sep 30 18:50:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crt0-efi-ia32.S,v 1.1.1.1 2014/04/01 16:16:08 jakllsch Exp $   */
+/*     $NetBSD: crt0-efi-ia32.S,v 1.1.1.2 2021/09/30 18:50:09 jmcneill Exp $   */
 
 /* crt0-efi-ia32.S - x86 EFI startup code.
    Copyright (C) 1999 Hewlett-Packard Co.
@@ -74,5 +74,6 @@
 #define IMAGE_REL_ABSOLUTE     0
        .section .reloc
        .long   dummy                                   // Page RVA
-       .long   10                                      // Block Size (2*4+2)
-       .word   (IMAGE_REL_ABSOLUTE<<12) +  0           // reloc for dummy
+       .long   12                                      // Block Size (2*4+2*2), must be aligned by 32 Bits
+       .word   (IMAGE_REL_ABSOLUTE<<12) +  0           // reloc for dummy
+       .word   (IMAGE_REL_ABSOLUTE<<12) +  0           // reloc for dummy
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-ia64.S
--- a/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-ia64.S      Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-ia64.S      Thu Sep 30 18:50:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crt0-efi-ia64.S,v 1.1.1.1 2014/04/01 16:16:08 jakllsch Exp $   */
+/*     $NetBSD: crt0-efi-ia64.S,v 1.1.1.2 2021/09/30 18:50:09 jmcneill Exp $   */
 
 /* crt0-efi-ia64.S - IA-64 EFI startup code.
    Copyright (C) 1999 Hewlett-Packard Co.
@@ -84,6 +84,6 @@
 
        .section .reloc, "a"
        data4   _start_plabel                           // Page RVA
-       data4   12                                      // Block Size (2*4+2*2)
+       data4   12                                      // Block Size (2*4+2*2), must be aligned by 32 Bits
        data2   (IMAGE_REL_BASED_DIR64<<12) +  0        // reloc for plabel's entry point
        data2   (IMAGE_REL_BASED_DIR64<<12) +  8        // reloc for plabel's global pointer
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-mips64el.S
--- a/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-mips64el.S  Thu Sep 30 18:33:28 2021 +0000
+++ b/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-mips64el.S  Thu Sep 30 18:50:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crt0-efi-mips64el.S,v 1.1.1.1 2018/08/16 18:17:47 jmcneill Exp $       */
+/*     $NetBSD: crt0-efi-mips64el.S,v 1.1.1.2 2021/09/30 18:50:09 jmcneill Exp $       */
 
 /*
  * crt0-efi-mips64el.S - PE/COFF header for MIPS64 EFI applications
@@ -37,7 +37,7 @@
        .short  2                               // nr_sections
        .long   0                               // TimeDateStamp
        .long   0                               // PointerToSymbolTable
-       .long   1                               // NumberOfSymbols
+       .long   0                               // NumberOfSymbols
        .short  section_table - optional_header // SizeOfOptionalHeader
        .short  0x206                           // Characteristics.
                                                // IMAGE_FILE_DEBUG_STRIPPED |
diff -r 40f17cde3661 -r 5740a1072179 sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-riscv64.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/external/bsd/gnu-efi/dist/gnuefi/crt0-efi-riscv64.S   Thu Sep 30 18:50:09 2021 +0000
@@ -0,0 +1,138 @@
+/*     $NetBSD: crt0-efi-riscv64.S,v 1.1.1.1 2021/09/30 18:50:09 jmcneill Exp $        */
+
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copright (C) 2014 Linaro Ltd. <ard.biesheuvel%linaro.org@localhost>
+ * Copright (C) 2018 Alexander Graf <agraf%suse.de@localhost>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:



Home | Main Index | Thread Index | Old Index