Update image and Rust toolchain

This commit is contained in:
Zhang Junyang
2023-12-02 17:23:08 +08:00
committed by Tate, Hongliang Tian
parent 97323f612b
commit 12d01ca1e4
24 changed files with 69 additions and 72 deletions

View File

@ -55,7 +55,7 @@ pub(crate) fn callback_init() {
crate::arch::x86::kernel::pic::allocate_irq(4).unwrap()
} else {
let irq = IrqLine::alloc().unwrap();
let mut io_apic = IO_APIC.get().unwrap().get(0).unwrap().lock();
let mut io_apic = IO_APIC.get().unwrap().first().unwrap().lock();
io_apic.enable(4, irq.clone()).unwrap();
irq
};

View File

@ -102,7 +102,7 @@ fn init_periodic_mode() {
let mut apic_lock = APIC_INSTANCE.get().unwrap().lock();
let mut irq = IrqLine::alloc_specific(super::TIMER_IRQ_NUM.load(Ordering::Relaxed)).unwrap();
irq.on_active(init_function);
let mut io_apic = IO_APIC.get().unwrap().get(0).unwrap().lock();
let mut io_apic = IO_APIC.get().unwrap().first().unwrap().lock();
debug_assert_eq!(io_apic.interrupt_base(), 0);
io_apic.enable(2, irq.clone()).unwrap();
drop(io_apic);
@ -133,7 +133,7 @@ fn init_periodic_mode() {
return;
}
}
let mut io_apic = IO_APIC.get().unwrap().get(0).unwrap().lock();
let mut io_apic = IO_APIC.get().unwrap().first().unwrap().lock();
io_apic.disable(2).unwrap();
drop(io_apic);
// stop APIC Timer, get the number of tick we need

View File

@ -34,7 +34,7 @@ fn iter_range(range: Range<usize>) {
let mut io_apic = if is_ioapic2 {
io_apics.get(1).unwrap().lock()
} else {
io_apics.get(0).unwrap().lock()
io_apics.first().unwrap().lock()
};
let mut device_count = 0;
while current > range.start {

View File

@ -68,7 +68,7 @@ impl PciDeviceLocation {
/// Returns an iterator that enumerates all possible PCI device locations.
pub fn all() -> impl Iterator<Item = PciDeviceLocation> {
iter::from_generator(|| {
iter::from_coroutine(|| {
for bus in Self::MIN_BUS..=Self::MAX_BUS {
for device in Self::MIN_DEVICE..=Self::MAX_DEVICE {
for function in Self::MIN_FUNCTION..=Self::MAX_FUNCTION {

View File

@ -1,13 +1,12 @@
//! The framework part of Asterinas.
#![feature(alloc_error_handler)]
#![feature(const_maybe_uninit_zeroed)]
#![feature(const_mut_refs)]
#![feature(const_ptr_sub_ptr)]
#![feature(const_trait_impl)]
#![feature(core_intrinsics)]
#![feature(coroutines)]
#![feature(fn_traits)]
#![feature(generators)]
#![feature(iter_from_generator)]
#![feature(iter_from_coroutine)]
#![feature(let_chains)]
#![feature(negative_impls)]
#![feature(new_uninit)]

View File

@ -96,7 +96,9 @@ impl WaitQueue {
return Some(res);
};
if let Some(ref timer_callback) = timer_callback && timer_callback.is_expired() {
if let Some(ref timer_callback) = timer_callback
&& timer_callback.is_expired()
{
return None;
}

View File

@ -1,4 +1 @@
pub mod recycle_allocator;
mod type_map;
pub use self::type_map::TypeMap;

View File

@ -1,26 +0,0 @@
/// A type map is a collection whose keys are types, rather than values.
pub struct TypeMap {}
pub trait Any: core::any::Any + Send + Sync {}
impl TypeMap {
/// Creates an empty typed map.
pub fn new() -> Self {
todo!()
}
/// Inserts a new item of type `T`.
pub fn insert<T: Any>(&mut self, val: T) -> Option<T> {
todo!()
}
/// Gets an item of type `T`.
pub fn get<T: Any>(&self) -> Option<&T> {
todo!()
}
/// Gets an item of type `T`.
pub fn remove<T: Any>(&self) -> Option<T> {
todo!()
}
}