[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.