mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 17:03:23 +00:00
Refactor the API of spinlocks
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
0160a85ccd
commit
c44447d54b
@ -31,7 +31,8 @@ pub fn register_device(name: String, device: Arc<dyn AnyConsoleDevice>) {
|
||||
.get()
|
||||
.unwrap()
|
||||
.console_device_table
|
||||
.lock_irq_disabled()
|
||||
.disable_irq()
|
||||
.lock()
|
||||
.insert(name, device);
|
||||
}
|
||||
|
||||
@ -40,7 +41,8 @@ pub fn all_devices() -> Vec<(String, Arc<dyn AnyConsoleDevice>)> {
|
||||
.get()
|
||||
.unwrap()
|
||||
.console_device_table
|
||||
.lock_irq_disabled();
|
||||
.disable_irq()
|
||||
.lock();
|
||||
console_devs
|
||||
.iter()
|
||||
.map(|(name, device)| (name.clone(), device.clone()))
|
||||
|
Reference in New Issue
Block a user