6.0 Basic Operation
CN8478/CN8474A/CN8472A/CN8471A
6.3 Channel Operation
Multichannel Synchronous Communications Controller (MUSYCC™)
6.3.4 Interrupt Queue Descriptor
#define BYTES_PER_INT_DESCR 4 /* recall, dword = 32-bits or 4 bytes */
#define NUM_INT_DESCR_NEEDED 10 /* assumption (min = 2, max = 32768) */
#define SIZE_OF_INTERRUPT_QUEUE (BYTES_PER_INT_DESCR * NUM_INT_DESCR_NEEDED)
#define INT_QUEUE_BOUNDARY 4
/* local variables */
unsigned long *pIntQueue;
unsigned long IntQueueLen;
pIntQueue = malloc( SIZE_OF_INTERRUPT_QUEUE + INT_QUEUE_BOUNDARY );
pIntQueue = (pIntQueue + INT_QUEUE_BOUNDARY) & ~(INT_QUEUE_BOUNDARY – 1);
/* interrupt queue pointers must be a dword aligned address */
/* above, there is enough space to first move forward 4 bytes, then */
/* lop off the 4 automatically. This will bring the pointer back */
/* to the original address or give us the next 4 byte boundary address */
/* IMPORTANT NOTE: be sure to save away the original pointer returned by the */
/* memory access routine as that same value will be required to free the space.
*/
IntQueueLen = NUM_INT_DESCR_NEEDED - 1; /* 0-based */
GroupStr0.IntQueueDescr[0] = pIntQueue;
GroupStr0.IntQueueDescr[1] = IntQueueLen;
/* either write directly into MUSYCC register - or - use a service request */
/* for this descriptor, 2 dwords need to be written, so 2 write accesses */
*(MUSYCC_FUNC_0_BAR + INT_QUEUE_POINTER_OFFSET)= GroupStr0.IntQueueDescr[0];
*(MUSYCC_FUNC_0_BAR + INT_QUEUE_LENGTH_OFFSET) = GroupStr0.IntQueueDescr[1];
The components of the Interrupt Queue Descriptor are listed in Table 6-3.
Table 6-3. Example—Components of Interrupt Queue Descriptor
Component of
Descriptor
Descriptor
Value of Components
Interrupt
Queue
IQPTR
pIntQueue, provided by memory allocation functions and adjusted to
be dword bound
Descriptor
IQLEN
IntQueueLen, specified by #define (0-based)
6-12
Conexant
100660E