aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-07-27 09:14:13 -0400
committerDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-07-27 09:14:13 -0400
commitc5fbc3966f48279dbebfde10248c977014aa9988 (patch)
tree0a52f645d89f91952c26b215f460a4ba195ca42c /arch/i386
parent39299d9d15c41cbdd7c7009967cd35afaf34d8fa (diff)
parent9e566d8bd61f939b7f5d7d969f5b178571471cf9 (diff)
Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/apm.c7
-rw-r--r--arch/i386/kernel/i387.c11
-rw-r--r--arch/i386/kernel/process.c20
-rw-r--r--arch/i386/kernel/reboot.c19
-rw-r--r--arch/i386/kernel/setup.c14
-rw-r--r--arch/i386/mach-visws/reboot.c5
-rw-r--r--arch/i386/mach-voyager/voyager_basic.c5
7 files changed, 21 insertions, 60 deletions
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 064211d5f41b..d7811c4e8b50 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -911,14 +911,7 @@ static void apm_power_off(void)
911 0xcd, 0x15 /* int $0x15 */ 911 0xcd, 0x15 /* int $0x15 */
912 }; 912 };
913 913
914 /*
915 * This may be called on an SMP machine.
916 */
917#ifdef CONFIG_SMP
918 /* Some bioses don't like being called from CPU != 0 */ 914 /* Some bioses don't like being called from CPU != 0 */
919 set_cpus_allowed(current, cpumask_of_cpu(0));
920 BUG_ON(smp_processor_id() != 0);
921#endif
922 if (apm_info.realmode_power_off) 915 if (apm_info.realmode_power_off)
923 { 916 {
924 (void)apm_save_cpus(); 917 (void)apm_save_cpus();
diff --git a/arch/i386/kernel/i387.c b/arch/i386/kernel/i387.c
index b817168d9c62..d75524758daf 100644
--- a/arch/i386/kernel/i387.c
+++ b/arch/i386/kernel/i387.c
@@ -82,17 +82,6 @@ void kernel_fpu_begin(void)
82} 82}
83EXPORT_SYMBOL_GPL(kernel_fpu_begin); 83EXPORT_SYMBOL_GPL(kernel_fpu_begin);
84 84
85void restore_fpu( struct task_struct *tsk )
86{
87 if ( cpu_has_fxsr ) {
88 asm volatile( "fxrstor %0"
89 : : "m" (tsk->thread.i387.fxsave) );
90 } else {
91 asm volatile( "frstor %0"
92 : : "m" (tsk->thread.i387.fsave) );
93 }
94}
95
96/* 85/*
97 * FPU tag word conversions. 86 * FPU tag word conversions.
98 */ 87 */
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index ba243a4cc119..d9492058aaf3 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -700,23 +700,27 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
700 700
701 /* 701 /*
702 * Restore %fs and %gs if needed. 702 * Restore %fs and %gs if needed.
703 *
704 * Glibc normally makes %fs be zero, and %gs is one of
705 * the TLS segments.
703 */ 706 */
704 if (unlikely(prev->fs | prev->gs | next->fs | next->gs)) { 707 if (unlikely(prev->fs | next->fs))
705 loadsegment(fs, next->fs); 708 loadsegment(fs, next->fs);
709
710 if (prev->gs | next->gs)
706 loadsegment(gs, next->gs); 711 loadsegment(gs, next->gs);
707 }
708 712
709 /* 713 /*
710 * Now maybe reload the debug registers 714 * Now maybe reload the debug registers
711 */ 715 */
712 if (unlikely(next->debugreg[7])) { 716 if (unlikely(next->debugreg[7])) {
713 set_debugreg(current->thread.debugreg[0], 0); 717 set_debugreg(next->debugreg[0], 0);
714 set_debugreg(current->thread.debugreg[1], 1); 718 set_debugreg(next->debugreg[1], 1);
715 set_debugreg(current->thread.debugreg[2], 2); 719 set_debugreg(next->debugreg[2], 2);
716 set_debugreg(current->thread.debugreg[3], 3); 720 set_debugreg(next->debugreg[3], 3);
717 /* no 4 and 5 */ 721 /* no 4 and 5 */
718 set_debugreg(current->thread.debugreg[6], 6); 722 set_debugreg(next->debugreg[6], 6);
719 set_debugreg(current->thread.debugreg[7], 7); 723 set_debugreg(next->debugreg[7], 7);
720 } 724 }
721 725
722 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) 726 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))
diff --git a/arch/i386/kernel/reboot.c b/arch/i386/kernel/reboot.c
index b3e584849961..c71fef31dc47 100644
--- a/arch/i386/kernel/reboot.c
+++ b/arch/i386/kernel/reboot.c
@@ -284,7 +284,7 @@ void machine_shutdown(void)
284 reboot_cpu_id = 0; 284 reboot_cpu_id = 0;
285 285
286 /* See if there has been given a command line override */ 286 /* See if there has been given a command line override */
287 if ((reboot_cpu_id != -1) && (reboot_cpu < NR_CPUS) && 287 if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) &&
288 cpu_isset(reboot_cpu, cpu_online_map)) { 288 cpu_isset(reboot_cpu, cpu_online_map)) {
289 reboot_cpu_id = reboot_cpu; 289 reboot_cpu_id = reboot_cpu;
290 } 290 }
@@ -311,10 +311,8 @@ void machine_shutdown(void)
311#endif 311#endif
312} 312}
313 313
314void machine_restart(char * __unused) 314void machine_emergency_restart(void)
315{ 315{
316 machine_shutdown();
317
318 if (!reboot_thru_bios) { 316 if (!reboot_thru_bios) {
319 if (efi_enabled) { 317 if (efi_enabled) {
320 efi.reset_system(EFI_RESET_COLD, EFI_SUCCESS, 0, NULL); 318 efi.reset_system(EFI_RESET_COLD, EFI_SUCCESS, 0, NULL);
@@ -337,23 +335,22 @@ void machine_restart(char * __unused)
337 machine_real_restart(jump_to_bios, sizeof(jump_to_bios)); 335 machine_real_restart(jump_to_bios, sizeof(jump_to_bios));
338} 336}
339 337
340EXPORT_SYMBOL(machine_restart); 338void machine_restart(char * __unused)
339{
340 machine_shutdown();
341 machine_emergency_restart();
342}
341 343
342void machine_halt(void) 344void machine_halt(void)
343{ 345{
344} 346}
345 347
346EXPORT_SYMBOL(machine_halt);
347
348void machine_power_off(void) 348void machine_power_off(void)
349{ 349{
350 lapic_shutdown(); 350 machine_shutdown();
351 351
352 if (efi_enabled)
353 efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
354 if (pm_power_off) 352 if (pm_power_off)
355 pm_power_off(); 353 pm_power_off();
356} 354}
357 355
358EXPORT_SYMBOL(machine_power_off);
359 356
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 7306353c520e..af4de58cab54 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -1414,7 +1414,7 @@ static struct nop {
1414 This runs before SMP is initialized to avoid SMP problems with 1414 This runs before SMP is initialized to avoid SMP problems with
1415 self modifying code. This implies that assymetric systems where 1415 self modifying code. This implies that assymetric systems where
1416 APs have less capabilities than the boot processor are not handled. 1416 APs have less capabilities than the boot processor are not handled.
1417 In this case boot with "noreplacement". */ 1417 Tough. Make sure you disable such features by hand. */
1418void apply_alternatives(void *start, void *end) 1418void apply_alternatives(void *start, void *end)
1419{ 1419{
1420 struct alt_instr *a; 1420 struct alt_instr *a;
@@ -1442,24 +1442,12 @@ void apply_alternatives(void *start, void *end)
1442 } 1442 }
1443} 1443}
1444 1444
1445static int no_replacement __initdata = 0;
1446
1447void __init alternative_instructions(void) 1445void __init alternative_instructions(void)
1448{ 1446{
1449 extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; 1447 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
1450 if (no_replacement)
1451 return;
1452 apply_alternatives(__alt_instructions, __alt_instructions_end); 1448 apply_alternatives(__alt_instructions, __alt_instructions_end);
1453} 1449}
1454 1450
1455static int __init noreplacement_setup(char *s)
1456{
1457 no_replacement = 1;
1458 return 0;
1459}
1460
1461__setup("noreplacement", noreplacement_setup);
1462
1463static char * __init machine_specific_memory_setup(void); 1451static char * __init machine_specific_memory_setup(void);
1464 1452
1465#ifdef CONFIG_MCA 1453#ifdef CONFIG_MCA
diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c
index 95e4676594e1..9e9296676f93 100644
--- a/arch/i386/mach-visws/reboot.c
+++ b/arch/i386/mach-visws/reboot.c
@@ -22,8 +22,6 @@ void machine_restart(char * __unused)
22 outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT); 22 outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT);
23} 23}
24 24
25EXPORT_SYMBOL(machine_restart);
26
27void machine_power_off(void) 25void machine_power_off(void)
28{ 26{
29 unsigned short pm_status; 27 unsigned short pm_status;
@@ -43,10 +41,7 @@ void machine_power_off(void)
43 outl(PIIX_SPECIAL_STOP, 0xCFC); 41 outl(PIIX_SPECIAL_STOP, 0xCFC);
44} 42}
45 43
46EXPORT_SYMBOL(machine_power_off);
47
48void machine_halt(void) 44void machine_halt(void)
49{ 45{
50} 46}
51 47
52EXPORT_SYMBOL(machine_halt);
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c
index 8680080a6a89..b3eda46e0fe9 100644
--- a/arch/i386/mach-voyager/voyager_basic.c
+++ b/arch/i386/mach-voyager/voyager_basic.c
@@ -278,8 +278,6 @@ machine_restart(char *cmd)
278 } 278 }
279} 279}
280 280
281EXPORT_SYMBOL(machine_restart);
282
283void 281void
284mca_nmi_hook(void) 282mca_nmi_hook(void)
285{ 283{
@@ -315,12 +313,9 @@ machine_halt(void)
315 machine_power_off(); 313 machine_power_off();
316} 314}
317 315
318EXPORT_SYMBOL(machine_halt);
319
320void machine_power_off(void) 316void machine_power_off(void)
321{ 317{
322 if (pm_power_off) 318 if (pm_power_off)
323 pm_power_off(); 319 pm_power_off();
324} 320}
325 321
326EXPORT_SYMBOL(machine_power_off);