Port-amd64 archive

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

Re: Remove debug messages from uefiboot



I got a few hints so here is an updated patch.

We can't remove the whole function as it has side effects (sets efi_loaddr).
The removal of the efi_memory_probe_reloc() declaration is intentional - there
is no definition nor any use of it.

Martin

Index: Makefile.efiboot
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/efiboot/Makefile.efiboot,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile.efiboot
--- Makefile.efiboot	29 Jun 2024 07:52:16 -0000	1.23
+++ Makefile.efiboot	28 Nov 2024 18:53:42 -0000
@@ -73,6 +73,7 @@ CPPFLAGS+= -DLIBSA_ENABLE_LS_OP
 
 #CPPFLAGS+= -DARP_DEBUG
 #CPPFLAGS+= -DBOOTP_DEBUG
+#CPPFLAGS+= -DMEM_DEBUG
 #CPPFLAGS+= -DNET_DEBUG
 #CPPFLAGS+= -DNETIF_DEBUG
 #CPPFLAGS+= -DNFS_DEBUG
Index: efiboot.h
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/efiboot/efiboot.h,v
retrieving revision 1.12
diff -u -p -r1.12 efiboot.h
--- efiboot.h	20 Apr 2023 00:42:24 -0000	1.12
+++ efiboot.h	28 Nov 2024 18:53:42 -0000
@@ -85,7 +85,6 @@ void efi_disk_show(void);
 
 /* efimemory.c */
 void efi_memory_probe(void);
-void efi_memory_probe_reloc(EFI_PHYSICAL_ADDRESS, EFI_PHYSICAL_ADDRESS, bool);
 void efi_memory_show_map(bool, bool);
 EFI_MEMORY_DESCRIPTOR *efi_memory_get_map(UINTN *, UINTN *, UINTN *, UINT32 *,
     bool);
Index: efimemory.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/efiboot/efimemory.c,v
retrieving revision 1.10
diff -u -p -r1.10 efimemory.c
--- efimemory.c	14 May 2023 09:07:54 -0000	1.10
+++ efimemory.c	28 Nov 2024 18:53:42 -0000
@@ -328,12 +328,14 @@ getextmemx(void)
 void
 efi_memory_probe(void)
 {
-	EFI_MEMORY_DESCRIPTOR *mdtop, *md, *next;
 	EFI_STATUS status;
 	EFI_PHYSICAL_ADDRESS bouncebuf;
+#ifdef MEM_DEBUG
+	EFI_MEMORY_DESCRIPTOR *mdtop, *md, *next;
 	UINTN i, n, NoEntries, MapKey, DescriptorSize, MappingSize;
 	UINT32 DescriptorVersion;
 	int memtype;
+#endif
 
 	bouncebuf = EFI_ALLOCATE_MAX_ADDRESS;
 	status = uefi_call_wrapper(BS->AllocatePages, 4, AllocateMaxAddress,
@@ -342,6 +344,7 @@ efi_memory_probe(void)
 		panic("couldn't allocate kernel space.");
 	efi_loadaddr = bouncebuf;
 
+#ifdef MEM_DEBUG
 	mdtop = efi_memory_get_map(&NoEntries, &MapKey, &DescriptorSize,
 	    &DescriptorVersion, false);
 	printf(" mem[");
@@ -364,6 +367,7 @@ efi_memory_probe(void)
 	printf("]\n");
 
 	FreePool(mdtop);
+#endif
 }
 
 void



Home | Main Index | Thread Index | Old Index