diff options
-rw-r--r-- | drivers/console/aarch64/multi_console.S | 6 | ||||
-rw-r--r-- | include/drivers/console.h | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/console/aarch64/multi_console.S b/drivers/console/aarch64/multi_console.S index a85a6a56..0464776b 100644 --- a/drivers/console/aarch64/multi_console.S +++ b/drivers/console/aarch64/multi_console.S @@ -200,7 +200,7 @@ putc_loop: cbz x14, putc_done adrp x1, console_state ldrb w1, [x1, :lo12:console_state] - ldr x2, [x14, #CONSOLE_T_FLAGS] + ldr w2, [x14, #CONSOLE_T_FLAGS] tst w1, w2 b.eq putc_continue ldr x2, [x14, #CONSOLE_T_PUTC] @@ -246,7 +246,7 @@ getc_try_again: getc_loop: adrp x0, console_state ldrb w0, [x0, :lo12:console_state] - ldr x1, [x14, #CONSOLE_T_FLAGS] + ldr w1, [x14, #CONSOLE_T_FLAGS] tst w0, w1 b.eq getc_continue ldr x1, [x14, #CONSOLE_T_GETC] @@ -287,7 +287,7 @@ flush_loop: cbz x14, flush_done adrp x1, console_state ldrb w1, [x1, :lo12:console_state] - ldr x2, [x14, #CONSOLE_T_FLAGS] + ldr w2, [x14, #CONSOLE_T_FLAGS] tst w1, w2 b.eq flush_continue ldr x1, [x14, #CONSOLE_T_FLUSH] diff --git a/include/drivers/console.h b/include/drivers/console.h index 0855170e..a4d89fe9 100644 --- a/include/drivers/console.h +++ b/include/drivers/console.h @@ -34,13 +34,17 @@ typedef struct console { struct console *next; + /* + * Only the low 32 bits are used. The type is u_register_t to align the + * fields of the struct to 64 bits in AArch64 and 32 bits in AArch32 + */ u_register_t flags; int (*putc)(int character, struct console *console); int (*getc)(struct console *console); int (*flush)(struct console *console); /* Additional private driver data may follow here. */ } console_t; -#include <console_assertions.h> /* offset macro assertions for console_t */ +#include <console_assertions.h> /* offset macro assertions for console_t */ /* * NOTE: There is no publicly accessible console_register() function. Consoles |