Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Sep 2012 09:36:27 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        "freebsd-acpi@freebsd.org" <freebsd-acpi@FreeBSD.org>
Subject:   notify userland about C-state changes
Message-ID:  <504EDBEB.6010104@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

What do you think about an idea of notifying userland about C-state changes when
(after) they actually happen?
As you know, currently power management scripts are invoked on an AC line state
change notification, which is not exactly the same thing.
It may make sense to notify abut each CPU individually and the perhaps do
another notification when all CPUs are transitioned.

The following patch adds only per-CPU notifications.

    acpi_cpu: explicitly notify userland about c-state changes

diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c
index 82e204a..15201f9 100644
--- a/sys/dev/acpica/acpi_cpu.c
+++ b/sys/dev/acpica/acpi_cpu.c
@@ -1054,6 +1054,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context)
     ACPI_SERIAL_BEGIN(cpu);
     acpi_cpu_set_cx_lowest(sc);
     ACPI_SERIAL_END(cpu);
+
+    acpi_UserNotify("PROCESSOR", sc->cpu_handle, notify);
 }

 static int

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?504EDBEB.6010104>