aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-10-17 14:31:58 +0200
committerTom Rini <trini@konsulko.com>2020-10-27 13:50:53 -0400
commitd094a0734cee439fc8483118694079c85b1cc3db (patch)
treeb6a5c9e77308a964f09b721252d46443807e53f4 /include
parent993a06b6144d54ae2ad83cc25c18acb9d1720ad0 (diff)
downloadu-boot-d094a0734cee439fc8483118694079c85b1cc3db.zip
u-boot-d094a0734cee439fc8483118694079c85b1cc3db.tar.gz
u-boot-d094a0734cee439fc8483118694079c85b1cc3db.tar.bz2
log: allow for message continuation
Some drivers use macro pr_cont() for continuing a message sent via printk. Hence if we want to convert printk messaging to using the logging system, we must support continuation of log messages too. As pr_cont() does not provide a message level we need a means of remembering the last log level. With the patch a pseudo log level LOGL_CONT as well as a pseudo log category LOGC_CONT are introduced. Using these results in the application of the same log level and category as in the previous log message. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/global_data.h12
-rw-r--r--include/log.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index db83f59..0157af1 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -371,6 +371,18 @@ struct global_data {
* while another message is being processed.
*/
bool processing_msg;
+ /**
+ * @logc_prev: logging category of previous message
+ *
+ * This value is used as logging category for continuation messages.
+ */
+ int logc_prev;
+ /**
+ * @logl_pref: logging level of the previous message
+ *
+ * This value is used as logging level for continuation messages.
+ */
+ int logl_prev;
#endif
#if CONFIG_IS_ENABLED(BLOBLIST)
/**
diff --git a/include/log.h b/include/log.h
index 6de5e61..58787a3 100644
--- a/include/log.h
+++ b/include/log.h
@@ -38,6 +38,7 @@ enum log_level_t {
LOGL_FIRST = LOGL_EMERG,
LOGL_MAX = LOGL_DEBUG_IO,
+ LOGL_CONT = -1, /* Use same log level as in previous call */
};
/**
@@ -65,6 +66,7 @@ enum log_category_t {
LOGC_COUNT, /* Number of log categories */
LOGC_END, /* Sentinel value for a list of log categories */
+ LOGC_CONT = -1, /* Use same category as in previous call */
};
/* Helper to cast a uclass ID to a log category */