From: James S. <jsi...@us...> - 2002-06-22 17:51:01
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/i386/kernel In directory usw-pr-cvs1:/tmp/cvs-serv25751/linux/arch/i386/kernel Modified Files: apm.c Log Message: Synced to 2.5.24 Index: apm.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/i386/kernel/apm.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- apm.c 18 Jun 2002 18:51:54 -0000 1.7 +++ apm.c 22 Jun 2002 17:50:58 -0000 1.8 @@ -899,7 +899,7 @@ */ #ifdef CONFIG_SMP /* Some bioses don't like being called from CPU != 0 */ - while (cpu_number_map(smp_processor_id()) != 0) { + while (smp_processor_id() != 0) { kernel_thread(apm_magic, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND | SIGCHLD); schedule(); @@ -922,12 +922,13 @@ * callback we use. */ -void handle_poweroff (int key, struct pt_regs *pt_regs, - struct tty_struct *tty) { +static void handle_poweroff (int key, struct pt_regs *pt_regs, + struct tty_struct *tty) +{ apm_power_off(); } -struct sysrq_key_op sysrq_poweroff_op = { +static struct sysrq_key_op sysrq_poweroff_op = { handler: handle_poweroff, help_msg: "Off", action_msg: "Power Off\n" @@ -1586,7 +1587,7 @@ p = buf; - if ((smp_num_cpus == 1) && + if ((num_online_cpus() == 1) && !(error = apm_get_power_status(&bx, &cx, &dx))) { ac_line_status = (bx >> 8) & 0xff; battery_status = bx & 0xff; @@ -1717,7 +1718,7 @@ } } - if (debug && (smp_num_cpus == 1)) { + if (debug && (num_online_cpus() == 1)) { error = apm_get_power_status(&bx, &cx, &dx); if (error) printk(KERN_INFO "apm: power status not available\n"); @@ -1761,7 +1762,7 @@ pm_power_off = apm_power_off; register_sysrq_key('o', &sysrq_poweroff_op); - if (smp_num_cpus == 1) { + if (num_online_cpus() == 1) { #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT) console_blank_hook = apm_console_blank; #endif @@ -1904,7 +1905,9 @@ printk(KERN_NOTICE "apm: disabled on user request.\n"); return -ENODEV; } - if ((smp_num_cpus > 1) && !power_off) { + /* FIXME: When boot code changes, this will need to be + deactivated when/if a CPU comes up --RR */ + if ((num_online_cpus() > 1) && !power_off) { printk(KERN_NOTICE "apm: disabled - APM is not SMP safe.\n"); return -ENODEV; } @@ -1958,7 +1961,9 @@ kernel_thread(apm, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND | SIGCHLD); - if (smp_num_cpus > 1) { + /* FIXME: When boot code changes, this will need to be + deactivated when/if a CPU comes up --RR */ + if (num_online_cpus() > 1) { printk(KERN_NOTICE "apm: disabled - APM is not SMP safe (power off active).\n"); return 0; |