diff options
Diffstat (limited to 'drivers/console')
-rw-r--r-- | drivers/console/aarch32/skeleton_console.S | 18 | ||||
-rw-r--r-- | drivers/console/aarch64/skeleton_console.S | 20 | ||||
-rw-r--r-- | drivers/console/multi_console.c | 17 |
3 files changed, 19 insertions, 36 deletions
diff --git a/drivers/console/aarch32/skeleton_console.S b/drivers/console/aarch32/skeleton_console.S index 45ad13927..a9e13ec44 100644 --- a/drivers/console/aarch32/skeleton_console.S +++ b/drivers/console/aarch32/skeleton_console.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -50,7 +50,7 @@ func console_xxx_register * by later console callback (e.g. putc). * Example: */ - str r1, [r0, #CONSOLE_T_XXX_BASE] + str r1, [r0, #CONSOLE_T_BASE] str r2, [r0, #CONSOLE_T_XXX_SOME_OTHER_VALUE] /* @@ -87,7 +87,7 @@ func console_xxx_putc * console_xxx_t structure pointed to by r1. * Example: */ - ldr r1, [r1, #CONSOLE_T_XXX_BASE] + ldr r1, [r1, #CONSOLE_T_BASE] /* * Write r0 to hardware. @@ -125,7 +125,7 @@ func console_xxx_getc * console_xxx_t structure pointed to by r0. * Example: */ - ldr r1, [r0, #CONSOLE_T_XXX_BASE] + ldr r1, [r0, #CONSOLE_T_BASE] /* * Try to read character into r0 from hardware. @@ -149,7 +149,7 @@ endfunc console_xxx_getc * Function to force a write of all buffered * data that hasn't been output. * In : r0 - pointer to console_xxx_t struct - * Out: r0 - 0 on success, < 0 on error + * Out: void * Clobber list : r0, r1, r2, r3, r4, r5 * --------------------------------------------- */ @@ -159,18 +159,12 @@ func console_xxx_flush * console_xxx_t structure pointed to by r0. * Example: */ - ldr r1, [r0, #CONSOLE_T_XXX_BASE] + ldr r1, [r0, #CONSOLE_T_BASE] /* * Flush all remaining output from hardware FIFOs. Do not return until * all data has been flushed or there was an unrecoverable error. */ - mov r0, #0 - bx lr - - /* Jump here if an unrecoverable error has been encountered. */ -flush_error: - mov r0, #-1 bx lr endfunc console_xxx_flush diff --git a/drivers/console/aarch64/skeleton_console.S b/drivers/console/aarch64/skeleton_console.S index 957ed83a9..7ea2eec9f 100644 --- a/drivers/console/aarch64/skeleton_console.S +++ b/drivers/console/aarch64/skeleton_console.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -50,7 +50,7 @@ func console_xxx_register * by later console callback (e.g. putc). * Example: */ - str x1, [x0, #CONSOLE_T_XXX_BASE] + str x1, [x0, #CONSOLE_T_BASE] str x2, [x0, #CONSOLE_T_XXX_SOME_OTHER_VALUE] /* @@ -87,7 +87,7 @@ func console_xxx_putc * console_xxx_t structure pointed to by x1. * Example: */ - ldr x1, [x1, #CONSOLE_T_XXX_BASE] + ldr x1, [x1, #CONSOLE_T_BASE] /* * Write w0 to hardware. @@ -125,7 +125,7 @@ func console_xxx_getc * console_xxx_t structure pointed to by x0. * Example: */ - ldr x1, [x0, #CONSOLE_T_XXX_BASE] + ldr x1, [x0, #CONSOLE_T_BASE] /* * Try to read character into w0 from hardware. @@ -145,11 +145,11 @@ getc_error: endfunc console_xxx_getc /* --------------------------------------------- - * int console_xxx_flush(console_xxx_t *console) + * void console_xxx_flush(console_xxx_t *console) * Function to force a write of all buffered * data that hasn't been output. * In : x0 - pointer to console_xxx_t struct - * Out: w0 - 0 on success, < 0 on error + * Out: void * Clobber list : x0, x1, x2, x3, x4, x5 * --------------------------------------------- */ @@ -159,18 +159,12 @@ func console_xxx_flush * console_xxx_t structure pointed to by x0. * Example: */ - ldr x1, [x0, #CONSOLE_T_XXX_BASE] + ldr x1, [x0, #CONSOLE_T_BASE] /* * Flush all remaining output from hardware FIFOs. Do not return until * all data has been flushed or there was an unrecoverable error. */ - mov w0, #0 - ret - - /* Jump here if an unrecoverable error has been encountered. */ -flush_error: - mov w0, #-1 ret endfunc console_xxx_flush diff --git a/drivers/console/multi_console.c b/drivers/console/multi_console.c index 215f49517..08b8e9fb1 100644 --- a/drivers/console/multi_console.c +++ b/drivers/console/multi_console.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -90,7 +90,7 @@ int console_putc(int c) console_t *console; for (console = console_list; console != NULL; console = console->next) - if ((console->flags & console_state) && console->putc) { + if ((console->flags & console_state) && (console->putc != NULL)) { int ret = do_putc(c, console); if ((err == ERROR_NO_VALID_CONSOLE) || (ret < err)) err = ret; @@ -107,7 +107,7 @@ int console_getc(void) do { /* Keep polling while at least one console works correctly. */ for (console = console_list; console != NULL; console = console->next) - if ((console->flags & console_state) && console->getc) { + if ((console->flags & console_state) && (console->getc != NULL)) { int ret = console->getc(console); if (ret >= 0) return ret; @@ -119,17 +119,12 @@ int console_getc(void) return err; } -int console_flush(void) +void console_flush(void) { - int err = ERROR_NO_VALID_CONSOLE; console_t *console; for (console = console_list; console != NULL; console = console->next) - if ((console->flags & console_state) && console->flush) { - int ret = console->flush(console); - if ((err == ERROR_NO_VALID_CONSOLE) || (ret < err)) - err = ret; + if ((console->flags & console_state) && (console->flush != NULL)) { + console->flush(console); } - - return err; } |