]> xenbits.xensource.com Git - unikraft/unikraft.git/commit
lib/uklock: Provide irqf wrappers for uk_spinlock
authorSairaj Kodilkar <skodilkar7@gmail.com>
Tue, 31 Jan 2023 06:52:01 +0000 (12:22 +0530)
committerUnikraft <monkey@unikraft.io>
Sat, 13 May 2023 18:24:10 +0000 (18:24 +0000)
commitf205fee3da57c467ce1cf9cf33f88d529e79875b
tree8b117fd4c11f795ba4c8549e1b03415026441cb1
parentd073d652299d53509d059b60706eee236d5c0d10
lib/uklock: Provide irqf wrappers for uk_spinlock

Holding a spinlock which is required by an interrupt handler, causes a
deadlock. To avoid this, the programmer must disable the interrupt
before acquiring such spinlocks. This involves saving the interrupt
flags before acquiring the spinlock and restoring them after
releasing the spinlock.

This commit provides versions of the ukplat_spin_* macros for the
uk_spinlock.

Co-authored-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Signed-off-by: Sairaj Kodilkar <skodilkar7@gmail.com>
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Reviewed-by: Radu Nichita <radunichita99@gmail.com>
Reviewed-by: Andra Paraschiv <andra@unikraft.org>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #476
lib/uklock/include/uk/spinlock.h