source: soft/giet_vm/libs/mwmr.h @ 160

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

giet-vm new version

File size: 1.4 KB
Line 
1//////////////////////////////////////////////////////////////////////////////////
2// File     : mwmr.h         
3// Date     : 01/04/2012
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7
8#ifndef _MWMR_H_
9#define _MWMR_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
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         
22    unsigned int        lock;           // exclusive access lock
23    unsigned int        data[1019];     // circular buffer
24} mwmr_channel_t;
25
26
27//////////////////////////////////////////////////////////////////////////////
28//  MWMR access functions
29//////////////////////////////////////////////////////////////////////////////
30
31void mwmr_write( mwmr_channel_t*        mwmr, 
32                 unsigned int*          buffer,
33                 unsigned int           nwords );
34
35void mwmr_read( mwmr_channel_t*         mwmr, 
36                unsigned int*           buffer,
37                unsigned int            nwords );
38#endif
39
Note: See TracBrowser for help on using the repository browser.