aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/suspend_64.c
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2007-10-19 14:35:03 -0400
committerThomas Gleixner <tglx@linutronix.de>2007-10-19 14:35:03 -0400
commit9d1c6e7c86ddc366d67f0c5fa77be9b93710037a (patch)
tree2561f09ea7393c04634352808b6cba2195099b73 /arch/x86/kernel/suspend_64.c
parent9d975ebda56699c1b8480e9736caf33a61ccb810 (diff)
x86: use descriptor's functions instead of inline assembly
This patch provides a new set of functions for managing the descriptor tables that can be used instead of putting the raw assembly in .c files. Remodeling of store_tr() suggested by Frederik Deweerdt. [ tglx: arch/x86 adaptation ] Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/suspend_64.c')
-rw-r--r--arch/x86/kernel/suspend_64.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kernel/suspend_64.c b/arch/x86/kernel/suspend_64.c
index f8fafe527ff1..622bb0268284 100644
--- a/arch/x86/kernel/suspend_64.c
+++ b/arch/x86/kernel/suspend_64.c
@@ -32,9 +32,9 @@ void __save_processor_state(struct saved_context *ctxt)
32 /* 32 /*
33 * descriptor tables 33 * descriptor tables
34 */ 34 */
35 asm volatile ("sgdt %0" : "=m" (ctxt->gdt_limit)); 35 store_gdt((struct desc_ptr *)&ctxt->gdt_limit);
36 asm volatile ("sidt %0" : "=m" (ctxt->idt_limit)); 36 store_idt((struct desc_ptr *)&ctxt->idt_limit);
37 asm volatile ("str %0" : "=m" (ctxt->tr)); 37 store_tr(ctxt->tr);
38 38
39 /* XMM0..XMM15 should be handled by kernel_fpu_begin(). */ 39 /* XMM0..XMM15 should be handled by kernel_fpu_begin(). */
40 /* 40 /*
@@ -91,8 +91,9 @@ void __restore_processor_state(struct saved_context *ctxt)
91 * now restore the descriptor tables to their proper values 91 * now restore the descriptor tables to their proper values
92 * ltr is done i fix_processor_context(). 92 * ltr is done i fix_processor_context().
93 */ 93 */
94 asm volatile ("lgdt %0" :: "m" (ctxt->gdt_limit)); 94 load_gdt((const struct desc_ptr *)&ctxt->gdt_limit);
95 asm volatile ("lidt %0" :: "m" (ctxt->idt_limit)); 95 load_idt((const struct desc_ptr *)&ctxt->idt_limit);
96
96 97
97 /* 98 /*
98 * segment registers 99 * segment registers