aspec: arch split on invokeIRQHandler
The RISCV implementation of invokeIRQHandler calls plic_complete_claim instead of maskInterrupt. plicCompleteClaim is added as a machine op and invokeIRQHandler has been arch split for the ACKIrq case. Signed-off-by: Victor Phan <Victor.Phan@data61.csiro.au>
This commit is contained in:
parent
877c667877
commit
461a798412
|
@ -18,5 +18,10 @@ begin
|
||||||
definition handle_reserved_irq :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
|
definition handle_reserved_irq :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
|
||||||
where "handle_reserved_irq irq = return ()"
|
where "handle_reserved_irq irq = return ()"
|
||||||
|
|
||||||
|
fun arch_invoke_irq_handler :: "irq_handler_invocation \<Rightarrow> (unit,'z::state_ext) s_monad"
|
||||||
|
where
|
||||||
|
"arch_invoke_irq_handler (ACKIrq irq) = (do_machine_op $ maskInterrupt False irq)"
|
||||||
|
| "arch_invoke_irq_handler _ = return ()"
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -87,6 +87,11 @@ where
|
||||||
else if irq_vppi_event_index irq \<noteq> None then vppi_event irq
|
else if irq_vppi_event_index irq \<noteq> None then vppi_event irq
|
||||||
else return ()"
|
else return ()"
|
||||||
|
|
||||||
|
fun arch_invoke_irq_handler :: "irq_handler_invocation \<Rightarrow> (unit,'z::state_ext) s_monad"
|
||||||
|
where
|
||||||
|
"arch_invoke_irq_handler (ACKIrq irq) = (do_machine_op $ maskInterrupt False irq)"
|
||||||
|
| "arch_invoke_irq_handler _ = return ()"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ slot. The IRQHandler operations load or clear those capabilities.\<close>
|
||||||
fun
|
fun
|
||||||
invoke_irq_handler :: "irq_handler_invocation \<Rightarrow> (unit,'z::state_ext) s_monad"
|
invoke_irq_handler :: "irq_handler_invocation \<Rightarrow> (unit,'z::state_ext) s_monad"
|
||||||
where
|
where
|
||||||
"invoke_irq_handler (ACKIrq irq) = (do_machine_op $ maskInterrupt False irq)"
|
"invoke_irq_handler (ACKIrq irq) = arch_invoke_irq_handler (ACKIrq irq)"
|
||||||
| "invoke_irq_handler (SetIRQHandler irq cap slot) = (do
|
| "invoke_irq_handler (SetIRQHandler irq cap slot) = (do
|
||||||
irq_slot \<leftarrow> get_irq_slot irq;
|
irq_slot \<leftarrow> get_irq_slot irq;
|
||||||
cap_delete_one irq_slot;
|
cap_delete_one irq_slot;
|
||||||
|
|
|
@ -10,8 +10,17 @@ theory ArchInterrupt_A
|
||||||
imports "../Ipc_A"
|
imports "../Ipc_A"
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
context begin interpretation Arch .
|
||||||
|
|
||||||
definition handle_reserved_irq :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
|
definition handle_reserved_irq :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
|
||||||
where
|
where
|
||||||
"handle_reserved_irq irq = return ()"
|
"handle_reserved_irq irq = return ()"
|
||||||
|
|
||||||
|
fun arch_invoke_irq_handler :: "irq_handler_invocation \<Rightarrow> (unit,'z::state_ext) s_monad"
|
||||||
|
where
|
||||||
|
"arch_invoke_irq_handler (ACKIrq irq) = (do_machine_op $ plic_complete_claim irq)"
|
||||||
|
| "arch_invoke_irq_handler _ = return ()"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -18,5 +18,10 @@ begin
|
||||||
definition handle_reserved_irq :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
|
definition handle_reserved_irq :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
|
||||||
where "handle_reserved_irq irq = return ()"
|
where "handle_reserved_irq irq = return ()"
|
||||||
|
|
||||||
|
fun arch_invoke_irq_handler :: "irq_handler_invocation \<Rightarrow> (unit,'z::state_ext) s_monad"
|
||||||
|
where
|
||||||
|
"arch_invoke_irq_handler (ACKIrq irq) = (do_machine_op $ maskInterrupt False irq)"
|
||||||
|
| "arch_invoke_irq_handler _ = return ()"
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -112,6 +112,13 @@ definition
|
||||||
where
|
where
|
||||||
"setIRQTrigger irq trigger \<equiv> machine_op_lift (setIRQTrigger_impl irq trigger)"
|
"setIRQTrigger irq trigger \<equiv> machine_op_lift (setIRQTrigger_impl irq trigger)"
|
||||||
|
|
||||||
|
consts'
|
||||||
|
plic_complete_claim_impl :: "irq \<Rightarrow> unit machine_rest_monad"
|
||||||
|
|
||||||
|
definition
|
||||||
|
plic_complete_claim :: "irq \<Rightarrow> unit machine_monad"
|
||||||
|
where
|
||||||
|
"plic_complete_claim irq \<equiv> machine_op_lift (plic_complete_claim_impl irq)"
|
||||||
|
|
||||||
text \<open>Interrupts that cannot occur while the kernel is running (e.g. at preemption points), but
|
text \<open>Interrupts that cannot occur while the kernel is running (e.g. at preemption points), but
|
||||||
that can occur from user mode. Empty on RISCV64.\<close>
|
that can occur from user mode. Empty on RISCV64.\<close>
|
||||||
|
|
Loading…
Reference in New Issue