Other Parts Discussed in Thread: HALCOGEN
Here is piece from HalCoGen generated EMAC driver (TMS570LC4357):
void EMACReceive(hdkif_t *hdkif) { ... curr_tail->next = (emac_rx_bd_t *)EMACSwizzleData((uint32)rxch_int->free_head);
... last_bd->next = NULL;
But it have possible race condition. It add new pieces into end of RX buffer descriptor chain. Problem is that it add UNTERMINATED chain part and terminate if AFTER. This contain possible race condition when MAC controller is faster than SW (SW can be interrupted by something more significant)