Commit 176e2a4
drivers: hwspinlock: add zephyr spinlock per hwspinlock
HWSPINLOCK are used to protect accesses to shared resources between
clusters. However, we don't want to sleep or be preempted while holding
a HWSPINLOCK. This means we need to lock IRQs while holding the
HWSPINLOCK.
Moreover, in an SMP context, we need to protect accesses to a HWSPINLOCK
between cores, so it is not possible to lock or release the same
HWSPINLOCK multiple times.
Introduce a zephyr spinlock per HWSPINLOCK to counter those issues. User
facing APIs have been udpated to take into account those changes, and a new
hwspinlock_dt_spec struct has been added to align with other subsystem on
the management of complex device's data.
Take the opportunity to rename public APIs to match the naming scheme of
normal zephyr spinlocks:
hwspinlock_lock -> hw_spin_lock
hwspinlock_trylock -> hw_spin_trylock
hwspinlock_unlock -> hw_spin_unlock
Signed-off-by: Pierrick Guillaume <pguillaume@fymyte.com>1 parent 36e5672 commit 176e2a4
File tree
2 files changed
+303
-40
lines changed- drivers/hwspinlock
- include/zephyr/drivers
2 files changed
+303
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
0 commit comments