mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-28 20:03:22 +00:00
Replace the CpuLocal
's borrow*
APIs with get_with
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
f7a9510be0
commit
54cbacb2ff
@ -35,7 +35,8 @@ static APIC_TYPE: Once<ApicType> = Once::new();
|
||||
/// });
|
||||
/// ```
|
||||
pub fn borrow<R>(f: impl FnOnce(&mut (dyn Apic + 'static)) -> R) -> R {
|
||||
let apic_guard = APIC_INSTANCE.borrow_irq_disabled();
|
||||
let irq_guard = crate::trap::disable_local();
|
||||
let apic_guard = APIC_INSTANCE.get_with(&irq_guard);
|
||||
|
||||
// If it is not initialzed, lazily initialize it.
|
||||
if !apic_guard.is_completed() {
|
||||
|
Reference in New Issue
Block a user