Re: Cancel Sleep
Re: Cancel Sleep
- Subject: Re: Cancel Sleep
- From: Amanda Walker <email@hidden>
- Date: Tue, 1 Jan 2008 23:10:42 -0500
On Jan 1, 2008, at 10:38 PM, Andrew James wrote:
But seriously can we get back to the point!!!!
Some of us have been. I've pointed you at more appropriate mailing
lists (darwin-kernel and darwin-drivers). I've outlined an overall
strategy for interposing or overriding any kernel behavior that you
don't like. I know these messages are getting through to the mailing
list.
How does one get a notification of the lid state changing (When the
lid closes, nothing to do with sleep) that does not also mix up with
the power state changing,
One doesn't, without writing a kext to implement new kernel-level
behavior, for the simple reason that no such notification currently
exists.
As i've suggested twice now, write a kext that Interposes on (or even
replaces) the existing kernel code (at a first guess, the PMU
driver). You might not even have to patch running code--you might be
able to get by just registering as the recipient for PMU interrupts
(since the PMU is where the clamshell sensor is wired to), and
queueing up a user-level notification yourself before passing along
the interrupt to the system driver. But in any case, you'll have to
dig into it at the IOKit driver level, since the system PMU driver is
what sends the kIOPMSleepNow notification to the root domain in
response to a "clamshell closed" interrupt. It also handles the power
button, the AC power state change, etc. There is no notification of
the clamshell state that is not "mixed up with the power state
changing" for you to register for, so if you need one, you'll have to
synthesize one yourself by watching the physical interrupt coming in
from the hardware.
If you want to see how all this works in excruciating detail, see the
OpenPMU driver (part of XPostFacto, which is open source). In
particular, take a look at OpenPMUPwrController.cpp.
We can't get any closer to the "point" without actually writing the
code for you.
--Amanda
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden