summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/desc_64.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-x86/desc_64.h b/include/asm-x86/desc_64.h
index bb2009ecbbca..7d48df72aef2 100644
--- a/include/asm-x86/desc_64.h
+++ b/include/asm-x86/desc_64.h
@@ -38,6 +38,15 @@ extern struct desc_struct default_ldt[];
extern struct gate_struct idt_table[];
extern struct desc_ptr cpu_gdt_descr[];
+static inline void write_ldt_entry(struct desc_struct *ldt,
+ int entry, u32 entry_low, u32 entry_high)
+{
+ __u32 *lp = (__u32 *)((entry << 3) + (char *)ldt);
+
+ lp[0] = entry_low;
+ lp[1] = entry_high;
+}
+
/* the cpu gdt accessor */
#define cpu_gdt(_cpu) ((struct desc_struct *)cpu_gdt_descr[_cpu].address)