diff options
author | Sia Jee Heng <jeeheng.sia@starfivetech.com> | 2022-09-01 10:47:11 +0300 |
---|---|---|
committer | Mason Huo <mason.huo@starfivetech.com> | 2023-06-12 13:36:27 +0300 |
commit | 5119c71803b155a1003b73bd575e50f539733f4e (patch) | |
tree | 1a7135e2f03f83d17b5a734739cf668761c83270 /arch/riscv/include | |
parent | ef821ac07624927481fd8c187728d3a68b220f82 (diff) | |
download | linux-5119c71803b155a1003b73bd575e50f539733f4e.tar.xz |
riscv: kernel: Add support for hibernate/suspend to disk
The implementation assumes that exactly the same kernel is booted on the
same hardware.
We save the build number and date to the swap header so that we guarantee
not to resume with a different kernel upon booted up the hibernated image.
swsusp_arch_resume() and swsusp_arch_suspend() are coded as dummy
functions for now and shall complete in the subsequent patches.
Signed-off-by: Sia Jee Heng <jeeheng.sia@starfivetech.com>
Diffstat (limited to 'arch/riscv/include')
-rw-r--r-- | arch/riscv/include/asm/suspend.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/suspend.h b/arch/riscv/include/asm/suspend.h index 8be391c2aecb..9a5880c452b8 100644 --- a/arch/riscv/include/asm/suspend.h +++ b/arch/riscv/include/asm/suspend.h @@ -33,4 +33,13 @@ int cpu_suspend(unsigned long arg, /* Low-level CPU resume entry function */ int __cpu_resume_enter(unsigned long hartid, unsigned long context); +/* Low-level API to support hibernation */ +int swsusp_arch_suspend(void); +int swsusp_arch_resume(void); +int arch_hibernation_header_save(void *addr, unsigned int max_size); +int arch_hibernation_header_restore(void *addr); + +/* Used to resume on the CPU we hibernated on */ +int hibernate_resume_nonboot_cpu_disable(void); + #endif |