diff --git a/Cargo.lock b/Cargo.lock index b1e4315..cb6c53f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,15 +68,6 @@ dependencies = [ "riscv-rt-macros", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] - [[package]] name = "lock_api" version = "0.4.12" @@ -181,7 +172,6 @@ dependencies = [ "fast-trap", "hpm-metapac", "hpm-rt", - "lazy_static", "riscv 0.10.1", "riscv-decode", "rustsbi", diff --git a/Cargo.toml b/Cargo.toml index bff9481..8c910a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,6 @@ riscv = "0.10" spin = "0.9" fast-trap = { version = "0.0.1", features = ["riscv-m"] } riscv-decode = "0.2.1" -lazy_static = { version = "1.5.0", features = ["spin_no_std"] } [build-dependencies] hpm-rt = { git = "https://github.com/hpm-rs/hpm-rt.git", rev = "66ffb7d7a65d7251d0b47db9599d36cefc4d6703" } diff --git a/src/extension.rs b/src/extension.rs index cc6b1d7..b17581f 100644 --- a/src/extension.rs +++ b/src/extension.rs @@ -1,4 +1,5 @@ use rustsbi::RustSBI; +use spin::Lazy; use crate::board::{board_init_timer, MachineTimer}; @@ -8,10 +9,6 @@ pub struct FixedRustSBI { pub timer: MachineTimer, } -lazy_static! { - pub static ref SBI: FixedRustSBI = { - FixedRustSBI { - timer: board_init_timer(), - } - }; -} +pub static SBI: Lazy = Lazy::new(|| FixedRustSBI { + timer: board_init_timer(), +}); diff --git a/src/main.rs b/src/main.rs index e3235b1..76e4dc5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,9 +3,6 @@ #![feature(naked_functions, asm_const)] #![deny(warnings)] -#[macro_use] -extern crate lazy_static; - mod board; mod extension; mod loader;