um: Allow PM with suspend-to-idle
[ Upstream commit 92dcd3d31843fbe1a95d880dc912e1f6beac6632 ] In order to be able to experiment with suspend in UML, add the minimal work to be able to suspend (s2idle) an instance of UML, and be able to wake it back up from that state with the USR1 signal sent to the main UML process. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
c6cf21d8d5
commit
b58294ce1a
@@ -136,6 +136,16 @@ void set_sigstack(void *sig_stack, int size)
|
||||
panic("enabling signal stack failed, errno = %d\n", errno);
|
||||
}
|
||||
|
||||
static void sigusr1_handler(int sig, struct siginfo *unused_si, mcontext_t *mc)
|
||||
{
|
||||
uml_pm_wake();
|
||||
}
|
||||
|
||||
void register_pm_wake_signal(void)
|
||||
{
|
||||
set_handler(SIGUSR1);
|
||||
}
|
||||
|
||||
static void (*handlers[_NSIG])(int sig, struct siginfo *si, mcontext_t *mc) = {
|
||||
[SIGSEGV] = sig_handler,
|
||||
[SIGBUS] = sig_handler,
|
||||
@@ -145,7 +155,9 @@ static void (*handlers[_NSIG])(int sig, struct siginfo *si, mcontext_t *mc) = {
|
||||
|
||||
[SIGIO] = sig_handler,
|
||||
[SIGWINCH] = sig_handler,
|
||||
[SIGALRM] = timer_alarm_handler
|
||||
[SIGALRM] = timer_alarm_handler,
|
||||
|
||||
[SIGUSR1] = sigusr1_handler,
|
||||
};
|
||||
|
||||
static void hard_handler(int sig, siginfo_t *si, void *p)
|
||||
|
Reference in New Issue
Block a user