lkml.org 
[lkml]   [2006]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[Suspend2][ 04/21] [Suspend2] Process abort request.
    Date
    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/

    \
     
     \ /
      Last update: 2006-06-27 06:56    [W:2.150 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site