lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] IP header alignment problems


From: address@hidden
Subject: Re: [lwip-devel] IP header alignment problems
Date: Wed, 13 Jan 2010 16:24:20 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

Małowidzki, Marek wrote:
Question: is any other approach possible? We would like to avoid modifications to LwIP (i.e., make necessary changes as small as possible). Maybe compiler hints that "this particular double word may be improperly aligned so generate slower but more flexible code" or so?
Well, normally this is what structure packing is used for: the compiler genereates 4 byte-reads to read an u32_t and shifts these bytes to compose the u32_t in a register. Doesn't that work with your compiler, too? Nowadays, nearly every architecture (at least for embedded devices) (except for x86) is limited in such way that data must be aligned.

Simon




reply via email to

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