Mullanix, Todd wrote:
For my port to SYS/BIOS, I have NO_SYS=0 and I'm making sure the netif->input is
being called from a thread and not in the interrupt. So I think I'm adhering to the
rules of the game in my case. Note: I'll make the change to use netif->input.
Yeah, the NO_SYS=0 case looks, OK, I think: timers are handled
automatically by tcpip_thread and tcpip_input() is used for input packets.
My understanding of the NO_SYS=1 case was the same as Tim's. So as long as
nothing is done in main() or another interrupt, it should be fine since there
are no threads.
Well, if you see it that way, the port is OK. But it seems like Tim
calls tcp_write from main(). I know this is a point in lwIP which is not
as easy to understand and at least Tim (as a user of Stellarisware) got
it wrong resulting in some days of bug-hunting :-(
Also, having had a look at the code, I'm not sure at which point it
would be safe to call tcp_write with NO_SYS=1: there seems to be no
obvious way to call user code from the ethernet interrupt handler (which
is obviously the "lwip execution context" in your port for NO_SYS=1).
Note that this is only a problem for asynchronous writes. Server-writes
(like in the httpd) are either triggered by received packets or by lwIP
timers, so their execution context is always correct.
Simon
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users