patch-2.3.48 linux/arch/i386/kernel/apm.c

Next file: linux/arch/i386/kernel/entry.S
Previous file: linux/arch/i386/kernel/acpi.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.47/linux/arch/i386/kernel/apm.c linux/arch/i386/kernel/apm.c
@@ -333,7 +333,7 @@
 static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
 static struct apm_user *	user_list = NULL;
 
-static char			driver_version[] = "1.12";	/* no spaces */
+static char			driver_version[] = "1.13";	/* no spaces */
 
 static char *	apm_event_name[] = {
 	"system standby",
@@ -590,7 +590,11 @@
 					continue;
 				if (hlt_counter)
 					continue;
-				asm volatile("sti ; hlt" : : : "memory");
+				asm volatile("cli" : : : "memory");
+				if (!current->need_resched)
+					asm volatile("sti ; hlt" : : : "memory");
+				else
+					asm volatile("sti" : : : "memory");
 				continue;
 			}
 
@@ -635,7 +639,7 @@
 	 */
 #ifdef CONFIG_SMP
 	/* Some bioses don't like being called from CPU != 0 */
-	while (cpu_number_map[smp_processor_id()] != 0) {
+	while (cpu_number_map(smp_processor_id()) != 0) {
 		kernel_thread(apm_magic, NULL,
 			CLONE_FS | CLONE_FILES | CLONE_SIGHAND | SIGCHLD);
 		schedule();
@@ -916,7 +920,7 @@
 	case APM_CRITICAL_SUSPEND:
 	case APM_USER_SUSPEND:
 		/* map all suspends to ACPI D3 */
-		if (pm_send_request(PM_SUSPEND, (void *)3)) {
+		if (pm_send_all(PM_SUSPEND, (void *)3)) {
 			if (apm_bios_info.version > 0x100)
 				apm_set_power_state(APM_STATE_REJECT);
 			return 0;
@@ -925,7 +929,7 @@
 	case APM_NORMAL_RESUME:
 	case APM_CRITICAL_RESUME:
 		/* map all resumes to ACPI D0 */
-		(void) pm_send_request(PM_RESUME, (void *)0);
+		(void) pm_send_all(PM_RESUME, (void *)0);
 		break;
 	}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)