Skip to content

Spinlock Library with potential Deadlock Detection Feature #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ members = [
"realm/rsi-test",
"rmm/",
"sdk",
"model-checking",
"model-checking", "lib/spinlock",
]

[profile.dev]
Expand Down
14 changes: 14 additions & 0 deletions lib/spinlock/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "spinlock"
version = "0.1.0"
edition = "2021"

[dependencies]
lazy_static = "1.4.0"
spin = "0.9"
armv9a = { path = "../armv9a" }

[features]
#default = []
deadlock_test = []
p_deadlock_test = []
22 changes: 22 additions & 0 deletions lib/spinlock/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Usage of the library :

use spinlock::spinlock
use spinlock::Spinlock
use spinlock::SpinlockGuard

## Locking mechanism :

1. lock() - works as normal lock function
2. lock_(RMI_ID) - takes RMI Interface Number of the interface holding the lock as argument

## Conditioanl compilation feature :

add " --deadlock-test " in the command line argumrnt for Real Time Deadlock Test
add " --deadlock-test --p-deadlock-test " in the command line for Potential Deadlock Test (runs with much overhead)

## APIS for potential deadlock analysis

1. spinlock::checkdeadlock() - checks for potential deadlock with the best possible analysis
2. spinlock::checkdeadlock_weak() - checks for potentail deadlock with weaker analysis

(use spinlock::spinlock must be included)
2 changes: 2 additions & 0 deletions lib/spinlock/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#![no_std]
pub mod spinlock;
Loading