mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-09-20 15:21:42 +01:00
lib: sbi_scratch: add TSA annotations
Add Thread Safety Analysis (TSA) annotations for the scratch space implementation. This only consists of annotating that the extra_offset global must be accessed under the extra_lock spinlock. Signed-off-by: Carlos López <carlos.lopezr4096@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260909162322.29778-7-carlos.lopezr4096@gmail.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -21,7 +21,8 @@ u32 hartindex_to_hartid_table[SBI_HARTMASK_MAX_BITS] = { [0 ... SBI_HARTMASK_MAX
|
|||||||
struct sbi_scratch *hartindex_to_scratch_table[SBI_HARTMASK_MAX_BITS];
|
struct sbi_scratch *hartindex_to_scratch_table[SBI_HARTMASK_MAX_BITS];
|
||||||
|
|
||||||
static spinlock_t extra_lock = SPIN_LOCK_INITIALIZER;
|
static spinlock_t extra_lock = SPIN_LOCK_INITIALIZER;
|
||||||
static unsigned long extra_offset = SBI_SCRATCH_EXTRA_SPACE_OFFSET;
|
static unsigned long
|
||||||
|
extra_offset GUARDED_BY(&extra_lock) = SBI_SCRATCH_EXTRA_SPACE_OFFSET;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the alignment size.
|
* Get the alignment size.
|
||||||
|
|||||||
Reference in New Issue
Block a user