lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] RE: lwip-users Digest, Vol 7, Issue 11


From: Michael Anburaj
Subject: Re: [lwip-users] RE: lwip-users Digest, Vol 7, Issue 11
Date: Wed, 17 Mar 2004 14:23:32 -0800 (PST)

--- Eric Shufro <address@hidden> wrote:
> What is the deal with the uCOS port in sys_arch.c
> for this function?
> 
> struct sys_timeouts *
> sys_arch_timeouts(void)
> {
>     INT8S currPrio;
> 
>     currPrio = (OSPrioCur-LWIP_START_PRIO);
> 
>     if((currPrio < 0) || (currPrio >=
> LWIP_MAX_TASKS))
>     {
>         /* Error! */
>       printf("sys_arch_timeouts: Prio not found\n");
>         while(1);
> 
>     }
> 
>     return &timeoutlist[currPrio];
> }
> 
> OSPrioCur returns the priority of the currently
> running task. This function
> gets called indirectly from TASK 4, a startup task.
> Since making a new
> netconn, or setting up an interface requires some
> memory, the cascading of
> function calls ends up here.

Hi Eric,

The timeoutlist is only declared & created for the
tasks invoked using sys_thread_new. And any task
invoked using this API will have a priority between
LWIP_START_PRIO & (LWIP_START_PRIO+LWIP_MAX_TASKS),
which should escape the if statement in
sys_arch_timeouts().

It is a requirement that you create all tasks using
LwIP APIs through sys_thread_new(), then you won’t
have this problem. One bad thing is that you cannot
specify the task priority or the stack size for these
tasks. Which, can be worked around by creating a API
similar to sys_thread_new(), with extra parameters.

Hope this help,
-Mike.


__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com




reply via email to

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