diff options
Diffstat (limited to 'arch/powerpc/kernel/swsusp.c')
-rw-r--r-- | arch/powerpc/kernel/swsusp.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/swsusp.c b/arch/powerpc/kernel/swsusp.c new file mode 100644 index 000000000000..b89e4f5a0b08 --- /dev/null +++ b/arch/powerpc/kernel/swsusp.c | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Common powerpc suspend code for 32 and 64 bits | ||
3 | * | ||
4 | * Copyright 2007 Johannes Berg <johannes@sipsolutions.net> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/sched.h> | ||
13 | #include <asm/suspend.h> | ||
14 | #include <asm/system.h> | ||
15 | #include <asm/current.h> | ||
16 | #include <asm/mmu_context.h> | ||
17 | |||
18 | void save_processor_state(void) | ||
19 | { | ||
20 | /* | ||
21 | * flush out all the special registers so we don't need | ||
22 | * to save them in the snapshot | ||
23 | */ | ||
24 | flush_fp_to_thread(current); | ||
25 | flush_altivec_to_thread(current); | ||
26 | flush_spe_to_thread(current); | ||
27 | } | ||
28 | |||
29 | void restore_processor_state(void) | ||
30 | { | ||
31 | #ifdef CONFIG_PPC32 | ||
32 | set_context(current->active_mm->context.id, current->active_mm->pgd); | ||
33 | #endif | ||
34 | } | ||