From: Frank Mori Hess Date: Mon, 18 Jun 2001 22:32:27 +0000 (+0000) Subject: declared some variables as volatile to be safe X-Git-Tag: r0_7_60~161 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=69b8d9331724753bafc818d16ce4a13ffde126cf;p=comedi.git declared some variables as volatile to be safe --- diff --git a/comedi/drivers/comedi_rt_timer.c b/comedi/drivers/comedi_rt_timer.c index fedca4f9..ea80de08 100644 --- a/comedi/drivers/comedi_rt_timer.c +++ b/comedi/drivers/comedi_rt_timer.c @@ -126,9 +126,9 @@ typedef struct{ // time between conversions in a scan RTIME convert_period; // flags - unsigned stop : 1; // indicates we should stop - unsigned rt_task_active : 1; // indicates rt_task is servicing a comedi_cmd - unsigned scan_task_active : 1; // indicates scan_task is servicing a comedi_cmd + volatile int stop; // indicates we should stop + volatile int rt_task_active; // indicates rt_task is servicing a comedi_cmd + volatile int scan_task_active; // indicates scan_task is servicing a comedi_cmd }timer_private; #define devpriv ((timer_private *)dev->private) diff --git a/comedi/drivers/das1800.c b/comedi/drivers/das1800.c index e4b4ba0c..cb57040f 100644 --- a/comedi/drivers/das1800.c +++ b/comedi/drivers/das1800.c @@ -436,8 +436,8 @@ das1800_board das1800_boards[] = #define thisboard ((das1800_board *)dev->board_ptr) typedef struct{ - unsigned long count; /* number of data points left to be taken */ - int forever; /* flag indicating whether we should take data forever */ + volatile unsigned int count; /* number of data points left to be taken */ + volatile int forever; /* flag indicating whether we should take data forever */ unsigned int divisor1; /* value to load into board's counter 1 for timed conversions */ unsigned int divisor2; /* value to load into board's counter 2 for timed conversions */ int do_bits; /* digital output bits */ @@ -447,10 +447,10 @@ typedef struct{ int dma_bits; unsigned int dma0; /* dma channels used */ unsigned int dma1; - unsigned int dma_current; /* dma channel currently in use */ + volatile unsigned int dma_current; /* dma channel currently in use */ short *dma_buf0; /* pointers to dma buffers */ short *dma_buf1; - short *dma_current_buf; /* pointer to dma buffer currently being used */ + volatile short *dma_current_buf; /* pointer to dma buffer currently being used */ unsigned int dma_buf_max_size; /* allocated size in bytes of dma buffers */ unsigned int dma_buf_size; /* size of buffers currently used, depends on sampling frequency */ int iobase2; /* secondary io address used for analog out on 'ao' boards */ @@ -937,7 +937,7 @@ static void das1800_handle_dma(comedi_device *dev, comedi_subdevice *s) unsigned long numPoints, leftover; long maxPoints, residue; short dpnt; - short *buffer; + volatile short *buffer; int unipolar; int i; const int dual_dma = devpriv->irq_dma_bits & DMA_DUAL; diff --git a/comedi/drivers/das800.c b/comedi/drivers/das800.c index 278ff6c1..32e56cc2 100644 --- a/comedi/drivers/das800.c +++ b/comedi/drivers/das800.c @@ -235,8 +235,8 @@ das800_board das800_boards[] = #define thisboard ((das800_board *)dev->board_ptr) typedef struct{ - unsigned long count; /* number of data points left to be taken */ - int forever; /* flag indicating whether we should take data forever */ + volatile unsigned int count; /* number of data points left to be taken */ + volatile int forever; /* flag indicating whether we should take data forever */ unsigned int divisor1; /* value to load into board's counter 1 for timed conversions */ unsigned int divisor2; /* value to load into board's counter 2 for timed conversions */ int do_bits; /* digital output bits */