mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
um: Support suspend to RAM
With all the previous bits in place, we can now also support suspend to RAM, in the sense that everything is suspended, not just most, including userspace, processes like in s2idle. Since um_idle_sleep() now waits forever, we can simply call that to "suspend" the system. As before, you can wake it up using SIGUSR1 since we're just in a pause() call that only needs to return. In order to implement selective resume from certain devices, and not have any arbitrary device interrupt wake up, suspend interrupts by removing SIGIO notification (O_ASYNC) from all the FDs that are not supposed to wake up the system. However, swap out the handler so we don't actually handle the SIGIO as an interrupt. Since we're in pause(), the mere act of receiving SIGIO wakes us up, and then after things have been restored enough, re-set O_ASYNC for all previously suspended FDs, reinstall the proper SIGIO handler, and send SIGIO to self to process anything that might now be pending. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
92dcd3d318
commit
a374b7cb1e
6 changed files with 139 additions and 2 deletions
|
@ -234,6 +234,11 @@ void set_handler(int sig)
|
|||
panic("sigprocmask failed - errno = %d\n", errno);
|
||||
}
|
||||
|
||||
void send_sigio_to_self(void)
|
||||
{
|
||||
kill(os_getpid(), SIGIO);
|
||||
}
|
||||
|
||||
int change_sig(int signal, int on)
|
||||
{
|
||||
sigset_t sigset;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue