[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Misalignment problems on PowerPC (little endian mode)
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-users] Misalignment problems on PowerPC (little endian mode) |
Date: |
Wed, 28 May 2008 12:47:13 +0200 |
Keep in mind that many MACs with DMA support cannot receive to unaligned
addresses! In that case, the two-byte-padding before the ethernet frame does
not work!
Simon
> It would work just fine since there are no unaligned accesses in lwip,
> assuming the two byte pad at the beginning of the 14byte ethernet frame
> has been enabled.
> The structure packing in lwip is really only there to prevent the
> compiler from inserting unnecessary padding. By "unnecessary padding" I
> mean padding which is not required in order to guarantee aligned accesses.
>
> I have used lwip on a processor which _will_ crash if there is a single
> unaligned access.
>
> Regards,
> Timmy Brolin
>
> Simon Goldschmidt wrote:
>
> >>#define FIELD1(A) (*((short int*)&A[0]))
> >>#define FIELD2(A) (*((long*)&A[2]))
> >>x=FIELD1(data); /* using field1 */
> >>
> >>
> >
> >I don't know how this should help: say A starts at 0x03, then accessing
> FIELD2 would still result in a long-pointer being accessed at 0x03+2 = 0x05.
> This is what will not work on most platforms.
> >
> >Simon
> >
> >
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode), (continued)
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode), Timmy Brolin, 2008/05/27
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode), Jonathan Larmour, 2008/05/27
- RE: [lwip-users] Misalignment problems on PowerPC (little endian mode), Muhamad Ikhwan Ismail, 2008/05/28
- RE: [lwip-users] Misalignment problems on PowerPC (little endian mode), Bill Auerbach, 2008/05/28
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode), Timmy Brolin, 2008/05/29
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode), Alain M., 2008/05/26
- RE: [lwip-users] Misalignment problems on PowerPC (little endian mode), Muhamad Ikhwan Ismail, 2008/05/27
- Re: RE: [lwip-users] Misalignment problems on PowerPC (little endian mode), Simon Goldschmidt, 2008/05/27
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode), Simon Goldschmidt, 2008/05/27
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode), Timmy Brolin, 2008/05/27
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode),
Simon Goldschmidt <=
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode), Timmy Brolin, 2008/05/29
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode), Alain M., 2008/05/30
- Re: [lwip-users] Misalignment problems on PowerPC (little endian mode), David Empson, 2008/05/25
- [lwip-users] Semaphore counter overflow after data transfer (lwip 1.3.0), Muhamad Ikhwan Ismail, 2008/05/20
- Re: [lwip-users] Semaphore counter overflow after data transfer (lwip 1.3.0), Kieran Mansley, 2008/05/20
- RE: [lwip-users] Semaphore counter overflow after data transfer (lwip 1.3.0), Muhamad Ikhwan Ismail, 2008/05/21