Added lightweight protection. In coldfire this is implemented by disabling
interrupts. In unixsim this is implemented by using a mutex. Uses #define SYS_LIGHTWEIGHT_PROT to enable. It is enabled in coldfire by default, but disabled in unixsim. Fixes bug 2005 if you enable SYS_LIGHTWEIGHT_PROT. So the bug is closed.
This commit is contained in:
@@ -103,6 +103,14 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout);
|
||||
void sys_mbox_free(sys_mbox_t mbox);
|
||||
void sys_mbox_fetch(sys_mbox_t mbox, void **msg);
|
||||
|
||||
/* Critical Region Protection */
|
||||
/* These functions must be implemented in the sys_arch.c file.
|
||||
In some implementations they can provide a more light-weight protection
|
||||
mechanism than using semaphores. Otherwise semaphores can be used for
|
||||
implementation */
|
||||
u32_t sys_arch_protect(void);
|
||||
void sys_arch_unprotect(u32_t pval);
|
||||
|
||||
/* Thread functions. */
|
||||
void sys_thread_new(void (* thread)(void *arg), void *arg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user