Commit 4d8e2f13 authored by Christoph Muellner's avatar Christoph Muellner Committed by Anup Patel
Browse files

lib: sbi: Replace test-and-set locks by ticket locks



Replace the test-and-set spinlock implementation with ticket locks
in order to get fairness (in form of FIFO order).

The implementation uses a 32-bit wide struct, which consists of
two 16-bit counters (owner and next). This is inspired by similar
spinlock implementations on other architectures.
This allows that the code works for both, RV32 and RV64.

Signed-off-by: default avatarChristoph Muellner <cmuellner@linux.com>
Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
Reviewed-by: default avatarXiang W <wxjstz@126.com>
parent d0e406fa
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment