Skip to content

Commit

Permalink
Update redist_interface.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinaboos authored Sep 24, 2023
1 parent 538c4cc commit 8128191
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions kernel/gic/src/gic/redist_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,14 @@ impl RedistRegsSgiPpi {
/// Returns whether the given SGI (software generated interrupts) or
/// PPI (private peripheral interrupts) will be forwarded by the redistributor
pub fn get_sgippi_state(&self, int: InterruptNumber) -> Option<InterruptGroup> {
let enabled = read_array_volatile::<32>(&self.set_enable, int) == 1;
match enabled {
true => match read_array_volatile::<32>(&self.group, int) {
0 => Some(InterruptGroup::Group0),
1 => Some(InterruptGroup::Group1),
_ => unreachable!(),
},
false => None,
if read_array_volatile::<32>(&self.set_enable, int) == 1 {
match read_array_volatile::<32>(&self.group, int) {
0 => return Some(InterruptGroup::Group0),
1 => return Some(InterruptGroup::Group1),
_ => { }
}
}
None
}

/// Enables or disables the forwarding of a particular
Expand Down

0 comments on commit 8128191

Please sign in to comment.