forked from Imagelibrary/rtems
2000-11-13 Jiri Gaisler <jgais@ws.estec.esa.nl>
* network/sonic.c: Added ipalign() routine to align the received packet so that the ip header is on a 32-bit boundary. Necessary for cpu's that do not allow unaligned loads and stores and when the 32-bit DMA mode is used.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2000-11-13 Jiri Gaisler <jgais@ws.estec.esa.nl>
|
||||
|
||||
* network/sonic.c: Added ipalign() routine to align the
|
||||
received packet so that the ip header is on a 32-bit boundary.
|
||||
Necessary for cpu's that do not allow unaligned loads and stores
|
||||
and when the 32-bit DMA mode is used.
|
||||
|
||||
2000-11-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||
|
||||
* Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS.
|
||||
|
||||
@@ -887,6 +887,40 @@ SONIC_STATIC void sonic_rda_wait(
|
||||
|
||||
}
|
||||
|
||||
#ifdef CPU_U32_FIX
|
||||
|
||||
/*
|
||||
* Routine to align the received packet so that the ip header
|
||||
* is on a 32-bit boundary. Necessary for cpu's that do not
|
||||
* allow unaligned loads and stores and when the 32-bit DMA
|
||||
* mode is used.
|
||||
*
|
||||
* Transfers are done on word basis to avoid possibly slow byte
|
||||
* and half-word writes.
|
||||
*/
|
||||
|
||||
void ipalign(struct mbuf *m)
|
||||
{
|
||||
unsigned int *first, *last, data;
|
||||
unsigned int tmp = 0;
|
||||
|
||||
if ((((int) m->m_data) & 2) && (m->m_len)) {
|
||||
last = (unsigned int *) ((((int) m->m_data) + m->m_len + 8) & ~3);
|
||||
first = (unsigned int *) (((int) m->m_data) & ~3);
|
||||
tmp = *first << 16;
|
||||
first++;
|
||||
do {
|
||||
data = *first;
|
||||
*first = tmp | (data >> 16);
|
||||
tmp = data << 16;
|
||||
first++;
|
||||
} while (first <= last);
|
||||
|
||||
m->m_data = (caddr_t)(((int) m->m_data) + 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* SONIC reader task
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user