aboutsummaryrefslogtreecommitdiff
path: root/include/asm-x86_64/desc.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-11-16 15:12:58 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-16 15:12:58 -0500
commit3be4bb06b53df2c0a760eeaa5f53448faddedfca (patch)
tree67dc02f39e48a8a37d8f3e4a38422d86f5164820 /include/asm-x86_64/desc.h
parent85d6162d6cea9220e483989817eac0cebc03070e (diff)
parent7bdd720869ff75700b48b132ee71852615b55808 (diff)
Merge branch 'upstream-fixes'
Diffstat (limited to 'include/asm-x86_64/desc.h')
-rw-r--r--include/asm-x86_64/desc.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h
index 68ac3c62fe3..33764869387 100644
--- a/include/asm-x86_64/desc.h
+++ b/include/asm-x86_64/desc.h
@@ -98,16 +98,19 @@ static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsig
static inline void set_intr_gate(int nr, void *func)
{
+ BUG_ON((unsigned)nr > 0xFF);
_set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 0, 0);
}
static inline void set_intr_gate_ist(int nr, void *func, unsigned ist)
{
+ BUG_ON((unsigned)nr > 0xFF);
_set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 0, ist);
}
static inline void set_system_gate(int nr, void *func)
{
+ BUG_ON((unsigned)nr > 0xFF);
_set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, 0);
}
@@ -129,9 +132,16 @@ static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned
static inline void set_tss_desc(unsigned cpu, void *addr)
{
- set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_TSS], (unsigned long)addr,
- DESC_TSS,
- sizeof(struct tss_struct) - 1);
+ /*
+ * sizeof(unsigned long) coming from an extra "long" at the end
+ * of the iobitmap. See tss_struct definition in processor.h
+ *
+ * -1? seg base+limit should be pointing to the address of the
+ * last valid byte
+ */
+ set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_TSS],
+ (unsigned long)addr, DESC_TSS,
+ IO_BITMAP_OFFSET + IO_BITMAP_BYTES + sizeof(unsigned long) - 1);
}
static inline void set_ldt_desc(unsigned cpu, void *addr, int size)