lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Struct packing/alignment problems


From: K.J. Mansley
Subject: RE: [lwip-users] Struct packing/alignment problems
Date: 05 May 2004 08:35:48 +0100

On Wed, 2004-05-05 at 04:44, Chris Jones wrote:
> For many DSPs, structure field alignment is only part of the problem.
> 
> The C5500 family from TI and the Analog Devices SHARC family can't 
> run LWIP in it's released form because they lack byte addressing.
> 
> The compiler for the C55 defines a 'char' to be 16 bits. A 'char'
> on the SHARC is 32 bits.
> 
> The best solution for porting LWIP to a DSP that lacks byte addresssing
> is to redefine the header structures in terms of the native integer size
> and then extract the individual fields with macros in the source.

This would seem to be a much more serious, and difficult problem to
solve than the "packed" debate.  Systems with non-8-bit-bytes (they
still have byte addressing by definition btw: it's just the byte is not
8 bits) have been largely ignored in development as it's hard to find a
solution that is pleasing to both.

> The current release of LWI does this for most of the IP header, but 
> not the TCP header. In my port to the C55, I completed the implemetation
> of macros for TCP and got the stack running successfully.

That sounds like something we should definitely include, as we already
do it for IP, and it would make no difference to performance on
8-bit-byte systems.

> However, the LWIp code also uses byte pointers and byte pointer 
> arithmetic and this code also has to be modified.

That's a tougher one.  I'm sure you've described the changes required
before, but could you summarise here?  (Perhaps give a small example of
the changes?)

Thanks

Kieran





reply via email to

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