WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [pushed] [ppc] update intf->in_cons when reading

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [pushed] [ppc] update intf->in_cons when reading
From: jimix@xxxxxxxxxxxxxx
Date: Tue, 16 May 2006 15:57:08 -0400
Delivery-date: Tue, 16 May 2006 12:55:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
changeset:   27808:0163968f7fce161f427479ec6ffed893ed6ee01e
tag:         tip
user:        jimix@xxxxxxxxxxxxxxxxxxxxx
date:        Tue May 16 15:55:19 2006 -0400
files:       arch/powerpc/platforms/xen/udbg_xen.c
description:
[ppc] update intf->in_cons when reading


diff -r 79d69778918c4efd751fb564d2b8c96bcfd74a43 -r 
0163968f7fce161f427479ec6ffed893ed6ee01e arch/powerpc/platforms/xen/udbg_xen.c
--- a/arch/powerpc/platforms/xen/udbg_xen.c     Tue May 16 15:44:25 2006 -0400
+++ b/arch/powerpc/platforms/xen/udbg_xen.c     Tue May 16 15:55:19 2006 -0400
@@ -87,6 +87,7 @@ static int udbg_getc_poll_domu_xen(void)
 static int udbg_getc_poll_domu_xen(void)
 {
        XENCONS_RING_IDX cons, prod;
+       int c;
 
        cons = intf->in_cons;
        prod = intf->in_prod;
@@ -96,7 +97,10 @@ static int udbg_getc_poll_domu_xen(void)
        if (cons == prod)
                return -1;
 
-       return intf->in[MASK_XENCONS_IDX(cons,intf->in)];
+       c = intf->in[MASK_XENCONS_IDX(cons++, intf->in)];
+       wmb();
+       intf->in_cons = cons;
+       return c;
 }
 
 static int udbg_getc_domu_xen(void)



_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>