22 #if defined(__PPC__) || defined(__mcf528x__) 26 #include <bsp/bspExt.h> 30 typedef void myISR (
void *pParam);
32 static myISR *isrFetch(
unsigned vectorNumber,
void **parg);
40 static myISR *defaultHandlerAddr[]={
49 # define VME_AM_CSR (0x2f) 60 #define EPICSAddrTypeNoConvert -1 75 size_t logicalAddress,
size_t size,
volatile void **ppPhysicalAddress);
81 static long rtemsDevReadProbe (
unsigned wordSize,
volatile const void *ptr,
void *pValue);
87 static long rtemsDevWriteProbe (
unsigned wordSize,
volatile void *ptr,
const void *pValue);
89 static long rtemsDevConnectInterruptVME (
90 unsigned vectorNumber,
94 static long rtemsDevDisconnectInterruptVME (
95 unsigned vectorNumber,
99 static long rtemsDevEnableInterruptLevelVME (
unsigned level);
101 static long rtemsDevDisableInterruptLevelVME (
unsigned level);
103 static int rtemsDevInterruptInUseVME (
unsigned vectorNumber);
108 static void *devA24Malloc(
size_t size) {
return 0;}
109 static void devA24Free(
void *pBlock) {};
110 static long rtemsDevInit(
void);
116 rtemsDevMapAddr, rtemsDevReadProbe, rtemsDevWriteProbe,
117 rtemsDevConnectInterruptVME, rtemsDevDisconnectInterruptVME,
118 rtemsDevEnableInterruptLevelVME, rtemsDevDisableInterruptLevelVME,
119 devA24Malloc,devA24Free,rtemsDevInit,rtemsDevInterruptInUseVME
137 static long rtemsDevConnectInterruptVME (
138 unsigned vectorNumber,
148 status = BSP_installVME_isr(
170 static long rtemsDevDisconnectInterruptVME (
171 unsigned vectorNumber,
183 psub = isrFetch(vectorNumber, &arg);
184 if(psub != pFunction){
188 status = BSP_removeVME_isr(
195 (
void*)vectorNumber);
206 static long rtemsDevEnableInterruptLevelVME (
unsigned level)
208 return BSP_enableVME_int_lvl(level);
214 static long rtemsDevDisableInterruptLevelVME (
unsigned level)
216 return BSP_disableVME_int_lvl(level);
223 size_t logicalAddress,
size_t size,
volatile void **ppPhysicalAddress)
227 if (ppPhysicalAddress==
NULL) {
233 *ppPhysicalAddress = (
void *) logicalAddress;
238 logicalAddress, (
unsigned long *)ppPhysicalAddress);
251 rtems_status_code bspExtMemProbe(
void *addr,
int write,
int size,
void *pval);
252 static long rtemsDevReadProbe (
unsigned wordSize,
volatile const void *ptr,
void *pValue)
259 status = bspExtMemProbe ((
void*)ptr, 0, wordSize, pValue);
260 if (status!=RTEMS_SUCCESSFUL) {
271 static long rtemsDevWriteProbe (
unsigned wordSize,
volatile void *ptr,
const void *pValue)
278 status = bspExtMemProbe ((
void*)ptr, 1, wordSize, (
void*)pValue);
279 if (status!=RTEMS_SUCCESSFUL) {
289 static myISR *isrFetch(
unsigned vectorNumber,
void **parg)
294 return (
myISR *) BSP_getVME_isr(vectorNumber,parg);
300 static int rtemsDevInterruptInUseVME (
unsigned vectorNumber)
306 psub = isrFetch (vectorNumber,&arg);
314 for (i=0; i<
NELEMENTS(defaultHandlerAddr); i++) {
315 if (defaultHandlerAddr[i] == psub) {
349 "Interrupt to EPICS disconnected vector" 366 const long *s = (
long *)source;
367 long *d = (
long *)destination;
epicsAddressType
The available bus address types.
void unsolicitedHandlerEPICS(int vectorNumber)
#define S_dev_noDevice
No device at specified address.
int devInterruptInUseVME(unsigned level)
Determine if a VME interrupt vector is in use.
#define S_dev_vectorNotInUse
Interrupt vector not in use by caller.
#define S_dev_vecInstlFail
Interrupt vector install failed.
Extended replacement for the Posix exit and atexit routines.
LIBCOM_API void epicsInterruptContextMessage(const char *message)
devLibVME * pdevLibVME
Pointer to the entry table used by devLibVME routines.
int EPICStovxWorksAddrType[]
#define S_dev_vectorInUse
Interrupt vector in use.
A table of function pointers for devLibVME implementations.
#define EPICSAddrTypeNoConvert
#define S_dev_badArgument
Bad function argument.
void bcopyLongs(char *source, char *destination, int nlongs)
#define S_dev_addrMapFail
Unable to map address.
API for accessing hardware devices, mosty over VMEbus.