Changeset 7c7184a in rtems for c/src/lib/libbsp/m68k/uC5282/network/network.c
- Timestamp:
- 02/01/05 15:12:55 (18 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 50fea8b
- Parents:
- 7a6d1a3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/m68k/uC5282/network/network.c
r7a6d1a3 r7c7184a 124 124 125 125 /* 126 * Allocate buffer descriptors 126 * Allocate buffer descriptors from (non-cached) on-chip static RAM 127 127 * Ensure 128-bit (16-byte) alignment 128 128 */ … … 130 130 mcf5282_bd_allocate(unsigned int count) 131 131 { 132 mcf5282BufferDescriptor_t *p;133 134 p = malloc((count * sizeof(mcf5282BufferDescriptor_t)) + 15, 0, M_NOWAIT);135 if (!p) 136 rtems_panic("FEC BD");137 if ((int) p & 0xF)138 p = (mcf5282BufferDescriptor_t *)((char *)p + (16 - ((int)p & 0xF)));132 extern char __SRAMBASE[]; 133 static mcf5282BufferDescriptor_t *bdp = (mcf5282BufferDescriptor_t *)__SRAMBASE; 134 mcf5282BufferDescriptor_t *p = bdp; 135 136 bdp += count; 137 if ((int)bdp & 0xF) 138 bdp = (mcf5282BufferDescriptor_t *)((char *)bdp + (16 - ((int)bdp & 0xF))); 139 139 return p; 140 140 } … … 303 303 { 304 304 struct mbuf *m, *n; 305 volatile mcf5282BufferDescriptor_t *txBd; 306 307 for (;;) { 308 if (sc->txBdActiveCount == 0) 309 return; 310 txBd = sc->txBdBase + sc->txBdTail; 311 rtems_cache_invalidate_multiple_data_lines(txBd, sizeof *txBd); 312 if ((txBd->status & MCF5282_FEC_TxBD_R) != 0) 313 return; 305 306 while ((sc->txBdActiveCount != 0) 307 && ((sc->txBdBase[sc->txBdTail].status & MCF5282_FEC_TxBD_R) == 0)) { 314 308 m = sc->txMbuf[sc->txBdTail]; 315 309 MFREE(m, n); … … 360 354 * Wait for packet if there's not one ready 361 355 */ 362 rtems_cache_invalidate_multiple_data_lines(rxBd, sizeof *rxBd);363 356 if ((status = rxBd->status) & MCF5282_FEC_RxBD_E) { 364 int chkCount=0 ;365 357 /* 366 358 * Clear old events. … … 374 366 * `if' above, and the clearing of the RXF bit in the EIR. 375 367 */ 376 for (;;) {368 while ((status = rxBd->status) & MCF5282_FEC_RxBD_E) { 377 369 rtems_event_set events; 378 370 int level; 379 380 rtems_cache_invalidate_multiple_data_lines(rxBd, sizeof *rxBd);381 if (((status = rxBd->status) & MCF5282_FEC_RxBD_E) == 0)382 break;383 371 384 372 rtems_interrupt_disable(level); … … 404 392 405 393 /* 406 * Invalidate the cache and push the packet up 394 * Invalidate the cache and push the packet up. 407 395 * The cache is so small that it's more efficient to just 408 396 * invalidate the whole thing unless the packet is very small.
Note: See TracChangeset
for help on using the changeset viewer.