Files
linux-apfs/include/asm-x86/desc_32.h
T
Glauber de Oliveira Costa 507f90c9f9 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>
2008-01-30 13:31:14 +01:00

28 lines
596 B
C

#ifndef __ARCH_DESC_H
#define __ARCH_DESC_H
#include <asm/ldt.h>
#include <asm/segment.h>
#include <asm/desc_defs.h>
#ifndef __ASSEMBLY__
#include <linux/preempt.h>
#include <linux/percpu.h>
static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, const void *addr)
{
tss_desc tss;
pack_descriptor(&tss, (unsigned long)addr,
offsetof(struct tss_struct, __cacheline_filler) - 1,
DESC_TSS, 0);
write_gdt_entry(get_cpu_gdt_table(cpu), entry, &tss, DESC_TSS);
}
#define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)
#endif /* !__ASSEMBLY__ */
#endif