File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -74,10 +74,18 @@ impl<System: Kernel> InterruptLine<System> {
74
74
/// [a managed range]: crate::kernel::Port::MANAGED_INTERRUPT_PRIORITY_RANGE
75
75
pub fn set_priority (
76
76
self ,
77
- _value : InterruptPriority ,
77
+ value : InterruptPriority ,
78
78
) -> Result < ( ) , SetInterruptLinePriorityError > {
79
79
let _lock = utils:: lock_cpu :: < System > ( ) ?;
80
- todo ! ( )
80
+
81
+ // Deny unmanaged priority
82
+ if !System :: MANAGED_INTERRUPT_PRIORITY_RANGE . contains ( & value) {
83
+ return Err ( SetInterruptLinePriorityError :: BadParam ) ;
84
+ }
85
+
86
+ // Safety: (1) We are the kernel, so it's okay to call `Port`'s methods.
87
+ // (2) CPU Lock active
88
+ unsafe { System :: set_interrupt_line_priority ( self . 0 , value) }
81
89
}
82
90
83
91
/// Set the priority of the interrupt line without checking if the new
You can’t perform that action at this time.
0 commit comments