aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/apm.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 45199bb6455b..d0b488056cc4 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -2222,8 +2222,8 @@ static struct dmi_system_id __initdata apm_dmi_table[] = {
2222static int __init apm_init(void) 2222static int __init apm_init(void)
2223{ 2223{
2224 struct proc_dir_entry *apm_proc; 2224 struct proc_dir_entry *apm_proc;
2225 struct desc_struct *gdt;
2225 int ret; 2226 int ret;
2226 int i;
2227 2227
2228 dmi_check_system(apm_dmi_table); 2228 dmi_check_system(apm_dmi_table);
2229 2229
@@ -2314,18 +2314,17 @@ static int __init apm_init(void)
2314 * not restrict themselves to their claimed limit. When this happens, 2314 * not restrict themselves to their claimed limit. When this happens,
2315 * they will cause a segmentation violation in the kernel at boot time. 2315 * they will cause a segmentation violation in the kernel at boot time.
2316 * Most BIOS's, however, will respect a 64k limit, so we use that. 2316 * Most BIOS's, however, will respect a 64k limit, so we use that.
2317 *
2318 * Note we only set APM segments on CPU zero, since we pin the APM
2319 * code to that CPU.
2317 */ 2320 */
2318 for (i = 0; i < NR_CPUS; i++) { 2321 gdt = get_cpu_gdt_table(0);
2319 struct desc_struct *gdt = get_cpu_gdt_table(i); 2322 set_base(gdt[APM_CS >> 3],
2320 if (!gdt) 2323 __va((unsigned long)apm_info.bios.cseg << 4));
2321 continue; 2324 set_base(gdt[APM_CS_16 >> 3],
2322 set_base(gdt[APM_CS >> 3], 2325 __va((unsigned long)apm_info.bios.cseg_16 << 4));
2323 __va((unsigned long)apm_info.bios.cseg << 4)); 2326 set_base(gdt[APM_DS >> 3],
2324 set_base(gdt[APM_CS_16 >> 3], 2327 __va((unsigned long)apm_info.bios.dseg << 4));
2325 __va((unsigned long)apm_info.bios.cseg_16 << 4));
2326 set_base(gdt[APM_DS >> 3],
2327 __va((unsigned long)apm_info.bios.dseg << 4));
2328 }
2329 2328
2330 apm_proc = create_proc_info_entry("apm", 0, NULL, apm_get_info); 2329 apm_proc = create_proc_info_entry("apm", 0, NULL, apm_get_info);
2331 if (apm_proc) 2330 if (apm_proc)