]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/powerpc/kernel/swsusp.c
Merge tag 'docs-4.10-2' of git://git.lwn.net/linux
[mirror_ubuntu-bionic-kernel.git] / arch / powerpc / kernel / swsusp.c
CommitLineData
be9c94dd
JB
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>
be9c94dd
JB
13#include <asm/current.h>
14#include <asm/mmu_context.h>
ae3a197e 15#include <asm/switch_to.h>
be9c94dd
JB
16
17void save_processor_state(void)
18{
19 /*
20 * flush out all the special registers so we don't need
21 * to save them in the snapshot
22 */
579e633e 23 flush_all_to_thread(current);
543b9fd3
JB
24
25#ifdef CONFIG_PPC64
26 hard_irq_disable();
27#endif
28
be9c94dd
JB
29}
30
31void restore_processor_state(void)
32{
33#ifdef CONFIG_PPC32
d2adba3f 34 switch_mmu_context(current->active_mm, current->active_mm, NULL);
be9c94dd
JB
35#endif
36}