[Suspend2][ 13/21] [Suspend2] Main message output.

From: Nigel Cunningham
Date: Tue Jun 27 2006 - 00:48:09 EST


Output one of the main messages describing our progress, possibly also
clearing the progress bar. These messages are printk'd if there is no
active userui.

Signed-off-by: Nigel Cunningham <nigel@xxxxxxxxxxxx>

kernel/power/ui.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/kernel/power/ui.c b/kernel/power/ui.c
index 6542f3f..b11edb8 100644
--- a/kernel/power/ui.c
+++ b/kernel/power/ui.c
@@ -439,3 +439,30 @@ void abort_suspend(const char *fmt, ...)
}
}

+/* suspend_prepare_status
+ * Description: Prepare the 'nice display', drawing the header and version,
+ * along with the current action and perhaps also resetting the
+ * progress bar.
+ * Arguments:
+ * int clearbar: Whether to reset the progress bar.
+ * const char *fmt, ...: The action to be displayed.
+ */
+void suspend_prepare_status(int clearbar, const char *fmt, ...)
+{
+ va_list args;
+
+ if (fmt) {
+ va_start(args, fmt);
+ lastheader_message_len = vsnprintf(lastheader, 512, fmt, args);
+ va_end(args);
+ }
+
+ if (clearbar)
+ suspend_update_status(0, 1, NULL);
+
+ __suspend_message(0, SUSPEND_STATUS, 1, lastheader, NULL);
+
+ if (ui_helper_data.pid == -1)
+ printk(KERN_EMERG "%s\n", lastheader);
+}
+

--
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/