Changeset 461 for soft/giet_vm/giet_libs/mwmr_channel.h
- Timestamp:
- Dec 5, 2014, 4:02:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/mwmr_channel.h
r450 r461 11 11 // 12 12 // The mwmr_read() and mwmr_write() functions do not require a system call. 13 // The channel itselfmust have been allocated in a non cacheable segment,13 // The channel must have been allocated in a non cacheable segment, 14 14 // if the platform does not provide hardware cache coherence. 15 //16 // WARNING : ALL MWMR channels must be defined in the mapping,17 // to be initialised by the GIET in the boot phase.18 // The vobj_get_vbase() system call (defined in stdio.c and stdio.h files)19 // can be used to get the virtual base address of the channel from it's name.20 15 // 21 16 // An MWMR transaction transfer an integer number of items, and an item is … … 27 22 // 28 23 // Both the mwmr_read() and mwmr_write() functions are blocking functions. 29 // A private lock provides exclusive access to the MWMR channel, that can have 30 // a variable number of producers and a variable number of consumers. 24 // A private file_lock provides exclusive access to the MWMR channel. 31 25 /////////////////////////////////////////////////////////////////////////////////// 32 26 33 27 #ifndef _MWMR_CHANNEL_H_ 34 28 #define _MWMR_CHANNEL_H_ 29 30 #include "user_lock.h" 35 31 36 32 /////////////////////////////////////////////////////////////////////////////////// … … 42 38 typedef struct mwmr_channel_s 43 39 { 44 u nsigned int ptr; // index of the first valid data word45 unsigned int ptw; // index of the first empty slot46 unsigned int sts; // number of words available47 unsigned int lock; // exclusive access lock48 unsigned int depth; // max number of words in the channel49 unsigned int width; // number of words in an item50 unsigned int data[1018]; // circular buffer40 user_lock_t lock; // exclusive access lock 41 unsigned int ptr; // index of the first valid data word 42 unsigned int ptw; // index of the first empty slot 43 unsigned int sts; // number of words available 44 unsigned int depth; // max number of words in the channel 45 unsigned int width; // number of words in an item 46 unsigned int* data; // circular buffer base address 51 47 } mwmr_channel_t; 52 48 … … 56 52 57 53 void mwmr_init( mwmr_channel_t* mwmr, 54 unsigned int* buffer, // data buffer base address 58 55 unsigned int width, // number of words per item 59 unsigned int items );// max number of items56 unsigned int nitems ); // max number of items 60 57 61 void mwmr_ write( mwmr_channel_t* mwmr,62 unsigned int* buffer, // user buffer vbase address63 unsigned int nitems ); // number of items to transfer58 void mwmr_read( mwmr_channel_t* mwmr, 59 unsigned int* buffer, 60 unsigned int items ); 64 61 65 void mwmr_write( mwmr_channel_t* mwmr, 66 unsigned int* buffer, // user buffer vbase address67 unsigned int nitems ); // number of items to transfer62 void mwmr_write( mwmr_channel_t* mwmr, 63 unsigned int* buffer, 64 unsigned int items ); 68 65 69 66 unsigned int nb_mwmr_read ( mwmr_channel_t * mwmr, 70 67 unsigned int * buffer, 71 unsigned int nitems );68 unsigned int items ); 72 69 73 70 unsigned int nb_mwmr_write( mwmr_channel_t * mwmr, 74 71 unsigned int * buffer, 75 unsigned int nitems );72 unsigned int items ); 76 73 77 74 #endif
Note: See TracChangeset
for help on using the changeset viewer.