Merge branch 'post-08' into post-09

This commit is contained in:
Philipp Oppermann
2019-02-25 17:04:40 +01:00

View File

@@ -21,8 +21,13 @@ pub enum InterruptIndex {
}
impl InterruptIndex {
fn as_u8(self) -> u8 { self as u8 }
fn as_usize(self) -> usize { usize::from(self.as_u8()) }
fn as_u8(self) -> u8 {
self as u8
}
fn as_usize(self) -> usize {
usize::from(self.as_u8())
}
}
pub static PICS: spin::Mutex<ChainedPics> =
@@ -75,7 +80,10 @@ extern "x86-interrupt" fn double_fault_handler(
extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: &mut ExceptionStackFrame) {
print!(".");
unsafe { PICS.lock().notify_end_of_interrupt(InterruptIndex::Timer.as_u8()) }
unsafe {
PICS.lock()
.notify_end_of_interrupt(InterruptIndex::Timer.as_u8());
}
}
extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: &mut ExceptionStackFrame) {
@@ -101,5 +109,8 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: &mut Exceptio
}
}
unsafe { PICS.lock().notify_end_of_interrupt(InterruptIndex::Keyboard.as_u8()) }
unsafe {
PICS.lock()
.notify_end_of_interrupt(InterruptIndex::Keyboard.as_u8());
}
}