Magellan Linux

Annotation of /trunk/kernel26-xen/patches-2.6.25-r1/1037-2.6.25-xen_write_idt_entry-and-cvt_gate_to_trap.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 606 - (hide annotations) (download)
Thu May 22 23:13:13 2008 UTC (16 years ago) by niro
File size: 2220 byte(s)
-ver bump to 2.6.25-magellan-r1:
- linux-2.6.25.4
- fbcondecor-0.9.4
- squashfs-3.3
- unionfs-2.3.3
- tuxonice-3.0-rc7
- linux-phc-0.3.0
- acpi-dstd-0.9a
- reiser4
- xen-3.2.0
. ipw3945-1.2.2

1 niro 606 From 7353f8ca123b8099bb4cff0753a94e23cd1dae39 Mon Sep 17 00:00:00 2001
2     From: Eduardo Habkost <ehabkost@Rawhide-64.localdomain>
3     Date: Tue, 27 Nov 2007 19:43:41 -0200
4     Subject: [PATCH] xen_write_idt_entry() and cvt_gate_to_trap()
5    
6     Changed to use the (to-be-)unified descriptor structs.
7    
8     Signed-off-by: Eduardo Habkost <ehabkost@Rawhide-64.localdomain>
9     ---
10     arch/x86/xen/enlighten.c | 24 +++++++++---------------
11     1 files changed, 9 insertions(+), 15 deletions(-)
12    
13     diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
14     index c1debed..8f51827 100644
15     --- a/arch/x86/xen/enlighten.c
16     +++ b/arch/x86/xen/enlighten.c
17     @@ -386,23 +386,18 @@ static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum,
18     preempt_enable();
19     }
20    
21     -static int cvt_gate_to_trap(int vector, u32 low, u32 high,
22     +static int cvt_gate_to_trap(int vector, const gate_desc *val,
23     struct trap_info *info)
24     {
25     - u8 type, dpl;
26     -
27     - type = (high >> 8) & 0x1f;
28     - dpl = (high >> 13) & 3;
29     -
30     - if (type != 0xf && type != 0xe)
31     + if (val->type != 0xf && val->type != 0xe)
32     return 0;
33    
34     info->vector = vector;
35     - info->address = (high & 0xffff0000) | (low & 0x0000ffff);
36     - info->cs = low >> 16;
37     - info->flags = dpl;
38     + info->address = gate_offset(*val);
39     + info->cs = gate_segment(*val);
40     + info->flags = val->dpl;
41     /* interrupt gates clear IF */
42     - if (type == 0xe)
43     + if (val->type == 0xe)
44     info->flags |= 4;
45    
46     return 1;
47     @@ -429,11 +424,10 @@ static void xen_write_idt_entry(gate_desc *dt, int entrynum, const gate_desc *g)
48    
49     if (p >= start && (p + 8) <= end) {
50     struct trap_info info[2];
51     - u32 *desc = (u32 *)g;
52    
53     info[1].address = 0;
54    
55     - if (cvt_gate_to_trap(entrynum, desc[0], desc[1], &info[0]))
56     + if (cvt_gate_to_trap(entrynum, g, &info[0]))
57     if (HYPERVISOR_set_trap_table(info))
58     BUG();
59     }
60     @@ -450,9 +444,9 @@ static void xen_convert_trap_info(const struct desc_ptr *desc,
61     BUG_ON(count > 256);
62    
63     for (in = out = 0; in < count; in++) {
64     - const u32 *entry = (u32 *)(desc->address + in * 8);
65     + gate_desc *entry = (gate_desc*)(desc->address) + in;
66    
67     - if (cvt_gate_to_trap(in, entry[0], entry[1], &traps[out]))
68     + if (cvt_gate_to_trap(in, entry, &traps[out]))
69     out++;
70     }
71     traps[out].address = 0;
72     --
73     1.5.4.1
74