Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333725
b: refs/heads/master
c: dbee0c6
h: refs/heads/master
i:
  333723: ede7f12
v: v3
  • Loading branch information
Lorenzo Pieralisi committed Sep 25, 2012
1 parent 7b3a56a commit 80f632b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3287be8c4e2bd91211b3947ba726d95e8a1092b5
refs/heads/master: dbee0c6fb4c1269b2dfc8b0b7a29907ea7fed560
17 changes: 16 additions & 1 deletion trunk/arch/arm/kernel/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ extern void cpu_resume_mmu(void);
*/
void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
{
u32 *ctx = ptr;

*save_ptr = virt_to_phys(ptr);

/* This must correspond to the LDM in cpu_resume() assembly */
Expand All @@ -26,7 +28,20 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)

cpu_do_suspend(ptr);

flush_cache_all();
flush_cache_louis();

/*
* flush_cache_louis does not guarantee that
* save_ptr and ptr are cleaned to main memory,
* just up to the Level of Unification Inner Shareable.
* Since the context pointer and context itself
* are to be retrieved with the MMU off that
* data must be cleaned from all cache levels
* to main memory using "area" cache primitives.
*/
__cpuc_flush_dcache_area(ctx, ptrsz);
__cpuc_flush_dcache_area(save_ptr, sizeof(*save_ptr));

outer_clean_range(*save_ptr, *save_ptr + ptrsz);
outer_clean_range(virt_to_phys(save_ptr),
virt_to_phys(save_ptr) + sizeof(*save_ptr));
Expand Down

0 comments on commit 80f632b

Please sign in to comment.