0001
0002 #ifndef __ASM_SUSPEND_H
0003 #define __ASM_SUSPEND_H
0004
0005 #define NR_CTX_REGS 13
0006 #define NR_CALLEE_SAVED_REGS 12
0007
0008
0009
0010
0011
0012 struct cpu_suspend_ctx {
0013
0014
0015
0016
0017 u64 ctx_regs[NR_CTX_REGS];
0018 u64 sp;
0019 } __aligned(16);
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 struct sleep_stack_data {
0034 struct cpu_suspend_ctx system_regs;
0035 unsigned long callee_saved_regs[NR_CALLEE_SAVED_REGS];
0036 };
0037
0038 extern unsigned long *sleep_save_stash;
0039
0040 extern int cpu_suspend(unsigned long arg, int (*fn)(unsigned long));
0041 extern void cpu_resume(void);
0042 int __cpu_suspend_enter(struct sleep_stack_data *state);
0043 void __cpu_suspend_exit(void);
0044 void _cpu_resume(void);
0045
0046 int swsusp_arch_suspend(void);
0047 int swsusp_arch_resume(void);
0048 int arch_hibernation_header_save(void *addr, unsigned int max_size);
0049 int arch_hibernation_header_restore(void *addr);
0050
0051
0052 int hibernate_resume_nonboot_cpu_disable(void);
0053
0054 #endif