]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
minor stuff -- mm
authorhadaq <hadaq>
Tue, 15 Oct 2002 18:15:29 +0000 (18:15 +0000)
committerhadaq <hadaq>
Tue, 15 Oct 2002 18:15:29 +0000 (18:15 +0000)
hadaq/hwrace.c
hadaq/hwrace.h
hadaq/indent.pro

index 73725e624698de355abb8f274769973fb0dfa47f..5868de2fdfb78b7ff10ca5f4b289a1de01a130b4 100644 (file)
@@ -1,4 +1,4 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwrace.c,v 6.20 2002-10-09 15:41:21 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwrace.c,v 6.21 2002-10-15 18:15:29 hadaq Exp $";
 
 
 #define _POSIX_C_SOURCE 199309L
@@ -36,10 +36,9 @@ int conHwRace(HwRace *my, const char *name, const Param *param)
        Param_getInt(param, my->name, "cardbase", &paramWasFound, &cardBase);
        if (!paramWasFound) {
                syslog(LOG_WARNING,
-                       "Parameter %s(%s) not found, default = 0", my->name, "cardbase");
+                        "Parameter %s(%s) not found, default = 0", my->name, "cardbase");
                cardBase = 0;
        }
-
        my->rc = malloc(sizeof(Rc));
 
        if (0 > conRc(my->rc, "rc", cardBase)) {
@@ -69,7 +68,7 @@ void HwRace_requestBuffer(HwRace *my)
 #define RACE_NODATASIZE 0x10
 int HwRace_readSubEvt(HwRace *my, void *subEvt)
 {
-       uint32_t * data = (uint32_t *) subEvt;
+       uint32_t *data = (uint32_t *) subEvt;
        int lastAddr;
        int currAddr;
        int size;
@@ -79,21 +78,18 @@ int HwRace_readSubEvt(HwRace *my, void *subEvt)
        lastAddr = my->currAddr + size;
 
        /* align my->currAddr to next page */
-       if ((lastAddr & 0xff) != 0) {
-               my->currAddr = ((lastAddr >> RCPAGEBITSHIFT) + 1)<< RCPAGEBITSHIFT;
-       } else {
-               my->currAddr = lastAddr;
-       }
-       if (size <= RACE_NODATASIZE) return 0;
+       my->currAddr = lastAddr + (RCPAGESIZE - 1) & ~(RCPAGESIZE - 1);
 
-       /* copy one sub evt from RC to memory */
-       *data++ = size;
-       while ((currAddr+=4) < lastAddr) {
-               *data++ = Rc_readMem(my->rc, currAddr);
+       if (size <= RACE_NODATASIZE) {
+               size = 0;
+       } else {
+               /* copy one sub evt from RC to memory */
+               *data++ = size;
+               while ((currAddr += 4) < lastAddr) {
+                       *data++ = Rc_readMem(my->rc, currAddr);
+               }
+               syslog(LOG_DEBUG, "subEvt: %s", SubEvt_2charP(subEvt));
        }
 
-#ifndef NDEBUG
-       syslog(LOG_DEBUG, "subEvt: %s", SubEvt_2charP(subEvt));
-#endif
        return size;
 }
index 5073bfd98a386a25eececc9325a76a47fe7dfa01..b68c5666b3cd8ceb06aef6928abf374bd34d9f17 100644 (file)
@@ -1,3 +1,4 @@
+
 #ifndef HwRace_H
 #define HwRace_H
 
@@ -7,15 +8,16 @@
 #include <allParam.h>
 
 typedef struct HwRaceS {
-  char name[12];
-  Rc * rc;
-  LVme_L * buf;
-  int currAddr;
-  int endOfData;
-} HwRace;
+       char name[12];
+       Rc *rc;
+       LVme_L *buf;
+       int currAddr;
+       int endOfData;
+}
 
-#define RCPAGEBITSHIFT 8
-#define RCPAGESIZE (1 << RCPAGEBITSHIFT)
+HwRace;
+
+#define RCPAGESIZE 0x100U
 
 
 int conHwRace(HwRace *my, const char *name, const Param *param);
@@ -30,12 +32,13 @@ static int HwRace_isEmpty(HwRace *my)
 
 int HwRace_readSubEvt(HwRace *my, void *subEvt);
 
-static int HwRace_isBufRequested(HwRace *my) {
+static int HwRace_isBufRequested(HwRace *my)
+{
        return my->currAddr == 0;
 }
 static void HwRace_getEndOfData(HwRace *my)
 {
-       my->endOfData = (Rc_getPages(my->rc) << RCPAGEBITSHIFT);
+       my->endOfData = Rc_getPages(my->rc) * RCPAGESIZE;
 }
 
 #endif
index 0439d917ab238c1d3559bb9bd172b6f7b3b6665d..fb1498cd91eab0dc0f0f16ceaa5fa524cc964c38 100644 (file)
@@ -1,4 +1,12 @@
 -kr -ts4 -l80
+-T int8_t
+-T int16_t
+-T int32_t
+-T uint8_t
+-T uint16_t
+-T uint32_t
+-T size_t
+-T sem_t
 -T Ctu
 -T Dtu
 -T HadTuQueue
@@ -11,7 +19,6 @@
 -T NetTrans
 -T Param
 -T PsxShm
--T sem_t
 -T ShmTrans
 -T V488
 -T V556
 -T HwRace
 -T HwShip
 -T LVme
+-T LVme_B
+-T LVme_W
+-T LVme_L
+-T LVme_VB
+-T LVme_VW
+-T LVme_VL
+-T Rc