diff options
Diffstat (limited to 'arch/x86/power')
-rw-r--r-- | arch/x86/power/cpu_32.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/arch/x86/power/cpu_32.c b/arch/x86/power/cpu_32.c index 7f9c6da04a4c..7dc5d5cf50a2 100644 --- a/arch/x86/power/cpu_32.c +++ b/arch/x86/power/cpu_32.c | |||
@@ -27,17 +27,17 @@ static void __save_processor_state(struct saved_context *ctxt) | |||
27 | /* | 27 | /* |
28 | * descriptor tables | 28 | * descriptor tables |
29 | */ | 29 | */ |
30 | store_gdt(&ctxt->gdt); | 30 | store_gdt(&ctxt->gdt); |
31 | store_idt(&ctxt->idt); | 31 | store_idt(&ctxt->idt); |
32 | store_tr(ctxt->tr); | 32 | store_tr(ctxt->tr); |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * segment registers | 35 | * segment registers |
36 | */ | 36 | */ |
37 | savesegment(es, ctxt->es); | 37 | savesegment(es, ctxt->es); |
38 | savesegment(fs, ctxt->fs); | 38 | savesegment(fs, ctxt->fs); |
39 | savesegment(gs, ctxt->gs); | 39 | savesegment(gs, ctxt->gs); |
40 | savesegment(ss, ctxt->ss); | 40 | savesegment(ss, ctxt->ss); |
41 | 41 | ||
42 | /* | 42 | /* |
43 | * control registers | 43 | * control registers |
@@ -48,10 +48,12 @@ static void __save_processor_state(struct saved_context *ctxt) | |||
48 | ctxt->cr4 = read_cr4(); | 48 | ctxt->cr4 = read_cr4(); |
49 | } | 49 | } |
50 | 50 | ||
51 | /* Needed by apm.c */ | ||
51 | void save_processor_state(void) | 52 | void save_processor_state(void) |
52 | { | 53 | { |
53 | __save_processor_state(&saved_context); | 54 | __save_processor_state(&saved_context); |
54 | } | 55 | } |
56 | EXPORT_SYMBOL(save_processor_state); | ||
55 | 57 | ||
56 | static void do_fpu_end(void) | 58 | static void do_fpu_end(void) |
57 | { | 59 | { |
@@ -64,9 +66,14 @@ static void do_fpu_end(void) | |||
64 | static void fix_processor_context(void) | 66 | static void fix_processor_context(void) |
65 | { | 67 | { |
66 | int cpu = smp_processor_id(); | 68 | int cpu = smp_processor_id(); |
67 | struct tss_struct * t = &per_cpu(init_tss, cpu); | 69 | struct tss_struct *t = &per_cpu(init_tss, cpu); |
68 | 70 | ||
69 | set_tss_desc(cpu,t); /* This just modifies memory; should not be necessary. But... This is necessary, because 386 hardware has concept of busy TSS or some similar stupidity. */ | 71 | set_tss_desc(cpu, t); /* |
72 | * This just modifies memory; should not be | ||
73 | * necessary. But... This is necessary, because | ||
74 | * 386 hardware has concept of busy TSS or some | ||
75 | * similar stupidity. | ||
76 | */ | ||
70 | 77 | ||
71 | load_TR_desc(); /* This does ltr */ | 78 | load_TR_desc(); /* This does ltr */ |
72 | load_LDT(¤t->active_mm->context); /* This does lldt */ | 79 | load_LDT(¤t->active_mm->context); /* This does lldt */ |
@@ -100,16 +107,16 @@ static void __restore_processor_state(struct saved_context *ctxt) | |||
100 | * now restore the descriptor tables to their proper values | 107 | * now restore the descriptor tables to their proper values |
101 | * ltr is done i fix_processor_context(). | 108 | * ltr is done i fix_processor_context(). |
102 | */ | 109 | */ |
103 | load_gdt(&ctxt->gdt); | 110 | load_gdt(&ctxt->gdt); |
104 | load_idt(&ctxt->idt); | 111 | load_idt(&ctxt->idt); |
105 | 112 | ||
106 | /* | 113 | /* |
107 | * segment registers | 114 | * segment registers |
108 | */ | 115 | */ |
109 | loadsegment(es, ctxt->es); | 116 | loadsegment(es, ctxt->es); |
110 | loadsegment(fs, ctxt->fs); | 117 | loadsegment(fs, ctxt->fs); |
111 | loadsegment(gs, ctxt->gs); | 118 | loadsegment(gs, ctxt->gs); |
112 | loadsegment(ss, ctxt->ss); | 119 | loadsegment(ss, ctxt->ss); |
113 | 120 | ||
114 | /* | 121 | /* |
115 | * sysenter MSRs | 122 | * sysenter MSRs |
@@ -123,11 +130,9 @@ static void __restore_processor_state(struct saved_context *ctxt) | |||
123 | mcheck_init(&boot_cpu_data); | 130 | mcheck_init(&boot_cpu_data); |
124 | } | 131 | } |
125 | 132 | ||
133 | /* Needed by apm.c */ | ||
126 | void restore_processor_state(void) | 134 | void restore_processor_state(void) |
127 | { | 135 | { |
128 | __restore_processor_state(&saved_context); | 136 | __restore_processor_state(&saved_context); |
129 | } | 137 | } |
130 | |||
131 | /* Needed by apm.c */ | ||
132 | EXPORT_SYMBOL(save_processor_state); | ||
133 | EXPORT_SYMBOL(restore_processor_state); | 138 | EXPORT_SYMBOL(restore_processor_state); |