From: hades Date: Mon, 23 Apr 2001 13:26:13 +0000 (+0000) Subject: reduced VME-block and fatal exit if length is too long, mt X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=d6b41793057218a95d70085caebf9abb1d3660e2;p=daqdata.git reduced VME-block and fatal exit if length is too long, mt --- diff --git a/hadaq/hwtip.c b/hadaq/hwtip.c index f9ccc90..f8182fc 100644 --- a/hadaq/hwtip.c +++ b/hadaq/hwtip.c @@ -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 #include @@ -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;