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-changelog

[Xen-changelog] Define atomic functions ourselves rather than relying on

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Define atomic functions ourselves rather than relying on
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Mon, 11 Apr 2005 15:24:58 +0000
Delivery-date: Mon, 11 Apr 2005 18:03:57 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1286, 2005/04/11 16:24:58+01:00, bren@xxxxxxxxxxxxxxxxxxxxxxx

        Define atomic functions ourselves rather than relying on
        kernel headers under "/usr/include".
        
        Signed-off-by: bin.ren@xxxxxxxxxxxx



 tools/xentrace/xentrace.c  |    8 ++++++--
 xen/include/public/trace.h |    2 --
 xen/include/xen/trace.h    |    3 +--
 3 files changed, 7 insertions(+), 6 deletions(-)


diff -Nru a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
--- a/tools/xentrace/xentrace.c 2005-04-11 14:03:51 -04:00
+++ b/tools/xentrace/xentrace.c 2005-04-11 14:03:51 -04:00
@@ -22,6 +22,10 @@
 #include <signal.h>
 
 #include "xc_private.h"
+
+typedef struct { int counter; } atomic_t;
+#define _atomic_read(v)                ((v).counter)
+
 #include <xen/trace.h>
 
 extern FILE *stderr;
@@ -242,7 +246,7 @@
     }
     
     for ( i = 0; i<num; i++ )
-        tails[i] = atomic_read(&bufs[i]->rec_idx);
+        tails[i] = _atomic_read(bufs[i]->rec_idx);
 
     return tails;
 }
@@ -310,7 +314,7 @@
     while ( !interrupted )
     {
         for ( i = 0; ( i < num ) && !interrupted; i++ )
-            while( cons[i] != atomic_read(&meta[i]->rec_idx) )
+            while( cons[i] != _atomic_read(meta[i]->rec_idx) )
             {
                 write_rec(i, data[i] + cons[i], logfile);
                 cons[i] = (cons[i] + 1) % size_in_recs;
diff -Nru a/xen/include/public/trace.h b/xen/include/public/trace.h
--- a/xen/include/public/trace.h        2005-04-11 14:03:51 -04:00
+++ b/xen/include/public/trace.h        2005-04-11 14:03:51 -04:00
@@ -8,8 +8,6 @@
 #ifndef __XEN_PUBLIC_TRACE_H__
 #define __XEN_PUBLIC_TRACE_H__
 
-#include <asm/atomic.h>
-
 /* Trace classes */
 #define TRC_GEN     0x00010000    /* General trace            */
 #define TRC_SCHED   0x00020000    /* Xen Scheduler trace      */
diff -Nru a/xen/include/xen/trace.h b/xen/include/xen/trace.h
--- a/xen/include/xen/trace.h   2005-04-11 14:03:51 -04:00
+++ b/xen/include/xen/trace.h   2005-04-11 14:03:51 -04:00
@@ -23,8 +23,6 @@
 #ifndef __XEN_TRACE_H__
 #define __XEN_TRACE_H__
 
-#include <public/trace.h>
-
 #ifdef TRACE_BUFFER
 
 #include <asm/page.h>
@@ -34,6 +32,7 @@
 #include <asm/current.h>
 #include <asm/msr.h>
 #include <public/dom0_ops.h>
+#include <public/trace.h>
 
 extern struct t_buf *t_bufs[];
 extern int tb_init_done;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Define atomic functions ourselves rather than relying on, BitKeeper Bot <=