[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] lwIP on DSPs
From: |
Adam Dunkels |
Subject: |
[lwip-users] Re: [lwip] lwIP on DSPs |
Date: |
Wed, 08 Jan 2003 22:21:03 -0000 |
Hi Bill!
On Friday 30 November 2001 20:49, you wrote:
> I'm new to this list and saw a post in the archives asking about
> attempts to port lwIP to a TMS320 DSP. Well, I just stopped work on
> a port of it to a TMS320LF2407. By far the most significant problem
> (the one that stopped me) is that at least this particular DSP has a
> 16 bit char. That specifically means that u16_t and u8_t are the
> same size. Consequently the assumption that two successive u8_t's
> can be singularly accessed and combined into a single u16_t is false.
> lwIP (and most other stacks) seem to rely upon this assumption pretty
> heavily.
> As an aside, the only stack I have found so far which seems to
> operate without major rework is CMX MicroNet.
It seems that the latest version of lwIP now works with a 16-bit u8_t type. I
haven't tested it thuroughly, only verified that it works with u8_t typedef'd
to a 16-bit "unsigned short". I think this would be a sufficient to say that
it works, but since I have no access to an actual system with an 8-bit char,
I cannot test it further. Does anyone have suggestion for testing it, or is
it enough to typedef the u8_t as a short?
There was surprisingly few changes that needed to be made. The protocol
headers need to be fixed so that all fields was of the 16-bit u16_t type, and
macros was added to access the fields. This applies to the ARP, IP and TCP
headers. Of course, the code that accessed the headers also had to be
modified. A small change to the IP checksum function was also needed.
You can download it from the homepage to review it, it you'd like. I'd very
much like to hear your comments on it.
/adam
--
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]