diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2016-09-21 02:26:48 +0200 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2016-09-21 03:53:00 +0200 |
commit | feec273a2b4d98f8aa76c5d83f24053b211c8525 (patch) | |
tree | 59bc19ae3b576e5300fe542690ffe87fce9013cd /arch/xtensa/platforms/iss/setup.c | |
parent | xtensa: xtfpga: group platform_* functions together (diff) | |
download | linux-feec273a2b4d98f8aa76c5d83f24053b211c8525.tar.xz linux-feec273a2b4d98f8aa76c5d83f24053b211c8525.zip |
xtensa: ISS: define simc_exit and use it instead of inline asm
A number of ISS platform functions use inline assembly to invoke
simulator exit, not all correctly. Define simc_exit(exit_code) and use
it instead of inline assembly.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/platforms/iss/setup.c')
-rw-r--r-- | arch/xtensa/platforms/iss/setup.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; } |