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

2021-11-15 Thread goldsi...@gmx.de
Am 15.11.2021 um 15:53 schrieb Grant Edwards: On 2021-11-15, Ajay Bhargav via lwip-users 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

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

2021-11-15 Thread Grant Edwards
On 2021-11-15, Ajay Bhargav via lwip-users wrote: > No, I am not assuming mutext required to be nested either. but I thought sys_arch_protect/unprotect are required to nest? > Infact my implementation had only simple lock unlock only. And as > far as I know, lwip do not use nesting of lock, as

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

2021-11-15 Thread Ajay Bhargav via lwip-users
No, I am not assuming mutext required to be nested either. Infact my implementation had only simple lock unlock only. And as far as I know, lwip do not use nesting of lock, as its obvious that not all system support recursion. And lev is usually common return value of isr flags when disable_irq or

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

2021-11-15 Thread Grant Edwards
On 2021-11-15, Ajay Bhargav via lwip-users wrote: > protect/unprotect is totally implementation dependent with only > intention of providing exclusive access to network related operation > to be performed without any context switching. You can do this by > using a mutext in simplest way Are you

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

2021-11-15 Thread Ajay Bhargav via lwip-users
protect/unprotect is totally implementation dependent with only intention of providing exclusive access to network related operation to be performed without any context switching. You can do this by using a mutext in simplest way but you have to make sure ISR do not do any operation either when sys

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

2021-11-15 Thread Grant Edwards
On 2021-11-15, Ajay Bhargav via lwip-users 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 a

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

2021-11-14 Thread Ajay Bhargav via lwip-users
sys_arch_protect() and sys_arch_unprotect() is always called in pairs with call order maintained. From rtos prospective, you can consider sys_arch_protect() as enter_critical_section() and sys_arch_unprotect() as exit_critical_section(). These calls might already be provided by rtos you're using.

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

2021-11-14 Thread Grant Edwards
A couple questions about sys_arch_protect/unprotect 1. Are protect/unprotect calls required to nest? 2. Does the level passed to unprotect() have to do something? I think I've found another instance where the original authors of my sys_arch.c implemented something that meets the requirements