source: multiio/pcmmio/j.diff @ 13bdbee

base
Last change on this file since 13bdbee was 13bdbee, checked in by Joel Sherrill <joel.sherrill@…>, on 03/17/11 at 15:04:30

Initial import.

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[13bdbee]1Index: mio_io_rtems.c
2===================================================================
3RCS file: /home/CVS-Mitre/pcmmio-rtems/mio_io_rtems.c,v
4retrieving revision 1.10
5diff -u -r1.10 mio_io_rtems.c
6--- mio_io_rtems.c      13 Aug 2009 20:49:38 -0000      1.10
7+++ mio_io_rtems.c      11 Dec 2009 15:12:44 -0000
8@@ -663,24 +681,34 @@
9       #endif
10 
11       /*
12-       * Buffer the interrupt
13-       *
14-       * NOTE: No need to worry about disabling interrupts,
15-       *       we are in interrupts.
16+       * Ensure there is space to buffer the interrupt
17        */
18+      if ( inptr == (outptr-1) || ((inptr == MAX_INTS) && outptr == 0)) {
19+        pcmmio_dio_missed_interrupts++;
20 
21-      int_buffer[inptr].timestamp = rdtsc();
22-      int_buffer[inptr].line = int_num;
23-      inptr++;
24-      if (inptr == MAX_INTS)
25-        inptr = 0;
26+       /* Clear the interrupt */
27+       clr_int(int_num);
28+        /* at last slot */
29+      } else {
30+        /*
31+         * Buffer the interrupt
32+         *
33+         * NOTE: No need to worry about disabling interrupts,
34+         *       we are in interrupts.
35+         */
36+       int_buffer[inptr].timestamp = rdtsc();
37+       int_buffer[inptr].line = int_num;
38+       inptr++;
39+       if (inptr == MAX_INTS)
40+         inptr = 0;
41 
42-      /* Clear the interrupt */
43-      clr_int(int_num);
44-    }
45+       /* Clear the interrupt */
46+       clr_int(int_num);
47 
48-    /* Wake up anybody waiting for a DIO interrupt */
49-    wake_up_interruptible(&wq_dio);
50+        /* Wake up anybody waiting for a DIO interrupt */
51+        wake_up_interruptible(&wq_dio);
52+      }
53+    }
54   }
55 
56   if (status & 0x10) {
Note: See TracBrowser for help on using the repository browser.