1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

console: Add a console buffer

It is useful to be able to record console output and provide console input
via a buffer. This provides sandbox with the ability to run a command and
check its output. If the console is set to silent then no visible output
is generated.

This also provides a means to fix the problem where tests produce unwanted
output, such as errors or warnings. This can be confusing. We can instead
set the console to silent and record this output. It can be checked later
in the test if required.

It is possible that this may prove useful for non-test situations. For
example the console output may be suppressed for normal operations, but
recorded and stored for access by the OS. That feature is not implemented
at present.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2015-11-08 23:47:48 -07:00
parent b7b65090b2
commit 9854a8748c
6 changed files with 125 additions and 1 deletions

View File

@@ -20,6 +20,28 @@ void clear_ctrlc(void); /* clear the Control-C condition */
int disable_ctrlc(int); /* 1 to disable, 0 to enable Control-C detect */
int confirm_yesno(void); /* 1 if input is "y", "Y", "yes" or "YES" */
/**
* console_record_init() - set up the console recording buffers
*
* This should be called as soon as malloc() is available so that the maximum
* amount of console output can be recorded.
*/
int console_record_init(void);
/**
* console_record_reset() - reset the console recording buffers
*
* Removes any data in the buffers
*/
void console_record_reset(void);
/**
* console_record_reset_enable() - reset and enable the console buffers
*
* This should be called to enable the console buffer.
*/
void console_record_reset_enable(void);
/*
* CONSOLE multiplexing.
*/