svn commit: r282750 - in stable/10/sys: dev/acpica dev/syscons dev/vt sys

Andriy Gapon avg at FreeBSD.org
Mon May 11 08:16:35 UTC 2015


Author: avg
Date: Mon May 11 08:16:33 2015
New Revision: 282750
URL: https://svnweb.freebsd.org/changeset/base/282750

Log:
  MFC r277796: hook userland threads suspend + resume into acpi suspend code

Modified:
  stable/10/sys/dev/acpica/acpi.c
  stable/10/sys/dev/syscons/syscons.c
  stable/10/sys/dev/vt/vt_core.c
  stable/10/sys/sys/eventhandler.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/acpica/acpi.c
==============================================================================
--- stable/10/sys/dev/acpica/acpi.c	Mon May 11 08:00:16 2015	(r282749)
+++ stable/10/sys/dev/acpica/acpi.c	Mon May 11 08:16:33 2015	(r282750)
@@ -2749,6 +2749,8 @@ acpi_EnterSleepState(struct acpi_softc *
 	return_ACPI_STATUS (AE_OK);
     }
 
+    EVENTHANDLER_INVOKE(power_suspend_early);
+    stop_all_proc();
     EVENTHANDLER_INVOKE(power_suspend);
 
     if (smp_started) {
@@ -2892,6 +2894,8 @@ backout:
 	thread_unlock(curthread);
     }
 
+    resume_all_proc();
+
     EVENTHANDLER_INVOKE(power_resume);
 
     /* Allow another sleep request after a while. */

Modified: stable/10/sys/dev/syscons/syscons.c
==============================================================================
--- stable/10/sys/dev/syscons/syscons.c	Mon May 11 08:00:16 2015	(r282749)
+++ stable/10/sys/dev/syscons/syscons.c	Mon May 11 08:16:33 2015	(r282750)
@@ -550,7 +550,7 @@ sc_attach_unit(int unit, int flags)
 
     /* Register suspend/resume/shutdown callbacks for the kernel console. */
     if (sc_console_unit == unit) {
-	EVENTHANDLER_REGISTER(power_suspend, scsuspend, NULL,
+	EVENTHANDLER_REGISTER(power_suspend_early, scsuspend, NULL,
 			      EVENTHANDLER_PRI_ANY);
 	EVENTHANDLER_REGISTER(power_resume, scresume, NULL,
 			      EVENTHANDLER_PRI_ANY);

Modified: stable/10/sys/dev/vt/vt_core.c
==============================================================================
--- stable/10/sys/dev/vt/vt_core.c	Mon May 11 08:00:16 2015	(r282749)
+++ stable/10/sys/dev/vt/vt_core.c	Mon May 11 08:16:33 2015	(r282750)
@@ -2560,8 +2560,8 @@ vt_upgrade(struct vt_device *vd)
 
 	if (register_handlers) {
 		/* Register suspend/resume handlers. */
-		EVENTHANDLER_REGISTER(power_suspend, vt_suspend_handler, vd,
-		    EVENTHANDLER_PRI_ANY);
+		EVENTHANDLER_REGISTER(power_suspend_early, vt_suspend_handler,
+		    vd, EVENTHANDLER_PRI_ANY);
 		EVENTHANDLER_REGISTER(power_resume, vt_resume_handler, vd,
 		    EVENTHANDLER_PRI_ANY);
 	}

Modified: stable/10/sys/sys/eventhandler.h
==============================================================================
--- stable/10/sys/sys/eventhandler.h	Mon May 11 08:00:16 2015	(r282749)
+++ stable/10/sys/sys/eventhandler.h	Mon May 11 08:16:33 2015	(r282750)
@@ -182,6 +182,7 @@ EVENTHANDLER_DECLARE(shutdown_final, shu
 typedef void (*power_change_fn)(void *);
 EVENTHANDLER_DECLARE(power_resume, power_change_fn);
 EVENTHANDLER_DECLARE(power_suspend, power_change_fn);
+EVENTHANDLER_DECLARE(power_suspend_early, power_change_fn);
 
 /* Low memory event */
 typedef void (*vm_lowmem_handler_t)(void *, int);


More information about the svn-src-all mailing list