diff options
Diffstat (limited to 'drivers/pnp/pnpbios/bioscalls.c')
-rw-r--r-- | drivers/pnp/pnpbios/bioscalls.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c index 6b7583f497d0..7cb476ed7f91 100644 --- a/drivers/pnp/pnpbios/bioscalls.c +++ b/drivers/pnp/pnpbios/bioscalls.c | |||
@@ -69,14 +69,16 @@ __asm__( | |||
69 | 69 | ||
70 | #define Q_SET_SEL(cpu, selname, address, size) \ | 70 | #define Q_SET_SEL(cpu, selname, address, size) \ |
71 | do { \ | 71 | do { \ |
72 | set_base(per_cpu(cpu_gdt_table,cpu)[(selname) >> 3], __va((u32)(address))); \ | 72 | struct desc_struct *gdt = get_cpu_gdt_table((cpu)); \ |
73 | set_limit(per_cpu(cpu_gdt_table,cpu)[(selname) >> 3], size); \ | 73 | set_base(gdt[(selname) >> 3], __va((u32)(address))); \ |
74 | set_limit(gdt[(selname) >> 3], size); \ | ||
74 | } while(0) | 75 | } while(0) |
75 | 76 | ||
76 | #define Q2_SET_SEL(cpu, selname, address, size) \ | 77 | #define Q2_SET_SEL(cpu, selname, address, size) \ |
77 | do { \ | 78 | do { \ |
78 | set_base(per_cpu(cpu_gdt_table,cpu)[(selname) >> 3], (u32)(address)); \ | 79 | struct desc_struct *gdt = get_cpu_gdt_table((cpu)); \ |
79 | set_limit(per_cpu(cpu_gdt_table,cpu)[(selname) >> 3], size); \ | 80 | set_base(gdt[(selname) >> 3], (u32)(address)); \ |
81 | set_limit(gdt[(selname) >> 3], size); \ | ||
80 | } while(0) | 82 | } while(0) |
81 | 83 | ||
82 | static struct desc_struct bad_bios_desc = { 0, 0x00409200 }; | 84 | static struct desc_struct bad_bios_desc = { 0, 0x00409200 }; |
@@ -115,8 +117,8 @@ static inline u16 call_pnp_bios(u16 func, u16 arg1, u16 arg2, u16 arg3, | |||
115 | return PNP_FUNCTION_NOT_SUPPORTED; | 117 | return PNP_FUNCTION_NOT_SUPPORTED; |
116 | 118 | ||
117 | cpu = get_cpu(); | 119 | cpu = get_cpu(); |
118 | save_desc_40 = per_cpu(cpu_gdt_table,cpu)[0x40 / 8]; | 120 | save_desc_40 = get_cpu_gdt_table(cpu)[0x40 / 8]; |
119 | per_cpu(cpu_gdt_table,cpu)[0x40 / 8] = bad_bios_desc; | 121 | get_cpu_gdt_table(cpu)[0x40 / 8] = bad_bios_desc; |
120 | 122 | ||
121 | /* On some boxes IRQ's during PnP BIOS calls are deadly. */ | 123 | /* On some boxes IRQ's during PnP BIOS calls are deadly. */ |
122 | spin_lock_irqsave(&pnp_bios_lock, flags); | 124 | spin_lock_irqsave(&pnp_bios_lock, flags); |
@@ -158,7 +160,7 @@ static inline u16 call_pnp_bios(u16 func, u16 arg1, u16 arg2, u16 arg3, | |||
158 | ); | 160 | ); |
159 | spin_unlock_irqrestore(&pnp_bios_lock, flags); | 161 | spin_unlock_irqrestore(&pnp_bios_lock, flags); |
160 | 162 | ||
161 | per_cpu(cpu_gdt_table,cpu)[0x40 / 8] = save_desc_40; | 163 | get_cpu_gdt_table(cpu)[0x40 / 8] = save_desc_40; |
162 | put_cpu(); | 164 | put_cpu(); |
163 | 165 | ||
164 | /* If we get here and this is set then the PnP BIOS faulted on us. */ | 166 | /* If we get here and this is set then the PnP BIOS faulted on us. */ |
@@ -535,8 +537,10 @@ void pnpbios_calls_init(union pnp_bios_install_struct *header) | |||
535 | 537 | ||
536 | set_base(bad_bios_desc, __va((unsigned long)0x40 << 4)); | 538 | set_base(bad_bios_desc, __va((unsigned long)0x40 << 4)); |
537 | _set_limit((char *)&bad_bios_desc, 4095 - (0x40 << 4)); | 539 | _set_limit((char *)&bad_bios_desc, 4095 - (0x40 << 4)); |
538 | for(i=0; i < NR_CPUS; i++) | 540 | for (i = 0; i < NR_CPUS; i++) { |
539 | { | 541 | struct desc_struct *gdt = get_cpu_gdt_table(i); |
542 | if (!gdt) | ||
543 | continue; | ||
540 | Q2_SET_SEL(i, PNP_CS32, &pnp_bios_callfunc, 64 * 1024); | 544 | Q2_SET_SEL(i, PNP_CS32, &pnp_bios_callfunc, 64 * 1024); |
541 | Q_SET_SEL(i, PNP_CS16, header->fields.pm16cseg, 64 * 1024); | 545 | Q_SET_SEL(i, PNP_CS16, header->fields.pm16cseg, 64 * 1024); |
542 | Q_SET_SEL(i, PNP_DS, header->fields.pm16dseg, 64 * 1024); | 546 | Q_SET_SEL(i, PNP_DS, header->fields.pm16dseg, 64 * 1024); |