mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-29 10:01:43 +00:00
console: allow to record console output before ready
Allow to record the console output before before U-Boot has a console ready. This patch allows to test the console output in sandbox test based on console record. It is possible because GD_FLG_RECORD and GD_FLG_SERIAL_READY are 2 independent flags. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
93cdb52b2a
commit
bf80edb91a
1 changed files with 8 additions and 8 deletions
|
@ -519,6 +519,10 @@ void putc(const char c)
|
||||||
{
|
{
|
||||||
if (!gd)
|
if (!gd)
|
||||||
return;
|
return;
|
||||||
|
#ifdef CONFIG_CONSOLE_RECORD
|
||||||
|
if ((gd->flags & GD_FLG_RECORD) && gd->console_out.start)
|
||||||
|
membuff_putbyte((struct membuff *)&gd->console_out, c);
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_SANDBOX
|
#ifdef CONFIG_SANDBOX
|
||||||
/* sandbox can send characters to stdout before it has a console */
|
/* sandbox can send characters to stdout before it has a console */
|
||||||
if (!(gd->flags & GD_FLG_SERIAL_READY)) {
|
if (!(gd->flags & GD_FLG_SERIAL_READY)) {
|
||||||
|
@ -533,10 +537,6 @@ void putc(const char c)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_CONSOLE_RECORD
|
|
||||||
if ((gd->flags & GD_FLG_RECORD) && gd->console_out.start)
|
|
||||||
membuff_putbyte((struct membuff *)&gd->console_out, c);
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_SILENT_CONSOLE
|
#ifdef CONFIG_SILENT_CONSOLE
|
||||||
if (gd->flags & GD_FLG_SILENT) {
|
if (gd->flags & GD_FLG_SILENT) {
|
||||||
if (!(gd->flags & GD_FLG_DEVINIT))
|
if (!(gd->flags & GD_FLG_DEVINIT))
|
||||||
|
@ -567,6 +567,10 @@ void puts(const char *s)
|
||||||
{
|
{
|
||||||
if (!gd)
|
if (!gd)
|
||||||
return;
|
return;
|
||||||
|
#ifdef CONFIG_CONSOLE_RECORD
|
||||||
|
if ((gd->flags & GD_FLG_RECORD) && gd->console_out.start)
|
||||||
|
membuff_put((struct membuff *)&gd->console_out, s, strlen(s));
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_SANDBOX
|
#ifdef CONFIG_SANDBOX
|
||||||
/* sandbox can send characters to stdout before it has a console */
|
/* sandbox can send characters to stdout before it has a console */
|
||||||
if (!(gd->flags & GD_FLG_SERIAL_READY)) {
|
if (!(gd->flags & GD_FLG_SERIAL_READY)) {
|
||||||
|
@ -584,10 +588,6 @@ void puts(const char *s)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_CONSOLE_RECORD
|
|
||||||
if ((gd->flags & GD_FLG_RECORD) && gd->console_out.start)
|
|
||||||
membuff_put((struct membuff *)&gd->console_out, s, strlen(s));
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_SILENT_CONSOLE
|
#ifdef CONFIG_SILENT_CONSOLE
|
||||||
if (gd->flags & GD_FLG_SILENT) {
|
if (gd->flags & GD_FLG_SILENT) {
|
||||||
if (!(gd->flags & GD_FLG_DEVINIT))
|
if (!(gd->flags & GD_FLG_DEVINIT))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue