Module Name:    src
Committed By:   jmcneill
Date:           Sat Sep 15 17:06:32 UTC 2018

Modified Files:
        src/sys/stand/efiboot: Makefile.efiboot efiboot.c efiboot.h exec.c

Log Message:
Suppress printing size info when calling loadfile with COUNT_KERNEL


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.7 -r1.8 src/sys/stand/efiboot/efiboot.c
cvs rdiff -u -r1.6 -r1.7 src/sys/stand/efiboot/efiboot.h
cvs rdiff -u -r1.5 -r1.6 src/sys/stand/efiboot/exec.c

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.4 src/sys/stand/efiboot/Makefile.efiboot:1.5
--- src/sys/stand/efiboot/Makefile.efiboot:1.4	Sun Sep  9 17:55:22 2018
+++ src/sys/stand/efiboot/Makefile.efiboot	Sat Sep 15 17:06:32 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.4 2018/09/09 17:55:22 jmcneill Exp $
+# $NetBSD: Makefile.efiboot,v 1.5 2018/09/15 17:06:32 jmcneill Exp $
 
 S=		${.CURDIR}/../../..
 
@@ -61,6 +61,7 @@ LDFLAGS+= --defsym=EFI_SUBSYSTEM=0xa
 COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :}
 CPPFLAGS+= -nostdinc -D_STANDALONE
 CPPFLAGS+= -DEFIBOOT
+CPPFLAGS+= -DPROGRESS_FN=efi_progress
 
 CPPFLAGS+= -Wall -Wmissing-prototypes
 CPPFLAGS+= -Wno-pointer-sign

Index: src/sys/stand/efiboot/efiboot.c
diff -u src/sys/stand/efiboot/efiboot.c:1.7 src/sys/stand/efiboot/efiboot.c:1.8
--- src/sys/stand/efiboot/efiboot.c:1.7	Sat Sep 15 16:41:57 2018
+++ src/sys/stand/efiboot/efiboot.c	Sat Sep 15 17:06:32 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: efiboot.c,v 1.7 2018/09/15 16:41:57 jmcneill Exp $ */
+/* $NetBSD: efiboot.c,v 1.8 2018/09/15 17:06:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcne...@invisible.ca>
@@ -31,10 +31,14 @@
 #include "efiblock.h"
 #include "efifdt.h"
 
+#include <sys/reboot.h>
+
 EFI_HANDLE IH;
 EFI_DEVICE_PATH *efi_bootdp;
 EFI_LOADED_IMAGE *efi_li;
 
+int howto = 0;
+
 static EFI_PHYSICAL_ADDRESS heap_start;
 static UINTN heap_size = 1 * 1024 * 1024;
 static EFI_EVENT delay_ev = 0;
@@ -133,3 +137,16 @@ efi_delay(int us)
 	uefi_call_wrapper(BS->SetTimer, 3, delay_ev, TimerRelative, us * 10);
 	uefi_call_wrapper(BS->WaitForEvent, 3, 1, &delay_ev, &val);
 }
+
+void
+efi_progress(const char *fmt, ...)
+{
+	va_list ap;
+
+	if ((howto & AB_SILENT) != 0)
+		return;
+
+	va_start(ap, fmt);
+	vprintf(fmt, ap);
+	va_end(ap);
+}

Index: src/sys/stand/efiboot/efiboot.h
diff -u src/sys/stand/efiboot/efiboot.h:1.6 src/sys/stand/efiboot/efiboot.h:1.7
--- src/sys/stand/efiboot/efiboot.h:1.6	Sun Sep  9 18:00:20 2018
+++ src/sys/stand/efiboot/efiboot.h	Sat Sep 15 17:06:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: efiboot.h,v 1.6 2018/09/09 18:00:20 jmcneill Exp $	*/
+/*	$NetBSD: efiboot.h,v 1.7 2018/09/15 17:06:32 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka <non...@netbsd.org>
@@ -32,6 +32,8 @@
 #include <lib/libsa/stand.h>
 #include <lib/libkern/libkern.h>
 
+#include <loadfile.h>
+
 #include "efiboot_machdep.h"
 
 struct boot_command {
@@ -56,6 +58,7 @@ int set_initrd_path(char *);
 char *get_initrd_path(void);
 int set_dtb_path(char *);
 char *get_dtb_path(void);
+extern int howto;
 
 /* console.c */
 int ischar(void);

Index: src/sys/stand/efiboot/exec.c
diff -u src/sys/stand/efiboot/exec.c:1.5 src/sys/stand/efiboot/exec.c:1.6
--- src/sys/stand/efiboot/exec.c:1.5	Sun Sep  9 13:37:54 2018
+++ src/sys/stand/efiboot/exec.c	Sat Sep 15 17:06:32 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.5 2018/09/09 13:37:54 jmcneill Exp $ */
+/* $NetBSD: exec.c,v 1.6 2018/09/15 17:06:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcne...@invisible.ca>
@@ -29,7 +29,7 @@
 #include "efiboot.h"
 #include "efifdt.h"
 
-#include <loadfile.h>
+#include <sys/reboot.h>
 
 u_long load_offset = 0;
 
@@ -109,13 +109,16 @@ exec_netbsd(const char *fname, const cha
 	EFI_PHYSICAL_ADDRESS addr;
 	u_long marks[MARK_MAX], alloc_size;
 	EFI_STATUS status;
-	int fd;
+	int fd, ohowto;
 
 	load_file(get_initrd_path(), &initrd_addr, &initrd_size);
 	load_file(get_dtb_path(), &dtb_addr, &dtb_size);
 
 	memset(marks, 0, sizeof(marks));
+	ohowto = howto;
+	howto |= AB_SILENT;
 	fd = loadfile(fname, marks, COUNT_KERNEL | LOAD_NOTE);
+	howto = ohowto;
 	if (fd < 0) {
 		printf("boot: %s: %s\n", fname, strerror(errno));
 		return EIO;

Reply via email to