aboutsummaryrefslogtreecommitdiffstats
path: root/roms/opensbi/include/sbi/sbi_console.h
diff options
context:
space:
mode:
Diffstat (limited to 'roms/opensbi/include/sbi/sbi_console.h')
-rw-r--r--roms/opensbi/include/sbi/sbi_console.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/roms/opensbi/include/sbi/sbi_console.h b/roms/opensbi/include/sbi/sbi_console.h
new file mode 100644
index 000000000..7d648f0b5
--- /dev/null
+++ b/roms/opensbi/include/sbi/sbi_console.h
@@ -0,0 +1,39 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2019 Western Digital Corporation or its affiliates.
+ *
+ * Authors:
+ * Anup Patel <anup.patel@wdc.com>
+ */
+
+#ifndef __SBI_CONSOLE_H__
+#define __SBI_CONSOLE_H__
+
+#include <sbi/sbi_types.h>
+
+#define __printf(a, b) __attribute__((format(printf, a, b)))
+
+bool sbi_isprintable(char ch);
+
+int sbi_getc(void);
+
+void sbi_putc(char ch);
+
+void sbi_puts(const char *str);
+
+void sbi_gets(char *s, int maxwidth, char endchar);
+
+int __printf(2, 3) sbi_sprintf(char *out, const char *format, ...);
+
+int __printf(3, 4) sbi_snprintf(char *out, u32 out_sz, const char *format, ...);
+
+int __printf(1, 2) sbi_printf(const char *format, ...);
+
+int __printf(1, 2) sbi_dprintf(const char *format, ...);
+
+struct sbi_scratch;
+
+int sbi_console_init(struct sbi_scratch *scratch);
+
+#endif