Last change
on this file since 166 was
159,
checked in by alain, 13 years ago
|
Introducing the spin_locks / modifying the MWMR channels and the barriers
|
File size:
1.5 KB
|
Rev | Line | |
---|
[159] | 1 | ////////////////////////////////////////////////////////////////////////////////// |
---|
| 2 | // File : mwmr_channel.h |
---|
| 3 | // Date : 01/04/2012 |
---|
| 4 | // Author : alain greiner |
---|
| 5 | // Copyright (c) UPMC-LIP6 |
---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 7 | |
---|
| 8 | #ifndef _MWMR_CHANNEL_H_ |
---|
| 9 | #define _MWMR_CHANNEL_H_ |
---|
| 10 | |
---|
| 11 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 12 | // MWMR channel structure |
---|
| 13 | // The data array size is defined to obtain sizeof(mwmr_channel_t) = 4096 bytes. |
---|
| 14 | // The actual size can be redefined in the mapping info data structure. |
---|
| 15 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 16 | |
---|
| 17 | typedef struct mwmr_channel_s { |
---|
| 18 | unsigned int ptr; // index of the first valid data word |
---|
| 19 | unsigned int ptw; // index of the first empty slot |
---|
| 20 | unsigned int sts; // number of words available |
---|
| 21 | unsigned int depth; // max number of words in the channel |
---|
| 22 | unsigned int width; // number of word in an item |
---|
| 23 | unsigned int lock; // exclusive access lock |
---|
| 24 | unsigned int data[1018]; // circular buffer |
---|
| 25 | } mwmr_channel_t; |
---|
| 26 | |
---|
| 27 | ////////////////////////////////////////////////////////////////////////////// |
---|
| 28 | // MWMR access functions |
---|
| 29 | ////////////////////////////////////////////////////////////////////////////// |
---|
| 30 | |
---|
| 31 | void mwmr_write( mwmr_channel_t* mwmr, |
---|
| 32 | unsigned int* buffer, |
---|
| 33 | unsigned int nitems ); |
---|
| 34 | |
---|
| 35 | void mwmr_read( mwmr_channel_t* mwmr, |
---|
| 36 | unsigned int* buffer, |
---|
| 37 | unsigned int nitems ); |
---|
| 38 | #endif |
---|
| 39 | |
---|
Note: See
TracBrowser
for help on using the repository browser.