lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] lwipopts.h, SYS_LIGHTWEIGHT_PROT ?


From: Goldschmidt Simon
Subject: RE: [lwip-users] lwipopts.h, SYS_LIGHTWEIGHT_PROT ?
Date: Tue, 3 Apr 2007 08:39:16 +0200

Hi Bilahari,

>I want to know why there is need for two files lwipopts.h , opts.h.
>They look redundant.

opt.h defines what can be configured and a standard option for this.
lwipopts.h is for the user to configure the stack. The two file are
needed because the options are tested using #if LWIP_XXX, which means
they _must_ exist (in contrast to #ifdef). If opt.h was not included,
nobody would know all the existing options...


>SYS_LIGHTWEIGHT_PROT exactly means ?.

Hm, we don't really know that ourselves (the developers)... We were
talking about it and thinking about throwing away that option (making =1
the default)

>When you say LIGHTWEIGHT port do you mean Operating System presence or
no Operating system presence?

That doesn't really depen on an OS. In some places, LIGHTWEIGHT=0 means
semaphores (and you should have an OS for that), in other places it
means no protection at all. Using LIGHTWEIGHT, protection is done by
disabeling interrupts. This way, even if you don't have an OS and
receive packets in interrupt context, you can protect for example the
pbuf or memp pools.

In the current implementation, if you have an OS or using interrupts to
receive packets (in contrast to polling the ethernet hardware) you MUST
set SYS_LIGHTWEIGHT_PROT to 1, or else the pbuf pool can get corrupted.

Simon




reply via email to

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