This commit is contained in:
parent
e3ef4823b3
commit
c15febbef8
5 changed files with 7 additions and 4 deletions
|
@ -28,3 +28,5 @@ jobs:
|
|||
run: . ~/.bashrc && cargo install cargo-deny
|
||||
- name: Run cargo-deny
|
||||
run: . ~/.bashrc && cargo deny check
|
||||
- name: Run clippy
|
||||
run: . ~/.bashrc && cargo clippy -- -Dwarnings
|
||||
|
|
|
@ -57,7 +57,7 @@ pub fn set_cpu_flags() {
|
|||
}
|
||||
let lapic_id = increase_lock_count();
|
||||
let cpudata_ref = &CPUDATA[lapic_id].lock();
|
||||
let cpudata_ref: &CPUData = &cpudata_ref;
|
||||
let cpudata_ref: &CPUData = cpudata_ref;
|
||||
let cpudata_address = cpudata_ref as *const CPUData as u64;
|
||||
decrease_lock_count(lapic_id);
|
||||
unsafe {
|
||||
|
|
|
@ -63,7 +63,7 @@ extern "C" fn AcpiOsCreateSemaphore(max: UINT32, initial: UINT32, out: *mut *mut
|
|||
#[no_mangle]
|
||||
extern "C" fn AcpiOsDeleteLock(handle: *mut c_void) {
|
||||
unsafe {
|
||||
drop(Box::from_raw(handle));
|
||||
drop(Box::from_raw(handle as *mut RawSpinlock));
|
||||
}
|
||||
}
|
||||
#[no_mangle]
|
||||
|
|
|
@ -3,6 +3,7 @@ use lock_api::{GuardSend, Mutex, RawMutex};
|
|||
use super::sync::RawSpinlock;
|
||||
|
||||
unsafe impl RawMutex for RawSpinlock {
|
||||
#[allow(clippy::declare_interior_mutable_const)]
|
||||
const INIT: Self = RawSpinlock::new();
|
||||
type GuardMarker = GuardSend;
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ pub fn increase_lock_count() -> usize {
|
|||
if INTERRUPTS_SETUP.load(Ordering::SeqCst) {
|
||||
let lapic_id = get_current_lapic_id();
|
||||
LOCKS_HELD[lapic_id].fetch_add(1, Ordering::SeqCst);
|
||||
return lapic_id;
|
||||
lapic_id
|
||||
} else {
|
||||
return 0;
|
||||
0
|
||||
}
|
||||
}
|
||||
pub fn decrease_lock_count(lapic_id: usize) {
|
||||
|
|
Loading…
Add table
Reference in a new issue