x64: abstract: minor tweak to throws in arch_decode_irq_control_invocation
This commit is contained in:
parent
3935de8050
commit
a9e8518c1d
|
@ -14,7 +14,6 @@ begin
|
||||||
|
|
||||||
context Arch begin global_naming X64
|
context Arch begin global_naming X64
|
||||||
|
|
||||||
thm irq_control_inv_valid.simps arch_decode_irq_control_invocation_def
|
|
||||||
primrec arch_irq_control_inv_valid_real :: "arch_irq_control_invocation \<Rightarrow> 'a::state_ext state \<Rightarrow> bool"
|
primrec arch_irq_control_inv_valid_real :: "arch_irq_control_invocation \<Rightarrow> 'a::state_ext state \<Rightarrow> bool"
|
||||||
where
|
where
|
||||||
"arch_irq_control_inv_valid_real (IssueIRQHandlerIOAPIC irq dest_slot src_slot
|
"arch_irq_control_inv_valid_real (IssueIRQHandlerIOAPIC irq dest_slot src_slot
|
||||||
|
|
|
@ -67,18 +67,16 @@ definition
|
||||||
in doE
|
in doE
|
||||||
|
|
||||||
whenE (x > ucast maxIRQ) $ throwError (RangeError 0 (ucast maxIRQ));
|
whenE (x > ucast maxIRQ) $ throwError (RangeError 0 (ucast maxIRQ));
|
||||||
|
|
||||||
dest_slot \<leftarrow> lookup_target_slot cnode (data_to_cptr index) (unat depth);
|
|
||||||
ensure_empty dest_slot;
|
|
||||||
|
|
||||||
irq_active \<leftarrow> liftE $ is_irq_active irqv;
|
irq_active \<leftarrow> liftE $ is_irq_active irqv;
|
||||||
whenE irq_active $ throwError RevokeFirst;
|
whenE irq_active $ throwError RevokeFirst;
|
||||||
|
dest_slot \<leftarrow> lookup_target_slot cnode (data_to_cptr index) (unat depth);
|
||||||
|
ensure_empty dest_slot;
|
||||||
|
|
||||||
(* Following should be wrapped in to a funcion like what c did
|
(* Following should be wrapped in to a funcion like what c did
|
||||||
since it is pc99 related, problem is where to put this function*)
|
since it is pc99 related, problem is where to put this function*)
|
||||||
|
|
||||||
whenE (ioapic > numIOAPICs - 1) $ throwError (RangeError 0 numIOAPICs);
|
whenE (ioapic > numIOAPICs - 1) $ throwError (RangeError 0 (numIOAPICs-1));
|
||||||
whenE (pin > ioapicIRQLines - 1) $ throwError (RangeError 0 ioapicIRQLines);
|
whenE (pin > ioapicIRQLines - 1) $ throwError (RangeError 0 (ioapicIRQLines-1));
|
||||||
whenE (level > 1) $ throwError (RangeError 0 1);
|
whenE (level > 1) $ throwError (RangeError 0 1);
|
||||||
whenE (polarity > 1) $ throwError (RangeError 0 1);
|
whenE (polarity > 1) $ throwError (RangeError 0 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue