Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60470 )
Change subject: console: Create helper function to get max console log level ......................................................................
console: Create helper function to get max console log level
This patch takes console level as argument and returns log level as per `loglevel.h` file to be used while printing serial messages.
Signed-off-by: Subrata Banik subratabanik@google.com Change-Id: I56349f22c71c9db757b2be8eeb2dbfe959f80397 --- M src/console/init.c M src/include/console/console.h 2 files changed, 16 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/60470/1
diff --git a/src/console/init.c b/src/console/init.c index 4427d68..9b1f03c 100644 --- a/src/console/init.c +++ b/src/console/init.c @@ -45,6 +45,21 @@ return 0; }
+int get_max_console_log_level(int console_level) +{ + if (console_level == CONSOLE_LOG_NONE) + return BIOS_NEVER; + + if (console_level == CONSOLE_LOG_FAST) + if (CONFIG(CONSOLE_CBMEM)) + return BIOS_DEBUG; + + if (console_level == CONSOLE_LOG_ALL) + return get_log_level(); + + return 0; +} + void console_init(void) { init_log_level(); diff --git a/src/include/console/console.h b/src/include/console/console.h index 8849df3..be993b0 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -49,6 +49,7 @@ #if __CONSOLE_ENABLE__ void console_init(void); int console_log_level(int msg_level); +int get_max_console_log_level(int console_level);
int printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); int vprintk(int msg_level, const char *fmt, va_list args);