Skip to content

Commit

Permalink
[ev] E: Fail Support for Event Manager Init
Browse files Browse the repository at this point in the history
  • Loading branch information
ppenna committed Aug 11, 2024
1 parent 21b519d commit 408aaf6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/event/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ fn exception_handler(info: &ExceptionInformation, _ctx: &ContextInformation) {
}
}

pub fn init(hal: &mut Hal) {
pub fn init(hal: &mut Hal) -> Result<(), Error> {
let mut pending_interrupts: [LinkedList<EventDescriptor>; usize::BITS as usize] =
unsafe { mem::zeroed() };
for list in pending_interrupts.iter_mut() {
Expand Down Expand Up @@ -804,4 +804,6 @@ pub fn init(hal: &mut Hal) {
Err(e) => warn!("failed to register interrupt handler: {:?}", e),
}
}

Ok(())
}
5 changes: 3 additions & 2 deletions src/event/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::hal::Hal;
// Exports
//==================================================================================================

use ::error::Error;
pub use kcall::*;
pub use manager::{
EventManager,
Expand All @@ -28,6 +29,6 @@ pub use manager::{
// Standalone Functions
//==================================================================================================

pub fn init(hal: &mut Hal) {
manager::init(hal);
pub fn init(hal: &mut Hal) -> Result<(), Error> {
manager::init(hal)
}
4 changes: 3 additions & 1 deletion src/kcall/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ use ::sys::{
/// Kernel call handler.
///
pub fn kcall_handler(mut hal: Hal, mut mm: VirtMemoryManager, mut pm: ProcessManager) {
event::init(&mut hal);
if let Err(e) = event::init(&mut hal) {
panic!("failed to initialize event manager: {:?}", e);
}

loop {
// Read kernel call arguments from the scoreboard.
Expand Down

0 comments on commit 408aaf6

Please sign in to comment.