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
ignored.

> 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.

--
Grant



_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to