Add a runtime check for scheduler with spin locks

This commit is contained in:
Chuandong Li
2023-07-25 10:18:20 +08:00
committed by Tate, Hongliang Tian
parent 08f50ac085
commit 9cb759efa2
12 changed files with 170 additions and 177 deletions

View File

@ -38,11 +38,11 @@ impl IfaceCommon {
}
}
pub(super) fn interface(&self) -> SpinLockIrqDisabledGuard<smoltcp::iface::Interface> {
pub(super) fn interface(&self) -> SpinLockGuard<smoltcp::iface::Interface> {
self.interface.lock_irq_disabled()
}
pub(super) fn sockets(&self) -> SpinLockIrqDisabledGuard<smoltcp::iface::SocketSet<'static>> {
pub(super) fn sockets(&self) -> SpinLockGuard<smoltcp::iface::SocketSet<'static>> {
self.sockets.lock_irq_disabled()
}

View File

@ -65,11 +65,11 @@ mod internal {
pub trait IfaceInternal {
fn common(&self) -> &IfaceCommon;
/// The inner socket set
fn sockets(&self) -> SpinLockIrqDisabledGuard<SocketSet<'static>> {
fn sockets(&self) -> SpinLockGuard<SocketSet<'static>> {
self.common().sockets()
}
/// The inner iface.
fn iface_inner(&self) -> SpinLockIrqDisabledGuard<smoltcp::iface::Interface> {
fn iface_inner(&self) -> SpinLockGuard<smoltcp::iface::Interface> {
self.common().interface()
}
/// The time we should do another poll.

View File

@ -18,7 +18,7 @@ pub(crate) use core::ffi::CStr;
pub(crate) use int_to_c_enum::TryFromInt;
pub(crate) use jinux_frame::config::PAGE_SIZE;
// pub(crate) use jinux_frame::sync::{Mutex, MutexGuard};
pub(crate) use jinux_frame::sync::{SpinLock, SpinLockGuard, SpinLockIrqDisabledGuard};
pub(crate) use jinux_frame::sync::{SpinLock, SpinLockGuard};
pub(crate) use jinux_frame::vm::Vaddr;
pub(crate) use jinux_frame::{print, println};
pub(crate) use log::{debug, error, info, trace, warn};