From 76c5eb99a6e8356ffd7479ec810d48c466dd6907 Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Wed, 2 Nov 2016 18:07:37 +1100 Subject: 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 Signed-off-by: Stewart Smith --- platforms/mambo/mambo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'platforms/mambo') 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(); -- cgit v1.1