From e6f180d10a6f09f9dcde28629a691debf2284169 Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Wed, 2 Nov 2016 18:07:36 +1100 Subject: mambo: Convert sim exit from asm to C Signed-off-by: Michael Neuling Signed-off-by: Stewart Smith --- asm/misc.S | 6 ------ include/platform.h | 2 -- platforms/mambo/mambo.c | 5 +++-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/asm/misc.S b/asm/misc.S index 146b9c3..6dcbad2 100644 --- a/asm/misc.S +++ b/asm/misc.S @@ -69,12 +69,6 @@ mambo_write: .long 0x000eaeb0 blr -.global mambo_sim_exit -mambo_sim_exit: - li %r3, 31 /* aka. SimExitCode */ - .long 0x000eaeb0 - b . - .global mambo_get_time mambo_get_time: #define SIM_GET_TIME_CODE 70 diff --git a/include/platform.h b/include/platform.h index 334c0a4..ff75adf 100644 --- a/include/platform.h +++ b/include/platform.h @@ -189,6 +189,4 @@ extern int resource_loaded(enum resource_id id, uint32_t idx); extern int wait_for_resource_loaded(enum resource_id id, uint32_t idx); -extern void mambo_sim_exit(void); - #endif /* __PLATFORM_H */ diff --git a/platforms/mambo/mambo.c b/platforms/mambo/mambo.c index 21578c8..5207ecb 100644 --- a/platforms/mambo/mambo.c +++ b/platforms/mambo/mambo.c @@ -96,6 +96,7 @@ static inline unsigned long callthru3(int command, unsigned long arg1, #define BD_SECT_SZ 512 +#define SIM_EXIT_CODE 31 #define BOGUS_DISK_READ 116 #define BOGUS_DISK_WRITE 117 #define BOGUS_DISK_INFO 118 @@ -256,7 +257,7 @@ static void mambo_platform_init(void) static int64_t mambo_cec_power_down(uint64_t request __unused) { if (chip_quirk(QUIRK_MAMBO_CALLOUTS)) - mambo_sim_exit(); + callthru0(SIM_EXIT_CODE); return OPAL_UNSUPPORTED; } @@ -264,7 +265,7 @@ static int64_t mambo_cec_power_down(uint64_t request __unused) static void __attribute__((noreturn)) mambo_terminate(const char *msg __unused) { if (chip_quirk(QUIRK_MAMBO_CALLOUTS)) - mambo_sim_exit(); + callthru0(SIM_EXIT_CODE); for (;;) ; } -- cgit v1.1