diff options
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/platforms/iss/include/platform/simcall.h | 5 | ||||
-rw-r--r-- | arch/xtensa/platforms/iss/setup.c | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/arch/xtensa/platforms/iss/include/platform/simcall.h b/arch/xtensa/platforms/iss/include/platform/simcall.h index 12b15ad1e586..27d7a528b41a 100644 --- a/arch/xtensa/platforms/iss/include/platform/simcall.h +++ b/arch/xtensa/platforms/iss/include/platform/simcall.h @@ -76,6 +76,11 @@ static inline int __simc(int a, int b, int c, int d) return ret; } +static inline int simc_exit(int exit_code) +{ + return __simc(SYS_exit, exit_code, 0, 0); +} + static inline int simc_open(const char *file, int flags, int mode) { return __simc(SYS_open, (int) file, flags, mode); diff --git a/arch/xtensa/platforms/iss/setup.c b/arch/xtensa/platforms/iss/setup.c index e29e1b41ef96..379aeddcc638 100644 --- a/arch/xtensa/platforms/iss/setup.c +++ b/arch/xtensa/platforms/iss/setup.c @@ -32,6 +32,8 @@ #include <asm/platform.h> #include <asm/bootparam.h> +#include <platform/simcall.h> + void __init platform_init(bp_tag_t* bootparam) { @@ -41,13 +43,13 @@ void __init platform_init(bp_tag_t* bootparam) void platform_halt(void) { pr_info(" ** Called platform_halt() **\n"); - __asm__ __volatile__("movi a2, 1\nsimcall\n"); + simc_exit(0); } void platform_power_off(void) { pr_info(" ** Called platform_power_off() **\n"); - __asm__ __volatile__("movi a2, 1\nsimcall\n"); + simc_exit(0); } void platform_restart(void) { @@ -80,7 +82,7 @@ void platform_heartbeat(void) static int iss_panic_event(struct notifier_block *this, unsigned long event, void *ptr) { - __asm__ __volatile__("movi a2, -1; simcall\n"); + simc_exit(1); return NOTIFY_DONE; } |