Changeset 459 for soft/giet_vm/giet_kernel/sys_handler.h
- Timestamp:
- Dec 5, 2014, 3:51:22 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/sys_handler.h
r449 r459 13 13 #define _SYS_HANDLER_H 14 14 15 #include <mapping_info.h> 16 #include <giet_config.h> 15 #include "giet_config.h" 16 #include "locks.h" 17 18 #if !defined ( GIET_NIC_NBUFS ) 19 # error: You must define GIET_NIC_NBUFS in the giet_config.h file 20 #endif 21 22 #if !defined ( GIET_NIC_NFAKE ) 23 # error: You must define GIET_NIC_NFAKE in the giet_config.h file 24 #endif 25 26 #if !defined ( GIET_NIC_BUFSIZE ) 27 # error: You must define GIET_NIC_BUFSIZE in the giet_config.h file 28 #endif 29 30 #if !defined ( GIET_NIC_TIMEOUT ) 31 # error: You must define GIET_NIC_TIMEOUT in the giet_config.h file 32 #endif 33 34 #if !defined ( GIET_NIC_MAC4 ) 35 # error: You must define GIET_NIC_MAC4 in the giet_config.h file 36 #endif 37 38 #if !defined ( GIET_NIC_MAC2 ) 39 # error: You must define GIET_NIC_MAC2 in the giet_config.h file 40 #endif 41 42 #if ( (GIET_NIC_NBUFS + GIET_NIC_NFAKE) % 8 ) 43 #error: GIET_NIC_NBUFS + GIET_NIC_NFAKE must be multiple of 8 for alignment 44 #endif 17 45 18 46 /////////////////////////////////////////////////////////////////////////////////// … … 23 51 24 52 /////////////////////////////////////////////////////////////////////////////////// 25 // This structure is used by the vci_chbuf_dma component to transfera stream53 // This structure is used by the CMA component to move a stream 26 54 // of images from two buffers in user space to the frame buffer in kernel space. 27 // It contains two chbuf descriptors 55 // it must be 64 bytes aligned. 56 // It contains two chbuf arrays: 28 57 // - The SRC chbuf contains two buffers (buf0 & buf1), that can be in user space. 29 58 // - The DST cbuf contains one single buffer (fbf), that is the frame buffer. 59 // - The length field define the buffer size (bytes) 30 60 /////////////////////////////////////////////////////////////////////////////////// 31 61 32 62 typedef struct fbf_chbuf_s 33 63 { 34 unsigned long long buf0; // physical address + status for user buffer 035 unsigned long long buf1; // physical address + status for user buffer 136 unsigned long long fbf; // physical address + status for user buffer 037 unsigned int length; // buffer length (bytes)38 unsigned int padding ; // 8bytes alignment64 unsigned long long buf0; // physical address + status for user buffer 0 65 unsigned long long buf1; // physical address + status for user buffer 1 66 unsigned long long fbf; // physical address + status for user buffer 0 67 unsigned int length; // buffer length (bytes) 68 unsigned int padding[9]; // 64 bytes alignment 39 69 } fbf_chbuf_t; 40 70 41 71 ////////////////////////////////////////////////////////////////////////////////// 42 // This structure define the generic chained buffer used by the vci_chbuf_dma 43 // component to move a stream of containers to or from the vci_multi_nic component. 72 // This structure is used by the CMA component to move a stream 73 // of packet containers between the NIC component an a chbuf containing 74 // a variable number of buffers in kernel space. 44 75 // The same structure is used for both TX or RX transfers. 76 // It must be 64 bytes aligned. 45 77 // The single buffer size and the number of buffers must be defined by the 46 // GIET_NIC_CHBUF_SIZE and GIET_NIC_CHBUF_NBUFS parameters in giet_config.h. 47 // - The buffer array is the chbuf descriptor, shared by the vci_chbuf_dma, 48 // and by the kernel. 49 // - The index field is only used by the kernel. It define the currently pointed 78 // GIET_NIC_BUFSIZE and GIET_NIC_NBUFS parameters in giet_config.h. 79 // - The buffer array implements the chbuf, and is concurently accessed 80 // by the CMA component and by the kernel code. 81 // - The lock must be taken by the kernel code, because several user tasks 82 // can concurently try to consume buffers in the chbuf. 83 // - The index is only used by the kernel, and define the currently pointed 50 84 // buffer for read (RX transfer) or write (TX transfer). 51 85 ////////////////////////////////////////////////////////////////////////////////// … … 53 87 typedef struct nic_chbuf_s 54 88 { 55 unsigned long long buffer[GIET_NIC_CHBUF_NBUFS]; // chbuf descriptor 56 unsigned int index; // current buffer index 57 unsigned int padding; // 8 bytes alignment 89 unsigned long long buffer[GIET_NIC_NBUFS]; // Kernel CHBUF 90 unsigned long long unused[GIET_NIC_NFAKE]; // padding for 64 bytes alignment 91 unsigned int index; // current buffer index 92 unsigned int padding[15]; // padding for 64 bytes alignment 58 93 } nic_chbuf_t; 59 94 … … 95 130 int _sys_nic_alloc( unsigned int is_rx ); 96 131 97 int _sys_nic_start( unsigned int is_rx, 98 unsigned int mac4, 99 unsigned int mac2 ); 132 int _sys_nic_start( unsigned int is_rx ); 100 133 101 134 int _sys_nic_move( unsigned int is_rx, 135 unsigned int nic_channel, 102 136 void* buffer ); 103 137 104 138 int _sys_nic_stop( unsigned int is_rx ); 139 140 int _sys_nic_clear( unsigned int is_rx ); 141 142 int _sys_nic_stats( unsigned int is_rx ); 105 143 106 144 //////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.