diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:14 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:14 -0500 |
commit | 507f90c9f92592e7630b1c1e87bf92d2c9858cc6 (patch) | |
tree | 23e011c11bc221e1c51702ca7dc748d2b241005d /arch/x86/kernel/traps_32.c | |
parent | 54cd0eac7286b83ef1a657d2dddd74e0556209e7 (diff) |
x86: move _set_gate and its users to a common location
This patch moves _set_gate and its users to desc.h. We can now
use common code for x86_64 and i386.
[ mingo@elte.hu: set_system_gate() fixes for nasty crashes. ]
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/traps_32.c')
-rw-r--r-- | arch/x86/kernel/traps_32.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index c70c41fd710b..3065b3f41928 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c | |||
@@ -1102,40 +1102,6 @@ asmlinkage void math_emulate(long arg) | |||
1102 | 1102 | ||
1103 | #endif /* CONFIG_MATH_EMULATION */ | 1103 | #endif /* CONFIG_MATH_EMULATION */ |
1104 | 1104 | ||
1105 | /* | ||
1106 | * This needs to use 'idt_table' rather than 'idt', and | ||
1107 | * thus use the _nonmapped_ version of the IDT, as the | ||
1108 | * Pentium F0 0F bugfix can have resulted in the mapped | ||
1109 | * IDT being write-protected. | ||
1110 | */ | ||
1111 | void set_intr_gate(unsigned int n, void *addr) | ||
1112 | { | ||
1113 | _set_gate(n, DESCTYPE_INT, addr, __KERNEL_CS); | ||
1114 | } | ||
1115 | |||
1116 | /* | ||
1117 | * This routine sets up an interrupt gate at directory privilege level 3. | ||
1118 | */ | ||
1119 | static inline void set_system_intr_gate(unsigned int n, void *addr) | ||
1120 | { | ||
1121 | _set_gate(n, DESCTYPE_INT | DESCTYPE_DPL3, addr, __KERNEL_CS); | ||
1122 | } | ||
1123 | |||
1124 | static void __init set_trap_gate(unsigned int n, void *addr) | ||
1125 | { | ||
1126 | _set_gate(n, DESCTYPE_TRAP, addr, __KERNEL_CS); | ||
1127 | } | ||
1128 | |||
1129 | static void __init set_system_gate(unsigned int n, void *addr) | ||
1130 | { | ||
1131 | _set_gate(n, DESCTYPE_TRAP | DESCTYPE_DPL3, addr, __KERNEL_CS); | ||
1132 | } | ||
1133 | |||
1134 | static void __init set_task_gate(unsigned int n, unsigned int gdt_entry) | ||
1135 | { | ||
1136 | _set_gate(n, DESCTYPE_TASK, (void *)0, (gdt_entry<<3)); | ||
1137 | } | ||
1138 | |||
1139 | 1105 | ||
1140 | void __init trap_init(void) | 1106 | void __init trap_init(void) |
1141 | { | 1107 | { |