aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpbios
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2009-07-18 11:11:06 -0400
committerIngo Molnar <mingo@elte.hu>2009-07-19 12:27:52 -0400
commit57594742a2b545f8f114cda34f15650be8ae976d (patch)
tree2682b10d68f3fb33aa047fa2a3ff6db2061c0740 /drivers/pnp/pnpbios
parentfde0312d01b60a3fd5dc56e69a9613defbbc7097 (diff)
x86: Introduce set_desc_base() and set_desc_limit()
Rename set_base()/set_limit to set_desc_base()/set_desc_limit() and rewrite them in C. These are naturally introduced by the idea of get_desc_base()/get_desc_limit(). The conversion actually found the bug in apm_32.c: bad_bios_desc is written at run-time, but it is defined const variable. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> LKML-Reference: <20090718151105.GC11294@localhost.localdomain> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/pnp/pnpbios')
-rw-r--r--drivers/pnp/pnpbios/bioscalls.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
index 7e6b5a3b3281..45ad3e9cc362 100644
--- a/drivers/pnp/pnpbios/bioscalls.c
+++ b/drivers/pnp/pnpbios/bioscalls.c
@@ -55,9 +55,9 @@ __asm__(".text \n"
55 55
56#define Q2_SET_SEL(cpu, selname, address, size) \ 56#define Q2_SET_SEL(cpu, selname, address, size) \
57do { \ 57do { \
58struct desc_struct *gdt = get_cpu_gdt_table((cpu)); \ 58 struct desc_struct *gdt = get_cpu_gdt_table((cpu)); \
59set_base(gdt[(selname) >> 3], (u32)(address)); \ 59 set_desc_base(&gdt[(selname) >> 3], (u32)(address)); \
60set_limit(gdt[(selname) >> 3], size); \ 60 set_desc_limit(&gdt[(selname) >> 3], (size) - 1); \
61} while(0) 61} while(0)
62 62
63static struct desc_struct bad_bios_desc; 63static struct desc_struct bad_bios_desc;
@@ -479,16 +479,17 @@ void pnpbios_calls_init(union pnp_bios_install_struct *header)
479 bad_bios_desc.a = 0; 479 bad_bios_desc.a = 0;
480 bad_bios_desc.b = 0x00409200; 480 bad_bios_desc.b = 0x00409200;
481 481
482 set_base(bad_bios_desc, __va((unsigned long)0x40 << 4)); 482 set_desc_base(&bad_bios_desc, (unsigned long)__va(0x40UL << 4));
483 _set_limit((char *)&bad_bios_desc, 4095 - (0x40 << 4)); 483 set_desc_limit(&bad_bios_desc, 4095 - (0x40 << 4));
484 for_each_possible_cpu(i) { 484 for_each_possible_cpu(i) {
485 struct desc_struct *gdt = get_cpu_gdt_table(i); 485 struct desc_struct *gdt = get_cpu_gdt_table(i);
486 if (!gdt) 486 if (!gdt)
487 continue; 487 continue;
488 set_base(gdt[GDT_ENTRY_PNPBIOS_CS32], &pnp_bios_callfunc); 488 set_desc_base(&gdt[GDT_ENTRY_PNPBIOS_CS32],
489 set_base(gdt[GDT_ENTRY_PNPBIOS_CS16], 489 (unsigned long)&pnp_bios_callfunc);
490 __va(header->fields.pm16cseg)); 490 set_desc_base(&gdt[GDT_ENTRY_PNPBIOS_CS16],
491 set_base(gdt[GDT_ENTRY_PNPBIOS_DS], 491 (unsigned long)__va(header->fields.pm16cseg));
492 __va(header->fields.pm16dseg)); 492 set_desc_base(&gdt[GDT_ENTRY_PNPBIOS_DS],
493 (unsigned long)__va(header->fields.pm16dseg));
493 } 494 }
494} 495}