]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[memmap] Use memmap_dump_all() to dump debug memory maps
authorMichael Brown <mcb30@ipxe.org>
Thu, 15 May 2025 16:09:35 +0000 (17:09 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 16 May 2025 15:18:36 +0000 (16:18 +0100)
There are several places where get_memmap() is called solely to
produce debug output.  Replace these with calls to memmap_dump_all()
(which will be a no-op unless debugging is enabled).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/interface/pcbios/hidemem.c
src/arch/x86/interface/pcbios/int13.c

index d00c02fb67ca24c30c538abca63270532a5cf2a6..4b80de076a0c66399ccbc05c90fbab10fec7e5f7 100644 (file)
@@ -164,20 +164,19 @@ void int15_intercept ( int intercept ) {
  * returned by the BIOS.
  */
 static void hide_etherboot ( void ) {
-       struct memory_map memmap;
        unsigned int rm_ds_top;
        unsigned int rm_cs_top;
        unsigned int fbms;
 
        /* Dump memory map before mangling */
        DBG ( "Hiding iPXE from system memory map\n" );
-       get_memmap ( &memmap );
+       memmap_dump_all ( 1 );
 
        /* Hook in fake E820 map, if we're testing one */
        if ( FAKE_E820 ) {
                DBG ( "Hooking in fake E820 map\n" );
                fake_e820();
-               get_memmap ( &memmap );
+               memmap_dump_all ( 1 );
        }
 
        /* Initialise the hidden regions */
@@ -210,7 +209,7 @@ static void hide_etherboot ( void ) {
 
        /* Dump memory map after mangling */
        DBG ( "Hidden iPXE from system memory map\n" );
-       get_memmap ( &memmap );
+       memmap_dump_all ( 1 );
 }
 
 /**
@@ -220,7 +219,6 @@ static void hide_etherboot ( void ) {
  * possible.
  */
 static void unhide_etherboot ( int flags __unused ) {
-       struct memory_map memmap;
        int rc;
 
        /* If we have more than one hooked interrupt at this point, it
@@ -251,7 +249,7 @@ static void unhide_etherboot ( int flags __unused ) {
 
        /* Dump memory map after unhiding */
        DBG ( "Unhidden iPXE from system memory map\n" );
-       get_memmap ( &memmap );
+       memmap_dump_all ( 1 );
 }
 
 /** Hide Etherboot startup function */
index 045d78e8db1528da3b37964c7f68392f87bc25b5..3fb25d261987aee458ca51a38a30d3d0a4f45ede 100644 (file)
@@ -31,12 +31,12 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #include <errno.h>
 #include <assert.h>
 #include <ipxe/blockdev.h>
-#include <ipxe/io.h>
 #include <ipxe/acpi.h>
 #include <ipxe/sanboot.h>
 #include <ipxe/device.h>
 #include <ipxe/pci.h>
 #include <ipxe/eltorito.h>
+#include <ipxe/memmap.h>
 #include <realmode.h>
 #include <bios.h>
 #include <biosint.h>
@@ -1523,7 +1523,6 @@ static int int13_load_eltorito ( unsigned int drive, struct segoff *address ) {
  */
 static int int13_boot ( unsigned int drive,
                        struct san_boot_config *config __unused ) {
-       struct memory_map memmap;
        struct segoff address;
        int rc;
 
@@ -1537,7 +1536,7 @@ static int int13_boot ( unsigned int drive,
         * many problems that turn out to be memory-map related that
         * it's worth doing.
         */
-       get_memmap ( &memmap );
+       memmap_dump_all ( 1 );
 
        /* Jump to boot sector */
        if ( ( rc = call_bootsector ( address.segment, address.offset,