kernel: re-implement sending handles via port messages
This commit is contained in:
@@ -22,6 +22,38 @@ typedef __aligned(8) ml_hwlock_t spin_lock_t;
|
||||
#define spin_unlock_irqrestore(lck, flags) \
|
||||
ml_hwlock_unlock_irqrestore(lck, flags);
|
||||
|
||||
static inline void spin_lock_pair_irqsave(
|
||||
spin_lock_t *a,
|
||||
spin_lock_t *b,
|
||||
unsigned long *flags)
|
||||
{
|
||||
if (a == b) {
|
||||
spin_lock_irqsave(a, flags);
|
||||
} else if (a < b) {
|
||||
spin_lock_irqsave(a, flags);
|
||||
spin_lock(b);
|
||||
} else {
|
||||
spin_lock_irqsave(b, flags);
|
||||
spin_lock(a);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void spin_unlock_pair_irqrestore(
|
||||
spin_lock_t *a,
|
||||
spin_lock_t *b,
|
||||
unsigned long flags)
|
||||
{
|
||||
if (a == b) {
|
||||
spin_unlock_irqrestore(a, flags);
|
||||
} else if (a < b) {
|
||||
spin_unlock(b);
|
||||
spin_unlock_irqrestore(a, flags);
|
||||
} else {
|
||||
spin_unlock(a);
|
||||
spin_unlock_irqrestore(b, flags);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user