1 #ifndef _ASM_SH_SUSPEND_H
2 #define _ASM_SH_SUSPEND_H
5 #include <linux/notifier.h>
7 #include <asm/ptrace.h>
9 struct swsusp_arch_regs
{
10 struct pt_regs user_regs
;
11 unsigned long bank1_regs
[8];
14 void sh_mobile_call_standby(unsigned long mode
);
16 #ifdef CONFIG_CPU_IDLE
17 int sh_mobile_setup_cpuidle(void);
19 static inline int sh_mobile_setup_cpuidle(void) { return 0; }
22 /* notifier chains for pre/post sleep hooks */
23 extern struct atomic_notifier_head sh_mobile_pre_sleep_notifier_list
;
24 extern struct atomic_notifier_head sh_mobile_post_sleep_notifier_list
;
26 /* priority levels for notifiers */
27 #define SH_MOBILE_SLEEP_BOARD 0
28 #define SH_MOBILE_SLEEP_CPU 1
29 #define SH_MOBILE_PRE(x) (x)
30 #define SH_MOBILE_POST(x) (-(x))
32 /* board code registration function for self-refresh assembly snippets */
33 void sh_mobile_register_self_refresh(unsigned long flags
,
34 void *pre_start
, void *pre_end
,
35 void *post_start
, void *post_end
);
37 /* register structure for address/data information */
38 struct sh_sleep_regs
{
57 /* data area for low-level sleep code */
58 struct sh_sleep_data
{
59 /* current sleep mode (SUSP_SH_...) */
62 /* addresses of board specific self-refresh snippets */
64 unsigned long sf_post
;
66 /* address of resume code */
69 /* register state saved and restored by the assembly code */
75 /* structure for keeping register addresses */
76 struct sh_sleep_regs addr
;
78 /* structure for saving/restoring register state */
79 struct sh_sleep_regs data
;
82 /* a bitmap of supported sleep modes (SUSP_SH..) */
83 extern unsigned long sh_mobile_sleep_supported
;
87 /* flags passed to assembly suspend code */
88 #define SUSP_SH_SLEEP (1 << 0) /* Regular sleep mode */
89 #define SUSP_SH_STANDBY (1 << 1) /* SH-Mobile Software standby mode */
90 #define SUSP_SH_RSTANDBY (1 << 2) /* SH-Mobile R-standby mode */
91 #define SUSP_SH_USTANDBY (1 << 3) /* SH-Mobile U-standby mode */
92 #define SUSP_SH_SF (1 << 4) /* Enable self-refresh */
93 #define SUSP_SH_MMU (1 << 5) /* Save/restore MMU and cache */
94 #define SUSP_SH_REGS (1 << 6) /* Save/restore registers */
96 #endif /* _ASM_SH_SUSPEND_H */