]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
reduced VME-block and fatal exit if length is too long, mt
authorhades <hades>
Mon, 23 Apr 2001 13:26:13 +0000 (13:26 +0000)
committerhades <hades>
Mon, 23 Apr 2001 13:26:13 +0000 (13:26 +0000)
hadaq/hwtip.c

index f9ccc9035b5b57c9ecbaec60a1f38821ef864325..f8182fc627560e013703c3b9b80c3a641ef5b0f2 100644 (file)
@@ -1,4 +1,4 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwtip.c,v 1.16 2001-03-07 16:02:44 hades Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwtip.c,v 1.17 2001-04-23 13:26:13 hades Exp $";
 
 #include <assert.h>
 #include <string.h>
@@ -118,9 +118,10 @@ int conHwTip(HwTip * my, const char *name, const Param *param)
                        "Parameter %s(%s) not found, default = 0\n", my->name, "cardbase");
                cardBase = 0;
        }
+       msglog(LOG_INFO, "conc cardbase %.8x\n", cardBase );
 
        my->lvme = allocMem(sizeof(LVme));
-       if (0 > conLVme(my->lvme, cardBase, 0x4000000UL, 0x09UL, 0, 0)) {
+       if (0 > conLVme(my->lvme, cardBase, 0x3000000UL, 0x09UL, 0, 0)) {
                msglog(LOG_ERR, "HwTip on %p not found\n", cardBase);
                return -1;
        }
@@ -203,14 +204,17 @@ int HwTip_readSubEvt(HwTip * my, void *subEvt)
        size_t size;
 
        size = LVme_getL(my->lvme, my->currAddr);
-
+       if (size > 0x40000) {
+         msglog(LOG_ERR, "found size: %.8x , address: %.8x, too long, fatal! \n", size, my->currAddr);
+         exit();
+       }
        /* copy one sub evt from RC to memory */
        firstAddr = my->currAddr;
        /* take the size from above to use the check */
        *data++ = size;
        my->currAddr += 4;
        for (; my->currAddr - firstAddr < size; my->currAddr += 4) {
-               *data++ = LVme_getL(my->lvme, my->currAddr);
+         *data++ = LVme_getL(my->lvme, my->currAddr);
        }
 
        return 0;