Changeset 493
- Timestamp:
- Aug 22, 2018, 11:56:33 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_nic.c
r492 r493 127 127 cont_id = chbuf->cont_id; 128 128 129 if( chbuf->full[cont_id] == 0 ) // container empty 130 { 131 printk("PANIC in %s : read an empty container\n", __FUNCTION__ ); 132 hal_core_sleep(); 133 } 129 assert( chbuf->full[cont_id] == 0 , "Read an empty container\n" ); 134 130 135 131 // get pointer on container and header … … 145 141 npackets = header[0]; 146 142 147 if( pkt_id >= npackets ) // packet index too large 148 { 149 printk("PANIC in %s : read a non readable container\n", __FUNCTION__ ); 150 hal_core_sleep(); 151 } 143 assert( pkt_id >= npackets, 144 "Read a non readable container, packet index too large\n"); 152 145 153 146 // move the packet from container to buffer … … 169 162 word_id = chbuf->word_id; 170 163 171 if( chbuf->full[cont_id] != 0 ) // container full 172 { 173 printk("PANIC in %s : write to a full container\n", __FUNCTION__ ); 174 hal_core_sleep(); 175 } 164 assert( chbuf->full[cont_id] != 0, "Write to a full container\n" ); 176 165 177 166 // get pointer on container and header … … 179 168 header = (uint16_t *)container; 180 169 181 if( length > ((1024 - word_id)<<2) ) // packet length too large 182 { 183 printk("PANIC in %s : write to a non writable container\n", __FUNCTION__ ); 184 hal_core_sleep(); 185 } 170 assert( length > ((1024 - word_id) << 2), 171 "Write to a non writable container, packet length too large\n"); 186 172 187 173 // update packet length in container header … … 309 295 uint32_t status = hal_remote_lw( XPTR( cxy_nic , offset ) ); 310 296 311 if( status != 0 ) hal_core_sleep("%s : illegal address\n", __FUNCTION__);312 297 assert( status != 0, "Illegal address: \n" ); 298 313 299 // unblock server thread 314 300 thread_t * server = chdev->server;
Note: See TracChangeset
for help on using the changeset viewer.