kernel: sychronize irq_offload() access
Entering irq_offload() on multiple CPUs can cause difficult to debug/reproduce crashes. Demote irq_offload() to non-inline (it never needed to be inline anyway) and wrap the arch call in a semaphore. Some tests which were unnecessarily killing threads have been fixed; these threads exit by themselves anyway and we won't leave the semaphore dangling. The definition of z_arch_irq_offload() moved to arch_interface.h as it only gets called by kernel C code. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
38216b100c
commit
e09a0255da
5 changed files with 16 additions and 14 deletions
|
@ -15,9 +15,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <arch/cpu.h>
|
||||
|
||||
#ifdef CONFIG_IRQ_OFFLOAD
|
||||
typedef void (*irq_offload_routine_t)(void *parameter);
|
||||
|
||||
/**
|
||||
* @brief Run a function in interrupt context
|
||||
*
|
||||
|
@ -30,10 +30,7 @@ extern "C" {
|
|||
* @param parameter Argument to pass to the function when it is run as an
|
||||
* interrupt
|
||||
*/
|
||||
static inline void irq_offload(irq_offload_routine_t routine, void *parameter)
|
||||
{
|
||||
arch_irq_offload(routine, parameter);
|
||||
}
|
||||
void irq_offload(irq_offload_routine_t routine, void *parameter);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue