Skip to content
Snippets Groups Projects
Commit e2100c91 authored by Rolf Bork's avatar Rolf Bork
Browse files

Code cleanup for compiler warnings and volatile declarations.

parent 93e7adf5
No related branches found
No related tags found
No related merge requests found
......@@ -322,7 +322,7 @@ INLINE void commData3Send(
if ( lastPcie >= 0 )
{
clflush_cache_range(
&( ipcInfo[ lastPcie ]
(void *)&( ipcInfo[ lastPcie ]
.pIpcDataWrite[ 0 ]
->dBlock[ sendBlock ][ ipcInfo[ lastPcie ].ipcNum ]
.data ),
......@@ -381,7 +381,7 @@ INLINE void commData3Send(
if ( lastPcie >= 0 )
{
clflush_cache_range(
&( ipcInfo[ lastPcie ]
(void *)&( ipcInfo[ lastPcie ]
.pIpcDataWrite[ 0 ]
->dBlock[ sendBlock ][ ipcInfo[ lastPcie ].ipcNum ]
.data ),
......
......@@ -37,7 +37,7 @@
#if defined (TIME_MASTER) || defined (TIME_SLAVE)
TIMING_SIGNAL *pcieTimer;
volatile TIMING_SIGNAL *pcieTimer;
#endif
......@@ -98,7 +98,7 @@ void *fe_start_iop(void *arg)
static int cpuClock[CPU_TIMER_CNT]; /// @param cpuClock[] Code timing diag variables
int sync21ppsCycles = 0; /// @param sync32ppsCycles Number of attempts to sync to 1PPS
RFM_FE_COMMS *pEpicsComms; /// @param *pEpicsComms Pointer to EPICS shared memory space
volatile RFM_FE_COMMS *pEpicsComms; /// @param *pEpicsComms Pointer to EPICS shared memory space
int status; /// @param status Typical function return value
float onePps; /// @param onePps Value of 1PPS signal, if used, for diagnostics
int onePpsHi = 0; /// @param onePpsHi One PPS diagnostic check
......@@ -128,6 +128,7 @@ void *fe_start_iop(void *arg)
int usloop=1;
double adcval[MAX_ADC_MODULES][MAX_ADC_CHN_PER_MOD];
adcInfo_t *padcinfo;
......@@ -144,11 +145,11 @@ void *fe_start_iop(void *arg)
fz_daz(); /// \> Kill the denorms!
/// \> Init comms with EPICS processor */
pEpicsComms = (RFM_FE_COMMS *)_epics_shm;
pLocalEpics = (CDS_EPICS *)&pEpicsComms->epicsSpace;
pEpicsDaq = (char *)&(pLocalEpics->epicsOutput);
pEpicsComms = (volatile RFM_FE_COMMS *)_epics_shm;
pLocalEpics = (volatile CDS_EPICS *)&pEpicsComms->epicsSpace;
pEpicsDaq = (volatile char *)&(pLocalEpics->epicsOutput);
adcInfo_t *padcinfo = (adcInfo_t *)&adcinfo;
padcinfo = (adcInfo_t *)&adcinfo;
#ifdef OVERSAMPLE
/// \> Zero out filter histories
memset(dHistory, 0, sizeof(dHistory));
......@@ -183,10 +184,10 @@ adcInfo_t *padcinfo = (adcInfo_t *)&adcinfo;
#ifdef TIME_MASTER
pcieTimer = (TIMING_SIGNAL *) ((volatile char *)(cdsPciModules.dolphinWrite[0]) + IPC_PCIE_TIME_OFFSET);
pcieTimer = (volatile TIMING_SIGNAL *) ((volatile char *)(cdsPciModules.dolphinWrite[0]) + IPC_PCIE_TIME_OFFSET);
#endif
#ifdef TIME_SLAVE
pcieTimer = (TIMING_SIGNAL *) ((volatile char *)(cdsPciModules.dolphinRead[0]) + IPC_PCIE_TIME_OFFSET);
pcieTimer = (volatile TIMING_SIGNAL *) ((volatile char *)(cdsPciModules.dolphinRead[0]) + IPC_PCIE_TIME_OFFSET);
syncSource = SYNC_SRC_DOLPHIN;
#endif
......
......@@ -91,7 +91,7 @@ inline void initializeTimingDiags(timing_diag_t *timeinfo)
timeinfo->cycleTime = 0;
}
inline void sendTimingDiags2Epics(CDS_EPICS *pLocalEpics,
inline void sendTimingDiags2Epics(volatile CDS_EPICS *pLocalEpics,
timing_diag_t *timeinfo,
adcInfo_t *adcinfo)
{
......
......@@ -10,20 +10,20 @@ extern char *_daq_shm; ///< Pointer to DAQ base address in shared memory.
struct rmIpcStr *dipc; ///< Pointer to DAQ IPC data in shared memory.
struct cdsDaqNetGdsTpNum *tpPtr; ///< Pointer to TP table in shared memory.
char *daqShmPtr; ///< Pointer to DAQ data in shared memory.
char *pEpicsIntData; ///< Pointer to EPICS integer type data in shared memory.
char *pEpicsDblData; ///< Pointer to EPICS double type data in shared memory.
volatile char *pEpicsIntData; ///< Pointer to EPICS integer type data in shared memory.
volatile char *pEpicsDblData; ///< Pointer to EPICS double type data in shared memory.
unsigned int curDaqBlockSize; ///< Total DAQ data rate diag
// Added to get EPICS data for RCG V2.8
char *pEpicsInt; // Pointer to current DAQ data in shared memory.
char *pEpicsInt1;
float *pEpicsFloat; // Pointer to current DAQ data in shared memory.
double *pEpicsDblData1;
volatile char *pEpicsInt; // Pointer to current DAQ data in shared memory.
volatile char *pEpicsInt1;
volatile float *pEpicsFloat; // Pointer to current DAQ data in shared memory.
volatile double *pEpicsDblData1;
int daqConfig(struct DAQ_INFO_BLOCK *, struct DAQ_INFO_BLOCK *, char *);
int daqConfig(volatile DAQ_INFO_BLOCK *, volatile DAQ_INFO_BLOCK *, volatile char *);
int loadLocalTable(DAQ_XFER_INFO *, DAQ_LKUP_TABLE[], int, DAQ_INFO_BLOCK *,
DAQ_RANGE *);
int daqWrite(int, int, struct DAQ_RANGE, int, double *[], struct FILT_MOD *,
int, int[], double[], char *);
int, int[], double[], volatile char *);
inline double htond(double in) {
double retVal;
......@@ -70,7 +70,7 @@ inline double htond(double in) {
int daqWrite(int flag, int dcuId, DAQ_RANGE daqRange, int sysRate,
double *pFloatData[], FILT_MOD *dspPtr, int netStatus,
int gdsMonitor[], double excSignal[], char *pEpics) {
int gdsMonitor[], double excSignal[], volatile char *pEpics) {
int ii, jj, kk; /* Loop counters. */
int status; /* Return value from called routines. */
unsigned int mydatatype;
......@@ -536,13 +536,13 @@ int daqWrite(int flag, int dcuId, DAQ_RANGE daqRange, int sysRate,
/// - ---- Write EPICS integer values to beginning of local write buffer
if (dataInfo.cpyepics2times) {
memcpy((void *)pWriteBuffer, pEpicsIntData, dataInfo.cpyIntSize[0]);
memcpy((void *)pWriteBuffer, (void *)pEpicsIntData, dataInfo.cpyIntSize[0]);
pEpicsInt = (char *)pWriteBuffer;
pEpicsInt += dataInfo.cpyIntSize[0];
pEpicsInt1 = pEpicsIntData + dataInfo.cpyIntSize[0] + 4;
memcpy(pEpicsInt, pEpicsInt1, dataInfo.cpyIntSize[1]);
memcpy((void *)pEpicsInt, (void *)pEpicsInt1, dataInfo.cpyIntSize[1]);
} else {
memcpy((void *)pWriteBuffer, pEpicsIntData, dataInfo.cpyIntSize[0]);
memcpy((void *)pWriteBuffer, (void *)pEpicsIntData, dataInfo.cpyIntSize[0]);
}
}
if (daqSlot == DAQ_XFER_CYCLE_DBL) {
......@@ -921,7 +921,7 @@ int daqWrite(int flag, int dcuId, DAQ_RANGE daqRange, int sysRate,
/// @param[in] pEpics Pointer to beginning of EPICS data.
/// @return Size, in bytes, of DAQ data.
// **************************************************************************************
int daqConfig(DAQ_INFO_BLOCK *dataInfo, DAQ_INFO_BLOCK *pInfo, char *pEpics) {
int daqConfig(volatile DAQ_INFO_BLOCK *dataInfo, volatile DAQ_INFO_BLOCK *pInfo, volatile char *pEpics) {
int ii, jj; // Loop counters
int epicsIntXferSize = 0; // Size, in bytes, of EPICS integer type data.
int dataLength = 0; // Total size, in bytes, of data to be sent
......
......@@ -115,7 +115,7 @@ int gsc16ai64CheckDmaDone(int module)
/// @return ADC DMA Status (0=not complete, 16=complete
/// Note: This function not presently used.
// *****************************************************************************
int gsc16ai64WaitDmaDone(int module, int *data)
int gsc16ai64WaitDmaDone(int module, volatile int *data)
{
do{
}while((adcDma[module]->DMA_CSR & GSAI_DMA_DONE) == 0);
......
......@@ -5,6 +5,9 @@
#define ADC_SS_ID 0x3101 ///< Subsystem ID to identify and locate module on PCI bus
int gsc16ai64AdcStop(void);
int gsc16ai64CheckAdcBuffer(int);
int gsc16ai64Init(CDS_HARDWARE *, struct pci_dev *);
/// Structure defining ADC module PCI register layout as per user manual
typedef struct GSA_ADC_REG{
......
......@@ -195,7 +195,7 @@ iop_adc_read( adcInfo_t* adcinfo, int cpuClk[] )
#ifdef TIME_MASTER
pcieTimer->gps_time = timeSec;
pcieTimer->cycle = cycleNum;
clflush_cache_range( &pcieTimer->gps_time, 16 );
clflush_cache_range( (void *)&pcieTimer->gps_time, 16 );
#endif
}
else
......
inline int
waitPcieTimingSignal( TIMING_SIGNAL* timePtr, int cycle )
waitPcieTimingSignal( volatile TIMING_SIGNAL* timePtr, int cycle )
{
int loop = 0;
......@@ -14,7 +14,7 @@ waitPcieTimingSignal( TIMING_SIGNAL* timePtr, int cycle )
return ( 0 );
}
inline unsigned int
sync2master( TIMING_SIGNAL* timePtr )
sync2master( volatile TIMING_SIGNAL* timePtr )
{
int loop = 0;
int cycle = 0;
......@@ -234,12 +234,11 @@ iop_dac_init( int errorPend[] )
}
inline int
iop_dac_write( )
iop_dac_write( void )
{
unsigned int* pDacData;
int ii, jj, mm;
int limit;
int mask;
int num_outs;
int status = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment