summaryrefslogtreecommitdiff
path: root/include/console.h
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2013-10-04 10:22:46 -0400
committerPeter Jones <pjones@redhat.com>2013-10-04 11:51:09 -0400
commit880f9de4123561d18e5c230b4f6e614c5eab960d (patch)
tree6523f2c69fb7264d2c8738222f2ede91b534e60e /include/console.h
parent53a318f52eb3f26c43a27d81dacc8ed9200f2dcc (diff)
downloadefi-boot-shim-880f9de4123561d18e5c230b4f6e614c5eab960d.tar.gz
efi-boot-shim-880f9de4123561d18e5c230b4f6e614c5eab960d.zip
Try to actually make debug printing look reasonable.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'include/console.h')
-rw-r--r--include/console.h22
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 */