Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Common powerpc suspend code for 32 and 64 bits
0004  *
0005  * Copyright 2007   Johannes Berg <johannes@sipsolutions.net>
0006  */
0007 
0008 #include <linux/sched.h>
0009 #include <linux/suspend.h>
0010 #include <asm/current.h>
0011 #include <asm/mmu_context.h>
0012 #include <asm/switch_to.h>
0013 
0014 void save_processor_state(void)
0015 {
0016     /*
0017      * flush out all the special registers so we don't need
0018      * to save them in the snapshot
0019      */
0020     flush_all_to_thread(current);
0021 
0022 #ifdef CONFIG_PPC64
0023     hard_irq_disable();
0024 #endif
0025 
0026 }
0027 
0028 void restore_processor_state(void)
0029 {
0030 #ifdef CONFIG_PPC32
0031     switch_mmu_context(current->active_mm, current->active_mm, NULL);
0032 #endif
0033 }