[PATCH 6/9] console: allow to specify ouput kfifo size via CONSOLE_KFIFO_OUTPUT_SIZE

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Thu Dec 13 11:40:07 EST 2012


1024 by default
4096 if DEBUG_INFO

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 common/Kconfig   |    7 +++++++
 common/console.c |    4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index 57119dc..6a0c345 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -477,6 +477,13 @@ config CONSOLE_FULL
 	  once the first console is registered. Recommended for most
 	  usecases.
 
+config CONSOLE_KFIFO_OUTPUT_SIZE
+	prompt "kfifo output size"
+	depends on CONSOLE_FULL
+	int
+	default 4086 if DEBUG_INFO
+	default 1024
+
 choice
 	prompt "Console activation strategy"
 	depends on CONSOLE_FULL
diff --git a/common/console.c b/common/console.c
index d8fe5b6..aeef0a2 100644
--- a/common/console.c
+++ b/common/console.c
@@ -48,7 +48,7 @@ static int initialized = 0;
 #define CONSOLE_BUFFER_SIZE	1024
 
 static char console_input_buffer[CONSOLE_BUFFER_SIZE];
-static char console_output_buffer[CONSOLE_BUFFER_SIZE];
+static char console_output_buffer[CONFIG_CONSOLE_KFIFO_OUTPUT_SIZE];
 
 static struct kfifo __console_input_fifo;
 static struct kfifo __console_output_fifo;
@@ -138,7 +138,7 @@ static void console_init_early(void)
 	kfifo_init(console_input_fifo, console_input_buffer,
 			CONSOLE_BUFFER_SIZE);
 	kfifo_init(console_output_fifo, console_output_buffer,
-			CONSOLE_BUFFER_SIZE);
+			CONFIG_CONSOLE_KFIFO_OUTPUT_SIZE);
 
 	initialized = CONSOLE_INITIALIZED_BUFFER;
 }
-- 
1.7.10.4




More information about the barebox mailing list