From 8d947344c47a40626730bb80d136d8daac9f2060 Mon Sep 17 00:00:00 2001 From: Glauber de Oliveira Costa Date: Wed, 30 Jan 2008 13:31:12 +0100 Subject: x86: change write_idt_entry signature this patch changes write_idt_entry signature. It now takes a gate_desc instead of the a and b parameters. It will allow it to be later unified between i386 and x86_64. Signed-off-by: Glauber de Oliveira Costa CC: Zachary Amsden CC: Jeremy Fitzhardinge Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/desc_32.h | 10 ++++++++-- include/asm-x86/paravirt.h | 9 +++++---- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-x86/desc_32.h b/include/asm-x86/desc_32.h index 77f1e5a4ad7..54b2314f2dd 100644 --- a/include/asm-x86/desc_32.h +++ b/include/asm-x86/desc_32.h @@ -70,9 +70,15 @@ static inline void pack_gate(gate_desc *gate, #define write_ldt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b) #define write_gdt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b) -#define write_idt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b) +#define write_idt_entry(dt, entry, g) native_write_idt_entry(dt, entry, g) #endif +static inline void native_write_idt_entry(gate_desc *idt, int entry, + const gate_desc *gate) +{ + memcpy(&idt[entry], gate, sizeof(*gate)); +} + static inline void write_dt_entry(struct desc_struct *dt, int entry, u32 entry_low, u32 entry_high) { @@ -142,7 +148,7 @@ static inline void _set_gate(int gate, unsigned int type, void *addr, unsigned s { gate_desc g; pack_gate(&g, (unsigned long)addr, seg, type, 0); - write_idt_entry(idt_table, gate, g.a, g.b); + write_idt_entry(idt_table, gate, &g); } static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, const void *addr) diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index 0333fb6988b..86a9d7b0920 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h @@ -17,6 +17,7 @@ #include #include #include +#include struct page; struct thread_struct; @@ -99,8 +100,8 @@ struct pv_cpu_ops { int entrynum, u32 low, u32 high); void (*write_gdt_entry)(struct desc_struct *, int entrynum, u32 low, u32 high); - void (*write_idt_entry)(struct desc_struct *, - int entrynum, u32 low, u32 high); + void (*write_idt_entry)(gate_desc *, + int entrynum, const gate_desc *gate); void (*load_sp0)(struct tss_struct *tss, struct thread_struct *t); void (*set_iopl_mask)(unsigned mask); @@ -667,9 +668,9 @@ static inline void write_gdt_entry(void *dt, int entry, u32 low, u32 high) { PVOP_VCALL4(pv_cpu_ops.write_gdt_entry, dt, entry, low, high); } -static inline void write_idt_entry(void *dt, int entry, u32 low, u32 high) +static inline void write_idt_entry(gate_desc *dt, int entry, const gate_desc *g) { - PVOP_VCALL4(pv_cpu_ops.write_idt_entry, dt, entry, low, high); + PVOP_VCALL3(pv_cpu_ops.write_idt_entry, dt, entry, g); } static inline void set_iopl_mask(unsigned mask) { -- cgit v1.2.3