/[pkg-src]/trunk/kernel26-xen/patches-2.6.25-r1/1054-2.6.25-xen-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch |
Contents of /trunk/kernel26-xen/patches-2.6.25-r1/1054-2.6.25-xen-DEBUG-Add-xprintk-to-log-directly-via-hypercall-fo.patch
Parent Directory | Revision Log
Revision 606 -
(show annotations)
(download)
Thu May 22 23:13:13 2008 UTC (15 years, 11 months ago) by niro
File size: 1574 byte(s)
Thu May 22 23:13:13 2008 UTC (15 years, 11 months ago) by niro
File size: 1574 byte(s)
-ver bump to 2.6.25-magellan-r1: - linux-2.6.25.4 - fbcondecor-0.9.4 - squashfs-3.3 - unionfs-2.3.3 - tuxonice-3.0-rc7 - linux-phc-0.3.0 - acpi-dstd-0.9a - reiser4 - xen-3.2.0 . ipw3945-1.2.2
1 | From aa819a503e9dab87d2451996ab75133b2022f871 Mon Sep 17 00:00:00 2001 |
2 | From: Stephen Tweedie <sct@redhat.com> |
3 | Date: Wed, 21 Nov 2007 18:40:31 +0000 |
4 | Subject: [PATCH] DEBUG: Add xprintk to log directly via hypercall, for early debugging |
5 | |
6 | Signed-off-by: Stephen Tweedie <sct@redhat.com> |
7 | --- |
8 | arch/x86/xen/enlighten.c | 31 +++++++++++++++++++++++++++++++ |
9 | 1 files changed, 31 insertions(+), 0 deletions(-) |
10 | |
11 | diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c |
12 | index bb97446..b091b1c 100644 |
13 | --- a/arch/x86/xen/enlighten.c |
14 | +++ b/arch/x86/xen/enlighten.c |
15 | @@ -137,6 +137,37 @@ static void __init xen_vcpu_setup(int cpu) |
16 | } |
17 | } |
18 | |
19 | +static void kcons_write_dom0(const char *s, unsigned int count) |
20 | +{ |
21 | + int rc; |
22 | + |
23 | + while ((count > 0) && |
24 | + ((rc = HYPERVISOR_console_io( |
25 | + CONSOLEIO_write, count, (char *)s)) > 0)) { |
26 | + count -= rc; |
27 | + s += rc; |
28 | + } |
29 | +} |
30 | + |
31 | + |
32 | +/*** Useful function for console debugging -- goes straight to Xen. ***/ |
33 | +asmlinkage int xprintk(const char *fmt, ...) |
34 | +{ |
35 | + va_list args; |
36 | + int printk_len; |
37 | + static char printk_buf[1024]; |
38 | + |
39 | + /* Emit the output into the temporary buffer */ |
40 | + va_start(args, fmt); |
41 | + printk_len = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args); |
42 | + va_end(args); |
43 | + |
44 | + /* Send the processed output directly to Xen. */ |
45 | + kcons_write_dom0(printk_buf, printk_len); |
46 | + |
47 | + return 0; |
48 | +} |
49 | + |
50 | static void __init xen_banner(void) |
51 | { |
52 | printk(KERN_INFO "Booting paravirtualized kernel on %s\n", |
53 | -- |
54 | 1.5.4.1 |
55 |