diff options
author | Zachary Amsden <zach@vmware.com> | 2006-01-06 03:11:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:35 -0500 |
commit | 92f17f0171e864a2cbe448c5b7b473e72a7d27b8 (patch) | |
tree | 81e13e2cfa3b95da5fde4478a994db760e0101c0 /arch | |
parent | 2891dcdc4538e8f4ce50c9d1eea457cf2d81fb5b (diff) |
[PATCH] x86: Apm is on cpu zero only
APM BIOS code has a protective wrapper that runs it only on CPU zero. Thus,
no need to set APM BIOS segments in the GDT for other CPUs.
Signed-off-by: Zachary Amsden <zach@vmware.com>
Acked-by: "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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/apm.c | 23 |
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[] = { | |||
2222 | static int __init apm_init(void) | 2222 | static 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) |