-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 270154 b: refs/heads/master c: e8ce0eb h: refs/heads/master v: v3
- Loading branch information
Russell King
committed
Sep 20, 2011
1 parent
6fcf400
commit d0c460a
Showing
12 changed files
with
63 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: f5fa68d9674156ddaafa12a058ccc93c8866d5f9 | ||
refs/heads/master: e8ce0eb5e2254b85415e4b58e73f24a5d13846a1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,7 @@ | ||
#ifndef __ASM_ARM_SUSPEND_H | ||
#define __ASM_ARM_SUSPEND_H | ||
|
||
#include <asm/memory.h> | ||
#include <asm/tlbflush.h> | ||
|
||
extern void cpu_resume(void); | ||
|
||
/* | ||
* Hide the first two arguments to __cpu_suspend - these are an implementation | ||
* detail which platform code shouldn't have to know about. | ||
*/ | ||
static inline int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) | ||
{ | ||
extern int __cpu_suspend(int, long, unsigned long, | ||
int (*)(unsigned long)); | ||
int ret = __cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, arg, fn); | ||
flush_tlb_all(); | ||
return ret; | ||
} | ||
extern int cpu_suspend(unsigned long, int (*)(unsigned long)); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include <linux/init.h> | ||
|
||
#include <asm/pgalloc.h> | ||
#include <asm/pgtable.h> | ||
#include <asm/memory.h> | ||
#include <asm/suspend.h> | ||
#include <asm/tlbflush.h> | ||
|
||
static pgd_t *suspend_pgd; | ||
|
||
extern int __cpu_suspend(int, long, unsigned long, int (*)(unsigned long)); | ||
extern void cpu_resume_turn_mmu_on(void); | ||
|
||
/* | ||
* Hide the first two arguments to __cpu_suspend - these are an implementation | ||
* detail which platform code shouldn't have to know about. | ||
*/ | ||
int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) | ||
{ | ||
struct mm_struct *mm = current->active_mm; | ||
int ret; | ||
|
||
if (!suspend_pgd) | ||
return -EINVAL; | ||
|
||
/* | ||
* Temporarily switch the page tables to our suspend page | ||
* tables, which contain the temporary identity mapping | ||
* required for resuming. | ||
*/ | ||
cpu_switch_mm(suspend_pgd, mm); | ||
ret = __cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, arg, fn); | ||
cpu_switch_mm(mm->pgd, mm); | ||
local_flush_tlb_all(); | ||
|
||
return ret; | ||
} | ||
|
||
static int __init cpu_suspend_init(void) | ||
{ | ||
suspend_pgd = pgd_alloc(&init_mm); | ||
if (suspend_pgd) { | ||
unsigned long addr = virt_to_phys(cpu_resume_turn_mmu_on); | ||
identity_mapping_add(suspend_pgd, addr, addr + SECTION_SIZE); | ||
} | ||
return suspend_pgd ? 0 : -ENOMEM; | ||
} | ||
core_initcall(cpu_suspend_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters