0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <asm/sections.h>
0010 #include <asm/fpu.h>
0011 #include <asm/dsp.h>
0012
0013 static u32 saved_status;
0014 struct pt_regs saved_regs;
0015
0016 void save_processor_state(void)
0017 {
0018 saved_status = read_c0_status();
0019
0020 if (is_fpu_owner())
0021 save_fp(current);
0022
0023 save_dsp(current);
0024 }
0025
0026 void restore_processor_state(void)
0027 {
0028 write_c0_status(saved_status);
0029
0030 if (is_fpu_owner())
0031 restore_fp(current);
0032
0033 restore_dsp(current);
0034 }
0035
0036 int pfn_is_nosave(unsigned long pfn)
0037 {
0038 unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin));
0039 unsigned long nosave_end_pfn = PFN_UP(__pa(&__nosave_end));
0040
0041 return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
0042 }