[Skiboot] [PATCH 3/6] mambo: Convert sim exit from asm to C

Michael Neuling mikey at neuling.org
Wed Nov 2 18:07:36 AEDT 2016


Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 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 146b9c398d..6dcbad27af 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 334c0a4eb6..ff75adf001 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 02df88bcb6..76ac0a6744 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
@@ -249,7 +250,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;
 }
@@ -257,7 +258,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 (;;) ;
 }
-- 
2.9.3



More information about the Skiboot mailing list