]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[PATCH] x86: Fixed pnp bios limits
authorZachary Amsden <zach@vmware.com>
Fri, 6 Jan 2006 08:11:56 +0000 (00:11 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 6 Jan 2006 16:33:35 +0000 (08:33 -0800)
PnP BIOS data, code, and 32-bit entry segments all have fixed limits as well;
set them in the GDT rather than adding more code.  It would be nice to add
these fixups to the boot GDT rather than setting the GDT for each CPU; perhaps
I can wiggle this in later, but getting it in before the subsys init looks
tricky.

Also, make some progress on deprecating the ugly Q_SET_SEL macros.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Cc: "Seth, Rohit" <rohit.seth@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/head.S
drivers/pnp/pnpbios/bioscalls.c

index 58d2746670b70e877603dd1dcba33acdeeb5ede0..5884469f6bfee904cd6e33fd444b08a14b2188e5 100644 (file)
@@ -504,10 +504,14 @@ ENTRY(cpu_gdt_table)
        .quad 0x0000000000000000        /* 0x80 TSS descriptor */
        .quad 0x0000000000000000        /* 0x88 LDT descriptor */
 
-       /* Segments used for calling PnP BIOS have byte granularity */
-       .quad 0x00409a0000000000        /* 0x90 32-bit code */
-       .quad 0x00009a0000000000        /* 0x98 16-bit code */
-       .quad 0x0000920000000000        /* 0xa0 16-bit data */
+       /*
+        * Segments used for calling PnP BIOS have byte granularity.
+        * They code segments and data segments have fixed 64k limits,
+        * the transfer segment sizes are set at run time.
+        */
+       .quad 0x00409a000000ffff        /* 0x90 32-bit code */
+       .quad 0x00009a000000ffff        /* 0x98 16-bit code */
+       .quad 0x000092000000ffff        /* 0xa0 16-bit data */
        .quad 0x0000920000000000        /* 0xa8 16-bit data */
        .quad 0x0000920000000000        /* 0xb0 16-bit data */
 
index a72126180e9736080c7f6c8b7cece88ff57f48ca..a1f0b0ba2bfe8600109b0061a93d4ea47b26e6a4 100644 (file)
@@ -58,13 +58,6 @@ __asm__(
        ".previous              \n"
 );
 
-#define Q_SET_SEL(cpu, selname, address, size) \
-do { \
-struct desc_struct *gdt = get_cpu_gdt_table((cpu)); \
-set_base(gdt[(selname) >> 3], __va((u32)(address))); \
-set_limit(gdt[(selname) >> 3], size); \
-} while(0)
-
 #define Q2_SET_SEL(cpu, selname, address, size) \
 do { \
 struct desc_struct *gdt = get_cpu_gdt_table((cpu)); \
@@ -535,8 +528,8 @@ void pnpbios_calls_init(union pnp_bios_install_struct *header)
                struct desc_struct *gdt = get_cpu_gdt_table(i);
                if (!gdt)
                        continue;
-               Q2_SET_SEL(i, PNP_CS32, &pnp_bios_callfunc, 64 * 1024);
-               Q_SET_SEL(i, PNP_CS16, header->fields.pm16cseg, 64 * 1024);
-               Q_SET_SEL(i, PNP_DS, header->fields.pm16dseg, 64 * 1024);
-       }
+               set_base(gdt[GDT_ENTRY_PNPBIOS_CS32], &pnp_bios_callfunc);
+               set_base(gdt[GDT_ENTRY_PNPBIOS_CS16], __va(header->fields.pm16cseg));
+               set_base(gdt[GDT_ENTRY_PNPBIOS_DS], __va(header->fields.pm16dseg));
+       }
 }