summaryrefslogtreecommitdiff
path: root/src/console
diff options
context:
space:
mode:
Diffstat (limited to 'src/console')
-rw-r--r--src/console/init.c10
-rw-r--r--src/console/printk.c3
2 files changed, 9 insertions, 4 deletions
diff --git a/src/console/init.c b/src/console/init.c
index c6ceab54c2..d7c8cc36b0 100644
--- a/src/console/init.c
+++ b/src/console/init.c
@@ -29,8 +29,14 @@
#include <device/pci.h>
#endif
-#if !defined(__PRE_RAM__)
-int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
+#if !defined(__ROMCC__)
+/* While in romstage, console loglevel is built-time constant. */
+static ROMSTAGE_CONST int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
+
+int console_log_level(int msg_level)
+{
+ return (console_loglevel >= msg_level);
+}
#endif
void console_init(void)
diff --git a/src/console/printk.c b/src/console/printk.c
index 7ea8c06937..fb1194e828 100644
--- a/src/console/printk.c
+++ b/src/console/printk.c
@@ -18,9 +18,8 @@ int do_printk(int msg_level, const char *fmt, ...)
va_list args;
int i;
- if (msg_level > console_loglevel) {
+ if (!console_log_level(msg_level))
return 0;
- }
#if CONFIG_SQUELCH_EARLY_SMP && defined(__PRE_RAM__)
if (!boot_cpu())