mrfioc2  2.3.0
RTEMS/irqHack.cpp
Go to the documentation of this file.
1 
2 #include <devLib.h>
3 #include <epicsInterrupt.h>
4 
5 /* Ugly workaround for VME interrupt ack. timing problem
6  * in the VME MRM EVRs.
7  *
8  * VME EVRs acknowledge interrupts by RORA (release on register access)
9  * writing to the IRQFlags register. This causes the card to stop
10  * asserting its interrupt line. Unfortunatly there is occasionally
11  * a delay between when the write completes (DTACK asserted) and
12  * when the interrupt line is released. During this time the VME
13  * master detects that the interrupt is still being asserted and
14  * starts another IACK cycle. However, by this time the interrupt
15  * line has gone down and the card does not complete the second
16  * IACK cycle resulting in a bus error.
17  *
18  * Unfortuanatly the RTEMS VME driver reports the bus error as an
19  * interrupt on vector 0xff. When it receives an interrupt on a
20  * vector with no handler it disables the level.
21  *
22  * "vmeTsi148 ISR: ERROR: no handler registered (level 4) IACK 0x000000FF -- DISABLING level 4"
23  *
24  * Until the firmware can be fixed we install a handler for vector 0xff
25  * which prints a message.
26  */
27 
28 static
29 void
30 nullISR(void*)
31 {
32  epicsInterruptContextMessage("Spurious interrupt on vector 0xff");
33 }
34 
35 extern "C"
36 void
38 {
39  devConnectInterruptVME(0xff, &nullISR, NULL);
40 }
41 
42 #include <iocsh.h>
43 #include <epicsExport.h>
44 static const iocshArg * const installRTEMSHackArgs[0] = {};
45 
46 static const iocshFuncDef installRTEMSHackDef = {"installRTEMSHack", 0, installRTEMSHackArgs};
47 void
48 installRTEMSHackCall(const iocshArgBuf *args)
49 {
51 }
52 
53 static
54 void
55 registerISRHack(void)
56 {
57  iocshRegister(&installRTEMSHackDef,&installRTEMSHackCall);
58 }
59 epicsExportRegistrar(registerISRHack);
Definition: evrdump.c:37
epicsExportRegistrar(registerISRHack)
void installRTEMSHack(void)
void installRTEMSHackCall(const iocshArgBuf *args)