]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
efi_loader: Move to normal debug infrastructure
authorAlexander Graf <agraf@suse.de>
Thu, 2 Jun 2016 09:38:27 +0000 (11:38 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 6 Jun 2016 17:39:16 +0000 (13:39 -0400)
We introduced special "DEBUG_EFI" defines when the efi loader
support was new. After giving it a bit of thought, turns out
we really didn't have to - the normal #define DEBUG infrastructure
works well enough for efi loader as well.

So this patch switches to the common debug() and #define DEBUG
way of printing debug information.

Signed-off-by: Alexander Graf <agraf@suse.de>
cmd/bootefi.c
include/efi_loader.h
lib/efi_loader/efi_boottime.c
lib/efi_loader/efi_disk.c
lib/efi_loader/efi_memory.c
lib/efi_loader/efi_runtime.c

index 2a62dce702bb91fed403c2c63e521216ad2e7239..216906527fe8f5c78bf87a9af6f00426aa7d327e 100644 (file)
@@ -206,9 +206,7 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
 #endif
 
        /* Call our payload! */
-#ifdef DEBUG_EFI
-       printf("%s:%d Jumping to 0x%lx\n", __func__, __LINE__, (long)entry);
-#endif
+       debug("%s:%d Jumping to 0x%lx\n", __func__, __LINE__, (long)entry);
 
        if (setjmp(&loaded_image_info.exit_jmp)) {
                efi_status_t status = loaded_image_info.exit_status;
index 3332d61cefc9fc5754f45e9732b5aebc3f557441..97388350eb90e87ad32bbb56ed667ce0b14f12c6 100644 (file)
 
 #include <linux/list.h>
 
-/* #define DEBUG_EFI */
-
-#ifdef DEBUG_EFI
 #define EFI_ENTRY(format, ...) do { \
        efi_restore_gd(); \
-       printf("EFI: Entry %s(" format ")\n", __func__, ##__VA_ARGS__); \
+       debug("EFI: Entry %s(" format ")\n", __func__, ##__VA_ARGS__); \
        } while(0)
-#else
-#define EFI_ENTRY(format, ...) do { \
-       efi_restore_gd(); \
-       } while(0)
-#endif
 
 #define EFI_EXIT(ret) efi_exit_func(ret);
 
index 15a1b90d65a6b4a3987691b3933796d6c2d916fb..be6f5e81124c7959a762ccc07218bd45d58b0f8d 100644 (file)
@@ -6,8 +6,6 @@
  *  SPDX-License-Identifier:     GPL-2.0+
  */
 
-/* #define DEBUG_EFI */
-
 #include <common.h>
 #include <efi_loader.h>
 #include <malloc.h>
@@ -76,9 +74,7 @@ efi_status_t efi_exit_func(efi_status_t ret)
 
 static efi_status_t efi_unsupported(const char *funcname)
 {
-#ifdef DEBUG_EFI
-       printf("EFI: App called into unimplemented function %s\n", funcname);
-#endif
+       debug("EFI: App called into unimplemented function %s\n", funcname);
        return EFI_EXIT(EFI_UNSUPPORTED);
 }
 
index f9ad6156b71eaaac247a0d9cc17a3e681a822cfa..c434c92250aea21b78384a70d23a680607595374 100644 (file)
@@ -84,10 +84,8 @@ static efi_status_t EFIAPI efi_disk_rw_blocks(struct efi_block_io *this,
        blocks = buffer_size / blksz;
        lba += diskobj->offset;
 
-#ifdef DEBUG_EFI
-       printf("EFI: %s:%d blocks=%x lba=%"PRIx64" blksz=%x dir=%d\n", __func__,
-              __LINE__, blocks, lba, blksz, direction);
-#endif
+       debug("EFI: %s:%d blocks=%x lba=%"PRIx64" blksz=%x dir=%d\n", __func__,
+             __LINE__, blocks, lba, blksz, direction);
 
        /* We only support full block access */
        if (buffer_size & (blksz - 1))
@@ -101,9 +99,8 @@ static efi_status_t EFIAPI efi_disk_rw_blocks(struct efi_block_io *this,
        /* We don't do interrupts, so check for timers cooperatively */
        efi_timer_check();
 
-#ifdef DEBUG_EFI
-       printf("EFI: %s:%d n=%lx blocks=%x\n", __func__, __LINE__, n, blocks);
-#endif
+       debug("EFI: %s:%d n=%lx blocks=%x\n", __func__, __LINE__, n, blocks);
+
        if (n != blocks)
                return EFI_EXIT(EFI_DEVICE_ERROR);
 
index 9e669f510266a653e5c81f3b9df9e85486e37040..ad713d0e8be0b94fe42efe145f70a392ece1fc4b 100644 (file)
@@ -6,8 +6,6 @@
  *  SPDX-License-Identifier:     GPL-2.0+
  */
 
-/* #define DEBUG_EFI */
-
 #include <common.h>
 #include <efi_loader.h>
 #include <malloc.h>
index 11d01268d8c03148ae9a2fa4bd83b6698664d8cd..99b5ef11c2e9740a7f916fc3bd04ebefc5b9d7dd 100644 (file)
@@ -165,9 +165,7 @@ static void efi_runtime_detach(ulong offset)
                ulong *p = efi_runtime_detach_list[i].ptr;
                ulong newaddr = patchto ? (patchto + patchoff) : 0;
 
-#ifdef DEBUG_EFI
-               printf("%s: Setting %p to %lx\n", __func__, p, newaddr);
-#endif
+               debug("%s: Setting %p to %lx\n", __func__, p, newaddr);
                *p = newaddr;
        }
 }
@@ -182,10 +180,7 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
        static ulong lastoff = CONFIG_SYS_TEXT_BASE;
 #endif
 
-#ifdef DEBUG_EFI
-       printf("%s: Relocating to offset=%lx\n", __func__, offset);
-#endif
-
+       debug("%s: Relocating to offset=%lx\n", __func__, offset);
        for (; (ulong)rel < (ulong)&__efi_runtime_rel_stop; rel++) {
                ulong base = CONFIG_SYS_TEXT_BASE;
                ulong *p;
@@ -212,10 +207,7 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
                        continue;
                }
 
-#ifdef DEBUG_EFI
-               printf("%s: Setting %p to %lx\n", __func__, p, newaddr);
-#endif
-
+               debug("%s: Setting %p to %lx\n", __func__, p, newaddr);
                *p = newaddr;
                flush_dcache_range((ulong)p & ~(EFI_CACHELINE_SIZE - 1),
                        ALIGN((ulong)&p[1], EFI_CACHELINE_SIZE));