diff options
| author | Peter Jones <pjones@redhat.com> | 2013-10-04 11:51:09 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2013-10-04 11:51:09 -0400 |
| commit | 4ab978a3697c88827f4099fe5774031caf5baf44 (patch) | |
| tree | 6523f2c69fb7264d2c8738222f2ede91b534e60e /include | |
| parent | 7de74e673435362b35f7fb8fba31cfc75e166363 (diff) | |
| download | efi-boot-shim-4ab978a3697c88827f4099fe5774031caf5baf44.tar.gz efi-boot-shim-4ab978a3697c88827f4099fe5774031caf5baf44.zip | |
Try to actually make debug printing look reasonable.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/console.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/console.h b/include/console.h index fbeb7e68..e6c2818f 100644 --- a/include/console.h +++ b/include/console.h @@ -20,8 +20,6 @@ console_alertbox(CHAR16 **title); void console_notify(CHAR16 *string); void -console_notify_ascii(CHAR8 *string); -void console_reset(void); #define NOSEL 0x7fffffff @@ -66,5 +64,25 @@ struct _EFI_CONSOLE_CONTROL_PROTOCOL { }; extern VOID setup_console (int text); +extern VOID setup_verbosity(VOID); +extern UINT8 verbose; +#define dprint(fmt, ...) ({ \ + UINTN __dprint_ret = 0; \ + if (verbose) \ + __dprint_ret = Print((fmt), ##__VA_ARGS__); \ + __dprint_ret; \ + }) +#define dprinta(fmt, ...) ({ \ + UINTN __dprinta_ret = 0; \ + if (verbose) { \ + UINTN __dprinta_i; \ + CHAR16 *__dprinta_str = AllocateZeroPool((strlena(fmt) + 1) * 2); \ + for (__dprinta_i = 0; fmt[__dprinta_i] != '\0'; __dprinta_i++) \ + __dprinta_str[__dprinta_i] = fmt[__dprinta_i]; \ + __dprinta_ret = Print((__dprinta_str), ##__VA_ARGS__); \ + FreePool(__dprinta_str); \ + } \ + __dprinta_ret; \ + }) #endif /* _SHIM_LIB_CONSOLE_H */ |
