[Top][All Lists]

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

Re: [lwip-users] Are sys_arch_protect/unprotect required to nest?

From: Grant Edwards
Subject: Re: [lwip-users] Are sys_arch_protect/unprotect required to nest?
Date: Mon, 15 Nov 2021 14:53:55 -0000 (UTC)
User-agent: slrn/1.0.3 (Linux)

On 2021-11-15, Ajay Bhargav via lwip-users <lwip-users@nongnu.org> wrote:

> sys_arch_protect() and sys_arch_unprotect() is always called in
> pairs with call order maintained.

So the requirement stated in the documentation that

  SYS_ARCH_UNPROTECT Perform a "fast" set of the protection level to "lev".

is incorrect and the parameter passed to sys_arch_unprotect() may be

> From rtos prospective, you can consider sys_arch_protect() as
> enter_critical_section() and sys_arch_unprotect() as
> exit_critical_section().

That's only true if enter_critical_section() and
exit_critical_section() enforce nesting/paired calls.

> These calls might already be provided by rtos you're using.

They are, but they do not nest. In the uItron RTOS I'm using the "exit
critical section" function re-enables context switching no matter how
many times "enter critical section" has been called. I'm working on a
nesting equivalent.

Thanks much for the clarification.

Once I'm satisfied I understand the real requirements, I'll submit a
patch for the documentation. Hopefully that will avoid in the future
the problems created when the original authors of my sys_arch.c code
interpreted the existing documentation literally.


reply via email to

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