From: MINAI Katsuhito <minai@jp.fujitsu.com>
To: Akio Takebe <takebe_akio@jp.fujitsu.com>
Cc: Hans-Christian Armingeon <mog.johnny@gmx.net>,
xen-devel@lists.xensource.com,
Mark Williamson <mark.williamson@cl.cam.ac.uk>
Subject: [PATCH] [1/4] put xen console message into syslog but xm dmesg is not affected
Date: Fri, 07 Jul 2006 17:17:23 +0900 [thread overview]
Message-ID: <20060707170404.E3CC.MINAI@jp.fujitsu.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 104 bytes --]
[1/4] add read pointer to the xen console ring
Signed-off-by: Katsuhito Minai <minai@jp.fujitsu.com>
[-- Attachment #2: 1.consdev.patch --]
[-- Type: application/octet-stream, Size: 1860 bytes --]
diff -r 8e55c5c11475 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c Wed Jul 05 18:48:41 2006 +0100
+++ b/xen/drivers/char/console.c Fri Jul 07 16:40:56 2006 +0900
@@ -217,19 +217,27 @@ static void putchar_console_ring(int c)
static void putchar_console_ring(int c)
{
conring[CONRING_IDX_MASK(conringp++)] = c;
- if ( (conringp - conringc) > CONRING_SIZE )
- conringc = conringp - CONRING_SIZE;
}
long read_console_ring(XEN_GUEST_HANDLE(char) str, u32 *pcount, int clear)
{
unsigned int idx, len, max, sofar, c;
unsigned long flags;
+ static int conringlogp = 0;
max = *pcount;
sofar = 0;
- c = conringc;
+ if (clear < 0) {
+ if ( (conringp - conringlogp) > CONRING_SIZE )
+ conringlogp = conringp - CONRING_SIZE;
+ c = conringlogp;
+ } else {
+ if ( (conringp - conringc) > CONRING_SIZE )
+ conringc = conringp - CONRING_SIZE;
+ c = conringc;
+ }
+
while ( (c != conringp) && (sofar < max) )
{
idx = CONRING_IDX_MASK(c);
@@ -244,7 +252,7 @@ long read_console_ring(XEN_GUEST_HANDLE(
c += len;
}
- if ( clear )
+ if ( clear > 0 )
{
spin_lock_irqsave(&console_lock, flags);
if ( (conringp - c) > CONRING_SIZE )
@@ -252,7 +260,14 @@ long read_console_ring(XEN_GUEST_HANDLE(
else
conringc = c;
spin_unlock_irqrestore(&console_lock, flags);
- }
+ } else if ( clear < 0 ) {
+ spin_lock_irqsave(&console_lock, flags);
+ if ( (conringp - c) > CONRING_SIZE )
+ conringlogp = conringp - CONRING_SIZE;
+ else
+ conringlogp = c;
+ spin_unlock_irqrestore(&console_lock, flags);
+ }
*pcount = sofar;
return 0;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2006-07-07 8:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-07 8:17 MINAI Katsuhito [this message]
2006-07-10 15:00 ` [PATCH] [1/4] put xen console message into syslog but xm dmesg is not affected Keir Fraser
2006-07-11 1:28 ` MINAI Katsuhito
2006-07-11 6:42 ` Keir Fraser
2006-07-11 8:34 ` [PATCH] [1/4] put xen console message into syslog butxm " MINAI Katsuhito
2006-07-11 15:07 ` Keir Fraser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060707170404.E3CC.MINAI@jp.fujitsu.com \
--to=minai@jp.fujitsu.com \
--cc=mark.williamson@cl.cam.ac.uk \
--cc=mog.johnny@gmx.net \
--cc=takebe_akio@jp.fujitsu.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.