Commit | Line | Data |
---|---|---|
2874c5fd | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
be9c94dd JB |
2 | /* |
3 | * Common powerpc suspend code for 32 and 64 bits | |
4 | * | |
5 | * Copyright 2007 Johannes Berg <johannes@sipsolutions.net> | |
be9c94dd JB |
6 | */ |
7 | ||
8 | #include <linux/sched.h> | |
1fc439c8 | 9 | #include <linux/suspend.h> |
be9c94dd JB |
10 | #include <asm/current.h> |
11 | #include <asm/mmu_context.h> | |
ae3a197e | 12 | #include <asm/switch_to.h> |
be9c94dd JB |
13 | |
14 | void save_processor_state(void) | |
15 | { | |
16 | /* | |
17 | * flush out all the special registers so we don't need | |
18 | * to save them in the snapshot | |
19 | */ | |
579e633e | 20 | flush_all_to_thread(current); |
543b9fd3 JB |
21 | |
22 | #ifdef CONFIG_PPC64 | |
23 | hard_irq_disable(); | |
24 | #endif | |
25 | ||
be9c94dd JB |
26 | } |
27 | ||
28 | void restore_processor_state(void) | |
29 | { | |
30 | #ifdef CONFIG_PPC32 | |
d2adba3f | 31 | switch_mmu_context(current->active_mm, current->active_mm, NULL); |
be9c94dd JB |
32 | #endif |
33 | } |