diff options
Diffstat (limited to 'arch/arm/kernel/suspend.c')
-rw-r--r-- | arch/arm/kernel/suspend.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c index ed4160b64e66..2d60f1903206 100644 --- a/arch/arm/kernel/suspend.c +++ b/arch/arm/kernel/suspend.c | |||
@@ -8,10 +8,29 @@ | |||
8 | 8 | ||
9 | static pgd_t *suspend_pgd; | 9 | static pgd_t *suspend_pgd; |
10 | 10 | ||
11 | extern int __cpu_suspend(int, long, unsigned long, int (*)(unsigned long)); | 11 | extern int __cpu_suspend(unsigned long, int (*)(unsigned long)); |
12 | extern void cpu_resume_mmu(void); | 12 | extern void cpu_resume_mmu(void); |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * This is called by __cpu_suspend() to save the state, and do whatever | ||
16 | * flushing is required to ensure that when the CPU goes to sleep we have | ||
17 | * the necessary data available when the caches are not searched. | ||
18 | */ | ||
19 | void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr) | ||
20 | { | ||
21 | *save_ptr = virt_to_phys(ptr); | ||
22 | |||
23 | /* This must correspond to the LDM in cpu_resume() assembly */ | ||
24 | *ptr++ = virt_to_phys(suspend_pgd); | ||
25 | *ptr++ = sp; | ||
26 | *ptr++ = virt_to_phys(cpu_do_resume); | ||
27 | |||
28 | cpu_do_suspend(ptr); | ||
29 | |||
30 | flush_cache_all(); | ||
31 | } | ||
32 | |||
33 | /* | ||
15 | * Hide the first two arguments to __cpu_suspend - these are an implementation | 34 | * Hide the first two arguments to __cpu_suspend - these are an implementation |
16 | * detail which platform code shouldn't have to know about. | 35 | * detail which platform code shouldn't have to know about. |
17 | */ | 36 | */ |
@@ -29,8 +48,7 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) | |||
29 | * resume (indicated by a zero return code), we need to switch | 48 | * resume (indicated by a zero return code), we need to switch |
30 | * back to the correct page tables. | 49 | * back to the correct page tables. |
31 | */ | 50 | */ |
32 | ret = __cpu_suspend(virt_to_phys(suspend_pgd), | 51 | ret = __cpu_suspend(arg, fn); |
33 | PHYS_OFFSET - PAGE_OFFSET, arg, fn); | ||
34 | if (ret == 0) { | 52 | if (ret == 0) { |
35 | cpu_switch_mm(mm->pgd, mm); | 53 | cpu_switch_mm(mm->pgd, mm); |
36 | local_flush_tlb_all(); | 54 | local_flush_tlb_all(); |