aboutsummaryrefslogtreecommitdiff
path: root/src/include/ipxe/efi/efi.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2013-03-15 19:09:45 +0000
committerMichael Brown <mcb30@ipxe.org>2013-03-19 23:21:15 +0000
commit6b9b44319fa1c50d9c91c80cd266b15cbd173ada (patch)
treeb0c24419a3b7794cbb2698cce8da8e7cbeee97e2 /src/include/ipxe/efi/efi.h
parente05dcf0e017f7dbd6f0859ce250cdbbbef16103e (diff)
downloadipxe-6b9b44319fa1c50d9c91c80cd266b15cbd173ada.zip
ipxe-6b9b44319fa1c50d9c91c80cd266b15cbd173ada.tar.gz
ipxe-6b9b44319fa1c50d9c91c80cd266b15cbd173ada.tar.bz2
[efi] Add EFI-specific debugging macros
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/efi/efi.h')
-rw-r--r--src/include/ipxe/efi/efi.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi.h b/src/include/ipxe/efi/efi.h
index 8a216b5..880872a 100644
--- a/src/include/ipxe/efi/efi.h
+++ b/src/include/ipxe/efi/efi.h
@@ -140,6 +140,40 @@ extern EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;
extern EFI_SYSTEM_TABLE *efi_systab;
extern const char * efi_strerror ( EFI_STATUS efirc );
+
+extern void dbg_efi_protocols ( EFI_HANDLE handle );
+extern void dbg_efi_devpath ( EFI_DEVICE_PATH_PROTOCOL *path );
+
+#define DBG_EFI_PROTOCOLS_IF( level, handle ) do { \
+ if ( DBG_ ## level ) { \
+ dbg_efi_protocols ( handle ); \
+ } \
+ } while ( 0 )
+
+#define DBG_EFI_DEVPATH_IF( level, path ) do { \
+ if ( DBG_ ## level ) { \
+ dbg_efi_devpath ( path ); \
+ } \
+ } while ( 0 )
+
+#define DBGC_EFI_PROTOCOLS_IF( level, id, ... ) do { \
+ DBG_AC_IF ( level, id ); \
+ DBG_EFI_PROTOCOLS_IF ( level, __VA_ARGS__ ); \
+ DBG_DC_IF ( level ); \
+ } while ( 0 )
+
+#define DBGC_EFI_DEVPATH_IF( level, id, ... ) do { \
+ DBG_AC_IF ( level, id ); \
+ DBG_EFI_DEVPATH_IF ( level, __VA_ARGS__ ); \
+ DBG_DC_IF ( level ); \
+ } while ( 0 )
+
+#define DBGC_EFI_PROTOCOLS( ... ) \
+ DBGC_EFI_PROTOCOLS_IF( LOG, ##__VA_ARGS__ )
+
+#define DBGC_EFI_DEVPATH( ... ) \
+ DBGC_EFI_DEVPATH_IF( LOG, ##__VA_ARGS__ )
+
extern EFI_STATUS efi_init ( EFI_HANDLE image_handle,
EFI_SYSTEM_TABLE *systab );