Ejemplo n.º 1
0
static void *devA24Malloc(size_t size)
{
    static int    UsingBSP = 0;
    void        *ret;
    
    if (A24MallocFunc == NULL)
    {
        /* See if the sysA24Malloc() function is present. */
        A24MallocFunc = epicsFindSymbol("sysA24Malloc");
        if(!A24MallocFunc) {
            A24MallocFunc = malloc;
            A24FreeFunc   = free;
        } else {
            A24FreeFunc = epicsFindSymbol("sysA24Free");
            if(!A24FreeFunc) {
              /* That's strange... we have malloc, but no free! */
                A24MallocFunc = malloc;
                A24FreeFunc   = free;
            } else {
                UsingBSP = 1;
            }
        }
    }
    ret = A24MallocFunc(size);
    
    if ((ret == NULL) && (UsingBSP))
        errMessage(S_dev_noMemory, "devLibA24Malloc ran out of A24 memory, try sysA24MapRam(size)");
    
    return(ret);
}
Ejemplo n.º 2
0
epicsShareFunc void * epicsShareAPI registryFind(
    void *registryID,const char *name)
{
    GPHENTRY *pentry;
    if(name==0) return(0);
    if(registryID==0) return(epicsFindSymbol(name));
    if(!gphPvt) registryInit(0);
    pentry = gphFind(gphPvt,(char *)name,registryID);
    if(!pentry) return(0);
    return(pentry->userPvt);
}
Ejemplo n.º 3
0
void atRebootRegister(void)
{
    sysAtReboot_t sysAtReboot = (sysAtReboot_t) epicsFindSymbol("_sysAtReboot");

    if (sysAtReboot) {
        STATUS status = sysAtReboot(epicsExitCallAtExits);

        if (status) {
            printf("atReboot: sysAtReboot returned error %d\n", status);
        }
    } else {
        printf("BSP routine sysAtReboot() not found, epicsExit() will not be\n"
               "called by reboot.  For reduced functionality, call\n"
               "    rebootHookAdd(epicsExitCallAtExits)\n");
    }
}
Ejemplo n.º 4
0
/*
 *
 *  initHandlerAddrList()
 *      init list of interrupt handlers to ignore
 *
 */
static 
void initHandlerAddrList(void)
{
    int i;

    for (i=0; i<NELEMENTS(defaultHandlerNames); i++) {
        defaultHandlerAddr[i] = epicsFindSymbol(defaultHandlerNames[i]);
        if(!defaultHandlerAddr[i]) {
            errPrintf(
                S_dev_internal,
                __FILE__,
                __LINE__,
                "initHandlerAddrList() %s not in sym table",
                defaultHandlerNames[i]);
        }
    }
}
Ejemplo n.º 5
0
/* PCI library initialization for vxWorks */
static
int vxworksDevPCIInit (void) {
    int              status;
    unsigned char**  pTable;
    int*             pTableSize;

    if ((status = sharedDevPCIInit()))
        return status;

   /* We cannot be sure if the BSP supports PCI, or even sysBusToLocalAdrs.
    * Check the symbol table and replace any missing routines with dummy
    * counterparts.
    */
    CallPciIntConnect = epicsFindSymbol ("pciIntConnect");
    if (!CallPciIntConnect)
        CallPciIntConnect = &dummyPciIntConnect;

    CallPciIntDisconnect = epicsFindSymbol ("pciIntDisconnect");
    if (!CallPciIntDisconnect)
        CallPciIntDisconnect = &dummyPciIntDisconnect;

    CallPciIntDisconnect2 = epicsFindSymbol ("pciIntDisconnect2");

    CallSysBusToLocalAdrs = epicsFindSymbol ("sysBusToLocalAdrs");
    if (!CallSysBusToLocalAdrs)
        CallSysBusToLocalAdrs = &dummySysBusToLocalAdrs;

   /* See if this BSP uses a translation table to convert IRQ values
    * into interrupt indices.
    */
    pTable = epicsFindSymbol ("sysInumTbl");
    if (!pTable || !*pTable)
        return 0;

    inumTable = *pTable;

   /* If the BSP does use a translation table, get the number of entries
    */
    pTableSize = epicsFindSymbol ("sysInumTblNumEnt");
    if (!pTableSize) {
        printf ("WARNING: Interrupt number translation table is empty\n");
        return 0;
    }

    inumTableSize = *pTableSize;
    return 0;
}