Introduce 'stdout' interface
"plat_console" is a build parameter that specifies the console driver
to be used for the given platform. This parameter has been overridden
for all VM toolchains, passing in a HVC-based driver instead.
To keep "plat_console" tied to the platform, introduce "stdout",
which is a platform-agnostic abstraction of an output stream accepting
chars. The default implementation, used by the hypervisor, forwards the
chars to plat_console_putchar(). The implementation in VM toolchains
passes them to the HVC call.
Change-Id: I2316555d9debdb8ce3de4621f8ddbf4b88164d0f
diff --git a/src/dlog.c b/src/dlog.c
index 1bda568..1a4bf67 100644
--- a/src/dlog.c
+++ b/src/dlog.c
@@ -19,10 +19,10 @@
#include <stdbool.h>
#include <stddef.h>
-#include "hf/plat/console.h"
#include "hf/spci.h"
#include "hf/spinlock.h"
#include "hf/std.h"
+#include "hf/stdout.h"
/* Keep macro alignment */
/* clang-format off */
@@ -81,7 +81,7 @@
{
dlog_buffer[dlog_buffer_offset] = c;
dlog_buffer_offset = (dlog_buffer_offset + 1) % DLOG_BUFFER_SIZE;
- plat_console_putchar(c);
+ stdout_putchar(c);
}
/**