summaryrefslogtreecommitdiff
path: root/include/sbi/sbi_scratch.h
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2019-08-08 09:40:22 +0300
committerAnup Patel <anup@brainfault.org>2019-08-09 10:08:33 +0300
commitdbff3e9f12f0abbdf475baaef4760c24af0d4227 (patch)
tree861e23030839b2d218a391d3e29f51398be3b39d /include/sbi/sbi_scratch.h
parentb1318e578b81690d7dcc57019e3f26c2b563bd74 (diff)
downloadopensbi-dbff3e9f12f0abbdf475baaef4760c24af0d4227.tar.xz
lib: Introduce sbi_dprintf() API
This patch introduces new sbi_dprintf() API for runtime debug prints. The sbi_dprintf() will print to console for a given HART only when SBI_SCRATCH_DEBUG_PRINTS option in enabled in sbi_scratch for this HART. We can now add debug prints using sbi_dprintf() at important places in OpenSBI sources. These debug prints will only show up when previous booting stage or compile time parameter sets the SBI_SCRATCH_DEBUG_PRINTS option in scratch space. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/sbi/sbi_scratch.h')
-rw-r--r--include/sbi/sbi_scratch.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h
index 46ea38f..fd18bb2 100644
--- a/include/sbi/sbi_scratch.h
+++ b/include/sbi/sbi_scratch.h
@@ -74,6 +74,8 @@ struct sbi_scratch {
enum sbi_scratch_options {
/** Disable prints during boot */
SBI_SCRATCH_NO_BOOT_PRINTS = (1 << 0),
+ /** Enable runtime debug prints */
+ SBI_SCRATCH_DEBUG_PRINTS = (1 << 1),
};
/** Get pointer to sbi_scratch for current HART */