lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Misalignment problems on PowerPC (little endian mode)


From: Timmy Brolin
Subject: Re: [lwip-users] Misalignment problems on PowerPC (little endian mode)
Date: Sat, 24 May 2008 22:28:38 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)


I have the source which can be compiled if the option LWIP_MISALIGNMENT is set to 1. If anyone interested and have the same problem, I am more than willing to share and help. If you guys want to incorporate it to lwip as alternative solution to structure packing I am glad I can help. This lowers the stack performance a bit though.


Not to offend you, but personally, I see this as a bug in the compiler you are using and we don't support broken compilers: structure packing _is_ a must for lwIP!

Hope you are still having fun with lwIP!

Simon

Actually, no. Structure packing is not necessarily a must for lwip.
In many cases lwip should work just fine without structure packing. I know that Texas Instruments DSP compilers will work with lwip without structure packing. Patches made to lwip several years ago ensured that if ETH_PAD_SIZE is set to 2, then no variable will ever be unaligned. This solves most of the problems which would otherwise require structure packing.

There are two things a compiler may do which will still mess up the lwip structs: 1: Some compilers pad the size of all structs so that the size of a struct becomes a multiple of 4. 2: Some comiplers put all structs on an address boundary of 4, regardless of the actual boundary requirements of the members of the struct. Compilers which does any of the above would still require packed structs. Compilers which does neither of the above should work without packed structs, if ETH_PAD_SIZE is set to 2.

Regards,
Timmy Brolin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]