diff mbox series

[v2,3/3] lib: sbi: Make the console print buffer size configurable

Message ID 20240624141903.2305676-4-wxjstz@126.com
State Superseded
Headers show
Series print befor sbi_console_init | expand

Commit Message

Xiang W June 24, 2024, 2:18 p.m. UTC
Before the console is initialized, the contents of the console print
will be cached. If there is a lot of information that needs to be
output before the console is initialized, can configure it through
make menuconfig.

Signed-off-by: Xiang W <wxjstz@126.com>
---
 lib/sbi/Kconfig       | 4 ++++
 lib/sbi/sbi_console.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Andrew Jones July 1, 2024, 6:26 a.m. UTC | #1
On Mon, Jun 24, 2024 at 10:18:59PM GMT, Xiang W wrote:
> Before the console is initialized, the contents of the console print
> will be cached. If there is a lot of information that needs to be
> output before the console is initialized, can configure it through
> make menuconfig.
> 
> Signed-off-by: Xiang W <wxjstz@126.com>
> ---
>  lib/sbi/Kconfig       | 4 ++++
>  lib/sbi/sbi_console.c | 2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/sbi/Kconfig b/lib/sbi/Kconfig
> index 6cf54ce..fb6852e 100644
> --- a/lib/sbi/Kconfig
> +++ b/lib/sbi/Kconfig
> @@ -62,4 +62,8 @@ config SBI_ECALL_SSE
>  	bool "SSE extension"
>  	default y
>  
> +config SBI_CONSOLE_TBUF_MAX
> +	int "console print buffer size (bytes)"
> +	default 256
> +
>  endmenu
> diff --git a/lib/sbi/sbi_console.c b/lib/sbi/sbi_console.c
> index 1a91f88..acf9f6b 100644
> --- a/lib/sbi/sbi_console.c
> +++ b/lib/sbi/sbi_console.c
> @@ -14,7 +14,7 @@
>  #include <sbi/sbi_scratch.h>
>  #include <sbi/sbi_string.h>
>  
> -#define CONSOLE_TBUF_MAX 256
> +#define CONSOLE_TBUF_MAX CONFIG_SBI_CONSOLE_TBUF_MAX
>  
>  static const struct sbi_console_device *console_dev = NULL;
>  static char console_tbuf[CONSOLE_TBUF_MAX];
> -- 
> 2.43.0
>

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
diff mbox series

Patch

diff --git a/lib/sbi/Kconfig b/lib/sbi/Kconfig
index 6cf54ce..fb6852e 100644
--- a/lib/sbi/Kconfig
+++ b/lib/sbi/Kconfig
@@ -62,4 +62,8 @@  config SBI_ECALL_SSE
 	bool "SSE extension"
 	default y
 
+config SBI_CONSOLE_TBUF_MAX
+	int "console print buffer size (bytes)"
+	default 256
+
 endmenu
diff --git a/lib/sbi/sbi_console.c b/lib/sbi/sbi_console.c
index 1a91f88..acf9f6b 100644
--- a/lib/sbi/sbi_console.c
+++ b/lib/sbi/sbi_console.c
@@ -14,7 +14,7 @@ 
 #include <sbi/sbi_scratch.h>
 #include <sbi/sbi_string.h>
 
-#define CONSOLE_TBUF_MAX 256
+#define CONSOLE_TBUF_MAX CONFIG_SBI_CONSOLE_TBUF_MAX
 
 static const struct sbi_console_device *console_dev = NULL;
 static char console_tbuf[CONSOLE_TBUF_MAX];