source: soft/giet_vm/libs/mwmr_channel.h @ 179

Last change on this file since 179 was 179, checked in by karaoui, 12 years ago

reverting modification in kernel_init: mwmr depth

File size: 1.5 KB
Line 
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
17typedef 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[1];                // circular buffer
25} mwmr_channel_t;
26
27//////////////////////////////////////////////////////////////////////////////
28//  MWMR access functions
29//////////////////////////////////////////////////////////////////////////////
30
31void mwmr_write( mwmr_channel_t*            mwmr, 
32                 const unsigned int*    buffer,
33                 unsigned int               nitems );
34
35void 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.