aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/pnpbios/bioscalls.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
index 7e6b5a3b3281..fc83783c3a96 100644
--- a/drivers/pnp/pnpbios/bioscalls.c
+++ b/drivers/pnp/pnpbios/bioscalls.c
@@ -55,12 +55,13 @@ __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 = GDT_ENTRY_INIT(0x4092,
64 (unsigned long)__va(0x400UL), PAGE_SIZE - 0x400 - 1);
64 65
65/* 66/*
66 * At some point we want to use this stack frame pointer to unwind 67 * At some point we want to use this stack frame pointer to unwind
@@ -476,19 +477,15 @@ void pnpbios_calls_init(union pnp_bios_install_struct *header)
476 pnp_bios_callpoint.offset = header->fields.pm16offset; 477 pnp_bios_callpoint.offset = header->fields.pm16offset;
477 pnp_bios_callpoint.segment = PNP_CS16; 478 pnp_bios_callpoint.segment = PNP_CS16;
478 479
479 bad_bios_desc.a = 0;
480 bad_bios_desc.b = 0x00409200;
481
482 set_base(bad_bios_desc, __va((unsigned long)0x40 << 4));
483 _set_limit((char *)&bad_bios_desc, 4095 - (0x40 << 4));
484 for_each_possible_cpu(i) { 480 for_each_possible_cpu(i) {
485 struct desc_struct *gdt = get_cpu_gdt_table(i); 481 struct desc_struct *gdt = get_cpu_gdt_table(i);
486 if (!gdt) 482 if (!gdt)
487 continue; 483 continue;
488 set_base(gdt[GDT_ENTRY_PNPBIOS_CS32], &pnp_bios_callfunc); 484 set_desc_base(&gdt[GDT_ENTRY_PNPBIOS_CS32],
489 set_base(gdt[GDT_ENTRY_PNPBIOS_CS16], 485 (unsigned long)&pnp_bios_callfunc);
490 __va(header->fields.pm16cseg)); 486 set_desc_base(&gdt[GDT_ENTRY_PNPBIOS_CS16],
491 set_base(gdt[GDT_ENTRY_PNPBIOS_DS], 487 (unsigned long)__va(header->fields.pm16cseg));
492 __va(header->fields.pm16dseg)); 488 set_desc_base(&gdt[GDT_ENTRY_PNPBIOS_DS],
489 (unsigned long)__va(header->fields.pm16dseg));
493 } 490 }
494} 491}