Blame view

arch/powerpc/kernel/swsusp.c 889 Bytes
be9c94dd7   Johannes Berg   [POWERPC] Fix sus...
1
2
3
4
5
6
7
8
9
10
11
12
  /*
   * Common powerpc suspend code for 32 and 64 bits
   *
   * Copyright 2007	Johannes Berg <johannes@sipsolutions.net>
   *
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU General Public License
   * as published by the Free Software Foundation; either version
   * 2 of the License, or (at your option) any later version.
   */
  
  #include <linux/sched.h>
be9c94dd7   Johannes Berg   [POWERPC] Fix sus...
13
14
15
16
17
18
19
20
21
22
23
24
25
  #include <asm/system.h>
  #include <asm/current.h>
  #include <asm/mmu_context.h>
  
  void save_processor_state(void)
  {
  	/*
  	 * flush out all the special registers so we don't need
  	 * to save them in the snapshot
  	 */
  	flush_fp_to_thread(current);
  	flush_altivec_to_thread(current);
  	flush_spe_to_thread(current);
543b9fd35   Johannes Berg   [POWERPC] powerma...
26
27
28
29
  
  #ifdef CONFIG_PPC64
  	hard_irq_disable();
  #endif
be9c94dd7   Johannes Berg   [POWERPC] Fix sus...
30
31
32
33
34
  }
  
  void restore_processor_state(void)
  {
  #ifdef CONFIG_PPC32
0330581ab   Tang Yuantian   powerpc/mm: Fix t...
35
  	switch_mmu_context(current->active_mm, current->active_mm);
be9c94dd7   Johannes Berg   [POWERPC] Fix sus...
36
37
  #endif
  }