direct-io.hg

changeset 4504:fb0fa606f610

bitkeeper revision 1.1286 (425a96ca5UAvnSzOyOKUFxfHjMVm9g)

Define atomic functions ourselves rather than relying on
kernel headers under "/usr/include".

Signed-off-by: bin.ren@cl.cam.ac.uk
author bren@br260.wolfson.cam.ac.uk
date Mon Apr 11 15:24:58 2005 +0000 (2005-04-11)
parents 56971ab9b0bb
children 3c81571fdbfb
files tools/xentrace/xentrace.c xen/include/public/trace.h xen/include/xen/trace.h
line diff
     1.1 --- a/tools/xentrace/xentrace.c	Fri Apr 08 17:59:30 2005 +0000
     1.2 +++ b/tools/xentrace/xentrace.c	Mon Apr 11 15:24:58 2005 +0000
     1.3 @@ -22,6 +22,10 @@
     1.4  #include <signal.h>
     1.5  
     1.6  #include "xc_private.h"
     1.7 +
     1.8 +typedef struct { int counter; } atomic_t;
     1.9 +#define _atomic_read(v)		((v).counter)
    1.10 +
    1.11  #include <xen/trace.h>
    1.12  
    1.13  extern FILE *stderr;
    1.14 @@ -242,7 +246,7 @@ unsigned long *init_tail_idxs(struct t_b
    1.15      }
    1.16      
    1.17      for ( i = 0; i<num; i++ )
    1.18 -        tails[i] = atomic_read(&bufs[i]->rec_idx);
    1.19 +        tails[i] = _atomic_read(bufs[i]->rec_idx);
    1.20  
    1.21      return tails;
    1.22  }
    1.23 @@ -310,7 +314,7 @@ int monitor_tbufs(FILE *logfile)
    1.24      while ( !interrupted )
    1.25      {
    1.26          for ( i = 0; ( i < num ) && !interrupted; i++ )
    1.27 -            while( cons[i] != atomic_read(&meta[i]->rec_idx) )
    1.28 +            while( cons[i] != _atomic_read(meta[i]->rec_idx) )
    1.29              {
    1.30                  write_rec(i, data[i] + cons[i], logfile);
    1.31                  cons[i] = (cons[i] + 1) % size_in_recs;
     2.1 --- a/xen/include/public/trace.h	Fri Apr 08 17:59:30 2005 +0000
     2.2 +++ b/xen/include/public/trace.h	Mon Apr 11 15:24:58 2005 +0000
     2.3 @@ -8,8 +8,6 @@
     2.4  #ifndef __XEN_PUBLIC_TRACE_H__
     2.5  #define __XEN_PUBLIC_TRACE_H__
     2.6  
     2.7 -#include <asm/atomic.h>
     2.8 -
     2.9  /* Trace classes */
    2.10  #define TRC_GEN     0x00010000    /* General trace            */
    2.11  #define TRC_SCHED   0x00020000    /* Xen Scheduler trace      */
     3.1 --- a/xen/include/xen/trace.h	Fri Apr 08 17:59:30 2005 +0000
     3.2 +++ b/xen/include/xen/trace.h	Mon Apr 11 15:24:58 2005 +0000
     3.3 @@ -23,8 +23,6 @@
     3.4  #ifndef __XEN_TRACE_H__
     3.5  #define __XEN_TRACE_H__
     3.6  
     3.7 -#include <public/trace.h>
     3.8 -
     3.9  #ifdef TRACE_BUFFER
    3.10  
    3.11  #include <asm/page.h>
    3.12 @@ -34,6 +32,7 @@
    3.13  #include <asm/current.h>
    3.14  #include <asm/msr.h>
    3.15  #include <public/dom0_ops.h>
    3.16 +#include <public/trace.h>
    3.17  
    3.18  extern struct t_buf *t_bufs[];
    3.19  extern int tb_init_done;