I am working on porting lwIP into RTX-RTOS. In lwIP's "sys_arch.c" file, I need to implement functions to free up semaphores, mutexes and mailboxes. RTX-RTOS does not have any functions for this.
Since a mailbox is a pointer to a block of memory, can "_free_box" be used to free a mailbox?
How about for a semaphore or a mutex?
Thanks,
Willy
The legacy RTX4 does not allocate memory for OS objects (semaphores, mutex, mailbox) but rather leaves this to the user. Therefore explicit free functions are not needed and do not exist.
Semaphore example:
OS_SEM semaphore1; // typedef U32 OS_SEM[2]; __task void task1 (void) { .. os_sem_init (&semaphore1, 0); os_sem_send (&semaphore1); .. }
The user allocates the memory for semaphore control block and then just initializes it. Since there is no allocation done by RTX also a free is not needed.
It is similar for mutex and mailbox.