aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-01-06 03:19:05 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:48 -0500
commit4111b025dc64f33803d2147565147428dc51d014 (patch)
tree9eaf09fd540df937c40d16a973c11f0427c0c1b0 /arch/um
parent6f517d3fc862d3c8d8ba65c0b2472d399aceb9ed (diff)
[PATCH] uml: capture printk output for mconsole sysrq
Pass sysrq output back to the mconsole client using the mechanism introduced for stack output. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/drivers/mconsole_kern.c48
1 files changed, 30 insertions, 18 deletions
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index e9bbc14f3655..8b453a7e685c 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -463,24 +463,6 @@ void mconsole_remove(struct mc_request *req)
463 mconsole_reply(req, err_msg, err, 0); 463 mconsole_reply(req, err_msg, err, 0);
464} 464}
465 465
466#ifdef CONFIG_MAGIC_SYSRQ
467void mconsole_sysrq(struct mc_request *req)
468{
469 char *ptr = req->request.data;
470
471 ptr += strlen("sysrq");
472 while(isspace(*ptr)) ptr++;
473
474 mconsole_reply(req, "", 0, 0);
475 handle_sysrq(*ptr, &current->thread.regs, NULL);
476}
477#else
478void mconsole_sysrq(struct mc_request *req)
479{
480 mconsole_reply(req, "Sysrq not compiled in", 1, 0);
481}
482#endif
483
484static DEFINE_SPINLOCK(console_lock); 466static DEFINE_SPINLOCK(console_lock);
485static LIST_HEAD(clients); 467static LIST_HEAD(clients);
486static char console_buf[MCONSOLE_MAX_DATA]; 468static char console_buf[MCONSOLE_MAX_DATA];
@@ -549,6 +531,36 @@ static void with_console(struct mc_request *req, void (*proc)(void *),
549 list_del(&entry.list); 531 list_del(&entry.list);
550} 532}
551 533
534#ifdef CONFIG_MAGIC_SYSRQ
535static void sysrq_proc(void *arg)
536{
537 char *op = arg;
538
539 handle_sysrq(*op, &current->thread.regs, NULL);
540}
541
542void mconsole_sysrq(struct mc_request *req)
543{
544 char *ptr = req->request.data;
545
546 ptr += strlen("sysrq");
547 while(isspace(*ptr)) ptr++;
548
549 /* With 'b', the system will shut down without a chance to reply,
550 * so in this case, we reply first.
551 */
552 if(*ptr == 'b')
553 mconsole_reply(req, "", 0, 0);
554
555 with_console(req, sysrq_proc, ptr);
556}
557#else
558void mconsole_sysrq(struct mc_request *req)
559{
560 mconsole_reply(req, "Sysrq not compiled in", 1, 0);
561}
562#endif
563
552static void stack_proc(void *arg) 564static void stack_proc(void *arg)
553{ 565{
554 struct task_struct *from = current, *to = arg; 566 struct task_struct *from = current, *to = arg;