3 #ifndef _GEMINI_IPMVAR_H_
4 #define _GEMINI_IPMVAR_H_
9 * - the queue gets located in memory shared between cores
10 * - is mapped non-cached so SW coherency is not required.
11 * - be sure ipm_queue_t starts on 32 bit (min) boundary to align descriptors
12 * - note that indicies are 8 bit and NIPMDESC < (1<<8)
13 * be sure to adjust typedef if size is increased
14 * - current sizes, typedef, and padding make sizeof(ipm_queue_t) == 4096
16 typedef uint32_t ipmqindex_t
;
18 #define IPMQPADSZ (4096 - ((sizeof(ipm_desc_t) * NIPMDESC) + (2 * sizeof(ipmqindex_t))))
19 typedef struct ipm_queue
{
20 ipm_desc_t ipm_desc
[NIPMDESC
];
21 volatile ipmqindex_t ix_write
; /* writer increments and inserts here */
22 volatile ipmqindex_t ix_read
; /* reader extracts here and increments */
23 uint8_t pad
[IPMQPADSZ
];
26 static inline ipmqindex_t
27 ipmqnext(ipmqindex_t ix
)
35 ipmqisempty(ipmqindex_t ixr
, ipmqindex_t ixw
)
43 ipmqisfull(ipmqindex_t ixr
, ipmqindex_t ixw
)
45 if (ipmqnext(ixw
) == ixr
)
50 #endif /* _GEMINI_IPMVAR_H_ */