mirror of
https://github.com/drasko/codezero.git
synced 2026-02-26 08:43:13 +01:00
Added handling of task pending events from scheduler.
Previously all pending events were handled on return of exceptions in process context. This was causing threads that run in userspace and take no exceptions not handle their pending events indefinitely. Now scheduler handles them in irq context as well.
This commit is contained in:
@@ -39,19 +39,21 @@ static inline void spin_unlock(struct spinlock *s)
|
||||
* - To be used for synchronising against processes and irqs
|
||||
* on other cpus.
|
||||
*/
|
||||
static inline void spin_lock_irq(struct spinlock *s)
|
||||
static inline void spin_lock_irq(struct spinlock *s,
|
||||
unsigned long state)
|
||||
{
|
||||
irq_local_disable(); /* Even in UP an irq could deadlock us */
|
||||
irq_local_disable_save(&state);
|
||||
#if defined(CONFIG_SMP)
|
||||
__spin_lock(&s->lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void spin_unlock_irq(struct spinlock *s)
|
||||
static inline void spin_unlock_irq(struct spinlock *s,
|
||||
unsigned long state)
|
||||
{
|
||||
#if defined(CONFIG_SMP)
|
||||
__spin_unlock(&s->lock);
|
||||
#endif
|
||||
irq_local_enable();
|
||||
irq_local_restore(state);
|
||||
}
|
||||
#endif /* __LIB__SPINLOCK_H__ */
|
||||
|
||||
Reference in New Issue
Block a user