2007-04-30 11:37:15 +00:00
|
|
|
/*
|
|
|
|
* 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>
|
|
|
|
#include <asm/current.h>
|
|
|
|
#include <asm/mmu_context.h>
|
2012-03-28 17:30:02 +00:00
|
|
|
#include <asm/switch_to.h>
|
2007-04-30 11:37:15 +00:00
|
|
|
|
|
|
|
void save_processor_state(void)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* flush out all the special registers so we don't need
|
|
|
|
* to save them in the snapshot
|
|
|
|
*/
|
2015-10-29 00:44:09 +00:00
|
|
|
flush_all_to_thread(current);
|
2007-05-03 12:31:38 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_PPC64
|
|
|
|
hard_irq_disable();
|
|
|
|
#endif
|
|
|
|
|
2007-04-30 11:37:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void restore_processor_state(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_PPC32
|
2011-08-16 19:51:33 +00:00
|
|
|
switch_mmu_context(current->active_mm, current->active_mm);
|
2007-04-30 11:37:15 +00:00
|
|
|
#endif
|
|
|
|
}
|