aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/libstub/efistub.h
diff options
context:
space:
mode:
authorArvind Sankar <nivedita@alum.mit.edu>2020-05-20 19:07:54 +0200
committerArd Biesheuvel <ardb@kernel.org>2020-05-20 19:08:19 +0200
commit23d5b73fbfd787c4c63841912b079eac000a7414 (patch)
tree4fc961900e5b6f62e1e2c953c5b0e345a77cc24d /drivers/firmware/efi/libstub/efistub.h
parentefi/printf: Turn vsprintf into vsnprintf (diff)
downloadlinux-dev-23d5b73fbfd787c4c63841912b079eac000a7414.tar.xz
linux-dev-23d5b73fbfd787c4c63841912b079eac000a7414.zip
efi/libstub: Implement printk-style logging
Use the efi_printk function in efi_info/efi_err, and add efi_debug. This allows formatted output at different log levels. Add the notion of a loglevel instead of just quiet/not-quiet, and parse the efi=debug kernel parameter in addition to quiet. Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Link: https://lore.kernel.org/r/20200520170223.GA3333632@rani.riverdale.lan/ Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/efistub.h')
-rw-r--r--drivers/firmware/efi/libstub/efistub.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index caa7dcc71c69..3a323a009836 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -6,6 +6,7 @@
#include <linux/compiler.h>
#include <linux/efi.h>
#include <linux/kernel.h>
+#include <linux/kern_levels.h>
#include <linux/types.h>
#include <asm/efi.h>
@@ -34,7 +35,7 @@
extern bool efi_nochunk;
extern bool efi_nokaslr;
extern bool efi_noinitrd;
-extern bool efi_quiet;
+extern int efi_loglevel;
extern bool efi_novamap;
extern const efi_system_table_t *efi_system_table;
@@ -49,11 +50,12 @@ extern const efi_system_table_t *efi_system_table;
#endif
-#define efi_info(msg) do { \
- if (!efi_quiet) efi_puts("EFI stub: "msg); \
-} while (0)
-
-#define efi_err(msg) efi_puts("EFI stub: ERROR: "msg)
+#define efi_info(fmt, ...) \
+ efi_printk(KERN_INFO fmt, ##__VA_ARGS__)
+#define efi_err(fmt, ...) \
+ efi_printk(KERN_ERR "ERROR: " fmt, ##__VA_ARGS__)
+#define efi_debug(fmt, ...) \
+ efi_printk(KERN_DEBUG "DEBUG: " fmt, ##__VA_ARGS__)
/* Helper macros for the usual case of using simple C variables: */
#ifndef fdt_setprop_inplace_var