Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79968
b: refs/heads/master
c: 010d4f8
h: refs/heads/master
v: v3
  • Loading branch information
Glauber de Oliveira Costa authored and Ingo Molnar committed Jan 30, 2008
1 parent e0ecd66 commit b90d0a3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e6ebe1432b04c2980cd030c9f0d1ed480e1fe4d
refs/heads/master: 010d4f8221cf51a2ab8b037d0149506b397d073f
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ char ignore_fpu_irq = 0;
* F0 0F bug workaround.. We have a special link segment
* for this.
*/
struct desc_struct idt_table[256]
gate_desc idt_table[256]
__attribute__((__section__(".data.idt"))) = { { { { 0, 0 } } }, };

asmlinkage void divide_error(void);
Expand Down
15 changes: 8 additions & 7 deletions trunk/include/asm-x86/desc_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <asm/ldt.h>
#include <asm/segment.h>
#include <asm/desc_defs.h>

#ifndef __ASSEMBLY__

Expand All @@ -24,7 +25,7 @@ static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu)
}

extern struct desc_ptr idt_descr;
extern struct desc_struct idt_table[];
extern gate_desc idt_table[];
extern void set_intr_gate(unsigned int irq, void * addr);

static inline void pack_descriptor(__u32 *a, __u32 *b,
Expand All @@ -35,11 +36,11 @@ static inline void pack_descriptor(__u32 *a, __u32 *b,
(limit & 0x000f0000) | ((type & 0xff) << 8) | ((flags & 0xf) << 20);
}

static inline void pack_gate(__u32 *a, __u32 *b,
static inline void pack_gate(gate_desc *gate,
unsigned long base, unsigned short seg, unsigned char type, unsigned char flags)
{
*a = (seg << 16) | (base & 0xffff);
*b = (base & 0xffff0000) | ((type & 0xff) << 8) | (flags & 0xff);
gate->a = (seg << 16) | (base & 0xffff);
gate->b = (base & 0xffff0000) | ((type & 0xff) << 8) | (flags & 0xff);
}

#define DESCTYPE_LDT 0x82 /* present, system, DPL-0, LDT */
Expand Down Expand Up @@ -139,9 +140,9 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu)

static inline void _set_gate(int gate, unsigned int type, void *addr, unsigned short seg)
{
__u32 a, b;
pack_gate(&a, &b, (unsigned long)addr, seg, type, 0);
write_idt_entry(idt_table, gate, a, b);
gate_desc g;
pack_gate(&g, (unsigned long)addr, seg, type, 0);
write_idt_entry(idt_table, gate, g.a, g.b);
}

static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, const void *addr)
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/asm-x86/desc_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static inline unsigned long __store_tr(void)

#define store_tr(tr) (tr) = __store_tr()

extern struct gate_struct idt_table[];
extern gate_desc idt_table[];
extern struct desc_ptr cpu_gdt_descr[];

static inline void write_ldt_entry(struct desc_struct *ldt,
Expand Down Expand Up @@ -58,7 +58,7 @@ static inline void store_gdt(struct desc_ptr *ptr)
static inline void _set_gate(void *adr, unsigned type, unsigned long func,
unsigned dpl, unsigned ist)
{
struct gate_struct s;
gate_desc s;

s.offset_low = PTR_LOW(func);
s.segment = __KERNEL_CS;
Expand Down
8 changes: 7 additions & 1 deletion trunk/include/asm-x86/desc_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ enum {
};

// 16byte gate
struct gate_struct {
struct gate_struct64 {
u16 offset_low;
u16 segment;
unsigned ist : 3, zero0 : 5, type : 5, dpl : 2, p : 1;
Expand Down Expand Up @@ -67,6 +67,12 @@ struct ldttss_desc {
u32 zero1;
} __attribute__((packed));

#ifdef CONFIG_X86_64
typedef struct gate_struct64 gate_desc;
#else
typedef struct desc_struct gate_desc;
#endif

struct desc_ptr {
unsigned short size;
unsigned long address;
Expand Down

0 comments on commit b90d0a3

Please sign in to comment.