diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-12-06 23:37:06 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-12-06 23:37:06 +0100 |
commit | d0300e5e8d2fb74852f8116f26546e12cfa66735 (patch) | |
tree | a6580aa74a0ebd7965dbc37767717b4f73dd9d79 /arch/riscv/kernel/reset.c | |
parent | Merge tag 'perf-core-for-mingo-4.16-20171206' of git://git.kernel.org/pub/scm... (diff) | |
parent | tooling/headers: Synchronize updated s390 and x86 UAPI headers (diff) | |
download | linux-d0300e5e8d2fb74852f8116f26546e12cfa66735.tar.xz linux-d0300e5e8d2fb74852f8116f26546e12cfa66735.zip |
Merge branch 'perf/urgent' into perf/core, to pick up fixes and to refresh to v4.15
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/riscv/kernel/reset.c')
-rw-r--r-- | arch/riscv/kernel/reset.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/riscv/kernel/reset.c b/arch/riscv/kernel/reset.c new file mode 100644 index 000000000000..2a53d26ffdd6 --- /dev/null +++ b/arch/riscv/kernel/reset.c @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 Regents of the University of California + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <linux/reboot.h> +#include <linux/export.h> +#include <asm/sbi.h> + +void (*pm_power_off)(void) = machine_power_off; +EXPORT_SYMBOL(pm_power_off); + +void machine_restart(char *cmd) +{ + do_kernel_restart(cmd); + while (1); +} + +void machine_halt(void) +{ + machine_power_off(); +} + +void machine_power_off(void) +{ + sbi_shutdown(); + while (1); +} |