Ensure read and write of flags are 32 bit
In 'console_set_scope' and when registering a console, field 'flags' of
'console_t' is assigned a 32-bit value. However, when it is actually
used, the functions perform 64-bit reads to access its value. This patch
changes all 64-bit reads to 32-bit reads.
Change-Id: I181349371409e60065335f078857946fa3c32dc1
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
diff --git a/include/drivers/console.h b/include/drivers/console.h
index 0855170..a4d89fe 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