Messages in this thread Patch in this message | | | From | Nigel Cunningham <> | Subject | [Suspend2][ 04/21] [Suspend2] Process abort request. | Date | Tue, 27 Jun 2006 14:41:26 +1000 |
| |
Handle a request via the userui that we abort a cycle. This is ignored at resume time or if we're already aborting.
Signed-off-by: Nigel Cunningham <nigel@suspend2.net>
kernel/power/ui.c | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/kernel/power/ui.c b/kernel/power/ui.c index 0441be5..365c033 100644 --- a/kernel/power/ui.c +++ b/kernel/power/ui.c @@ -92,3 +92,29 @@ void userui_redraw(void) USERUI_MSG_REDRAW, NULL, 0); } +/* request_abort_suspend + * + * Description: Handle the user requesting the cancellation of a suspend by + * pressing escape. + * Callers: Invoked from a netlink packet from userspace when the user presses + * escape. + */ +void request_abort_suspend(void) +{ + if (test_result_state(SUSPEND_ABORT_REQUESTED)) + return; + + if (test_suspend_state(SUSPEND_NOW_RESUMING)) { + suspend_prepare_status(CLEAR_BAR, "Escape pressed. " + "Powering down again."); + suspend_power_down(); + } else { + suspend_prepare_status(CLEAR_BAR, "--- ESCAPE PRESSED :" + " ABORTING PROCESS ---"); + set_result_state(SUSPEND_ABORTED); + set_result_state(SUSPEND_ABORT_REQUESTED); + + wake_up_interruptible(&userui_wait_for_key); + } +} + -- Nigel Cunningham nigel at suspend2 dot net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |