Changeset 478 for soft/giet_vm/giet_kernel/sys_handler.h
- Timestamp:
- Jan 1, 2015, 7:58:56 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/sys_handler.h
r467 r478 16 16 #include "locks.h" 17 17 18 #if !defined ( GIET_NIC_NBUFS )19 # error: You must define GIET_NIC_NBUFS in the giet_config.h file20 #endif21 22 #if !defined ( GIET_NIC_NFAKE )23 # error: You must define GIET_NIC_NFAKE in the giet_config.h file24 #endif25 26 #if !defined ( GIET_NIC_BUFSIZE )27 # error: You must define GIET_NIC_BUFSIZE in the giet_config.h file28 #endif29 30 #if !defined ( GIET_NIC_TIMEOUT )31 # error: You must define GIET_NIC_TIMEOUT in the giet_config.h file32 #endif33 34 #if !defined ( GIET_NIC_MAC4 )35 # error: You must define GIET_NIC_MAC4 in the giet_config.h file36 #endif37 38 #if !defined ( GIET_NIC_MAC2 )39 # error: You must define GIET_NIC_MAC2 in the giet_config.h file40 #endif41 42 #if ( (GIET_NIC_NBUFS + GIET_NIC_NFAKE) % 8 )43 #error: GIET_NIC_NBUFS + GIET_NIC_NFAKE must be multiple of 8 for alignment44 #endif45 46 18 /////////////////////////////////////////////////////////////////////////////////// 47 19 // Syscall Vector Table (indexed by syscall index) … … 51 23 52 24 /////////////////////////////////////////////////////////////////////////////////// 25 // This structure is used by the nic_chbuf_t and fbf_chbuf_t structures. 26 // It describes a single buffer descriptor. The useful information is contained 27 // in one single 64 bits word (desc field): 28 // - the 48 LSB bits contain the buffer physical address 29 // - the MSB bit 63 indicates the buffer state (empty if 0) 30 // This descriptor must be aligned on a cache line (64 bytes) to simplify 31 // the software L2/L3 cache coherence when the IO bridge is used. 32 /////////////////////////////////////////////////////////////////////////////////// 33 34 typedef struct buffer_descriptor_s 35 { 36 unsigned long long desc; 37 unsigned int padding[14]; 38 } buffer_descriptor_t; 39 40 /////////////////////////////////////////////////////////////////////////////////// 53 41 // This structure is used by the CMA component to move a stream 54 // of images from two buffers in user spaceto the frame buffer in kernel space.42 // of images from two user buffers to the frame buffer in kernel space. 55 43 // it must be 64 bytes aligned. 56 44 // It contains two chbuf arrays: 57 // - The SRC chbuf contains two buffers (buf0 & buf1), that can bein user space.45 // - The SRC chbuf contains two buffers (buf0 & buf1), in user space. 58 46 // - The DST cbuf contains one single buffer (fbf), that is the frame buffer. 59 47 // - The length field define the buffer size (bytes) … … 62 50 typedef struct fbf_chbuf_s 63 51 { 64 unsigned long long buf0; // physical address + status for user buffer 065 unsigned long long buf1; // physical address + status for user buffer 166 unsigned long long fbf; // physical address + status for user buffer 067 unsigned int length;// buffer length (bytes)68 unsigned int padding[9]; // padding for 64 bytes alignment52 buffer_descriptor_t buf0; // first user buffer descriptor 53 buffer_descriptor_t buf1; // second user buffer descriptor 54 buffer_descriptor_t fbf; // frame buffer descriptor 55 unsigned int length; // buffer length (bytes) 56 unsigned int padding[15]; // padding for 64 bytes alignment 69 57 } fbf_chbuf_t; 70 58 71 59 ////////////////////////////////////////////////////////////////////////////////// 72 // This structure is used by the CMA component to move a stream 73 // of packet containers between the NIC component an a chbuf containing74 // a variable number of buffers in kernel space.60 // This structure is used by the CMA component to move a stream of containers 61 // between the NIC chbuf containing 2 buffers, and a kernel chbuf 62 // containing (X_SIZE * Y_SIZE) buffers (one buffer per cluster). 75 63 // The same structure is used for both TX or RX transfers. 76 64 // It must be 64 bytes aligned. 77 // The single buffer size and the number of buffers must be defined by the78 // GIET_NIC_BUFSIZE and GIET_NIC_NBUFS parameters in giet_config.h.79 // - The buffer array implements the chbuf, and is concurently accessed80 // by the CMA component and by the kernel code.81 // - The lock must be taken by the kernel code, because several user tasks82 // can concurently try to consume buffers in the chbuf.83 // - The index is only used by the kernel, and define the currently pointed84 // buffer for read (RX transfer) or write (TX transfer).85 65 ////////////////////////////////////////////////////////////////////////////////// 86 66 87 67 typedef struct nic_chbuf_s 88 68 { 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 69 buffer_descriptor_t buffer[X_SIZE*Y_SIZE]; // kernel chbuf 93 70 } nic_chbuf_t; 94 95 71 96 72 //////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.