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/inc/hf/stdout.h b/inc/hf/stdout.h
new file mode 100644
index 0000000..72a67fa
--- /dev/null
+++ b/inc/hf/stdout.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2020 The Hafnium Authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+/**
+ * Print one character to standard output.
+ * This is intentionally called differently from functions in <stdio.h> so as to
+ * avoid clashes when linking against libc.
+ */
+void stdout_putchar(char c);