linux/arch/um/os-Linux
Johannes Berg a374b7cb1e 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>
2020-12-13 22:22:49 +01:00
..
drivers um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
skas um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
elf_aux.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
execvp.c um: Use os_warn to print out pre-boot warning/error messages 2017-07-05 23:18:25 +02:00
file.c um: Use fdatasync() when mapping the UBD FSYNC command 2020-06-02 22:37:55 +02:00
helper.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
irq.c um: Remove IRQ_NONE type 2020-12-13 22:22:29 +01:00
main.c um: Don't trace irqflags during shutdown 2019-11-25 22:42:57 +01:00
Makefile um: Increase stack frame size threshold for signal.c 2020-12-13 22:22:00 +01:00
mem.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
process.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
registers.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
sigio.c um: Remove IRQ_NONE type 2020-12-13 22:22:29 +01:00
signal.c um: Support suspend to RAM 2020-12-13 22:22:49 +01:00
start_up.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
time.c um: Simplify os_idle_sleep() and sleep longer 2020-12-13 22:22:37 +01:00
tty.c um: Add SPDX headers for files in arch/um/os-Linux 2019-09-15 21:37:17 +02:00
umid.c um: Remove use of asprinf in umid.c 2020-12-13 22:21:07 +01:00
user_syms.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
util.c um: Some fixes to build UML with musl 2020-10-11 23:13:06 +02:00