diff --git a/kernel/src/event.rs b/kernel/src/event.rs index 4ae1d6f36..68931f513 100644 --- a/kernel/src/event.rs +++ b/kernel/src/event.rs @@ -79,18 +79,18 @@ pub trait Waitable: Debug { /// /// Allows waiting on multiple Waitables at the same time. #[derive(Debug)] -pub struct MultiWaiter<'WAIT> { - waitable: &'WAIT [&'WAIT Waitable] +pub struct MultiWaiter<'wait> { + waitable: &'wait [&'wait Waitable] } -impl<'WAIT> MultiWaiter<'WAIT> { - pub fn new(arr: &'WAIT [&'WAIT Waitable]) -> MultiWaiter<'WAIT> { +impl<'wait> MultiWaiter<'wait> { + pub fn new(arr: &'wait [&'wait Waitable]) -> MultiWaiter<'wait> { MultiWaiter { waitable: arr } } - pub fn wait(&self) -> &'WAIT Waitable { + pub fn wait(&self) -> &'wait Waitable { loop { // Early-check for events that have already been signaled. for item in self.waitable { diff --git a/kernel/src/i386/structures/idt.rs b/kernel/src/i386/structures/idt.rs index 0fe79b8ba..6bfc51f13 100644 --- a/kernel/src/i386/structures/idt.rs +++ b/kernel/src/i386/structures/idt.rs @@ -360,10 +360,12 @@ pub struct Idt { pub interrupts: [IdtEntry; 256 - 32], } +const_assert_eq!(const_assert_idt; mem::size_of::(), 256 * 8); + + impl Idt { /// Creates a new IDT filled with non-present entries. pub fn init(&mut self) { - debug_assert_eq!(mem::size_of::(), 256 * 8); self.divide_by_zero = IdtEntry::missing(); self.debug = IdtEntry::missing(); self.non_maskable_interrupt = IdtEntry::missing(); @@ -463,7 +465,7 @@ impl IndexMut for Idt { /// The generic parameter can either be `HandlerFunc` or `HandlerFuncWithErrCode`, depending /// on the interrupt vector. #[derive(Debug, Clone, Copy)] -#[repr(C, packed)] +#[repr(C)] pub struct IdtEntry { pointer_low: u16, gdt_selector: u16, @@ -473,6 +475,9 @@ pub struct IdtEntry { phantom: PhantomData, } + +const_assert_eq!(const_assert_idtentry; mem::size_of::>(), 8); + /// A handler function for an interrupt or an exception without error code. pub type HandlerFunc = extern "x86-interrupt" fn(&mut ExceptionStackFrame); /// A handler function for an exception that pushes an error code. diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 68332619a..7b4970fd0 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -64,6 +64,9 @@ mod io; mod devices; mod sync; +// Make rust happy about rust_oom being no_mangle... +pub use heap_allocator::rust_oom; + #[global_allocator] static ALLOCATOR: heap_allocator::Allocator = heap_allocator::Allocator::new();