aboutsummaryrefslogtreecommitdiff
path: root/platforms/mambo
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2016-11-02 18:07:37 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-11-02 18:24:09 +1100
commit76c5eb99a6e8356ffd7479ec810d48c466dd6907 (patch)
tree9a6a7f41b88928f344b6f1c0cbdc5b789526e016 /platforms/mambo
parente6f180d10a6f09f9dcde28629a691debf2284169 (diff)
downloadskiboot-76c5eb99a6e8356ffd7479ec810d48c466dd6907.zip
skiboot-76c5eb99a6e8356ffd7479ec810d48c466dd6907.tar.gz
skiboot-76c5eb99a6e8356ffd7479ec810d48c466dd6907.tar.bz2
mambo: Convert console read/write from asm to C
Also changes the function name: mambo_read/write() -> mambo_console_read/write() Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'platforms/mambo')
-rw-r--r--platforms/mambo/mambo.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/platforms/mambo/mambo.c b/platforms/mambo/mambo.c
index 5207ecb..5eaa52f 100644
--- a/platforms/mambo/mambo.c
+++ b/platforms/mambo/mambo.c
@@ -96,7 +96,9 @@ static inline unsigned long callthru3(int command, unsigned long arg1,
#define BD_SECT_SZ 512
+#define SIM_WRITE_CONSOLE_CODE 0
#define SIM_EXIT_CODE 31
+#define SIM_READ_CONSOLE_CODE 60
#define BOGUS_DISK_READ 116
#define BOGUS_DISK_WRITE 117
#define BOGUS_DISK_INFO 118
@@ -247,6 +249,16 @@ static void bogus_disk_flash_init(void)
}
}
+int mambo_console_read(void)
+{
+ return callthru0(SIM_READ_CONSOLE_CODE);
+}
+
+void mambo_console_write(const char *buf, size_t count)
+{
+ callthru2(SIM_WRITE_CONSOLE_CODE, (unsigned long)buf, count);
+}
+
static void mambo_platform_init(void)
{
force_dummy_console();