aspec: factor out arch_mask_irq_signal

On RISC-V we do not call mask_irq.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
This commit is contained in:
Gerwin Klein 2020-04-28 20:53:09 +08:00
parent 2e2d4c279d
commit 9de5bb27e4
5 changed files with 25 additions and 4 deletions

View File

@ -14,6 +14,7 @@ theory ArchInterrupt_A
imports "../Ipc_A"
begin
context Arch begin global_naming ARM_A
definition handle_reserved_irq :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
where "handle_reserved_irq irq = return ()"
@ -23,5 +24,10 @@ fun arch_invoke_irq_handler :: "irq_handler_invocation \<Rightarrow> (unit,'z::s
"arch_invoke_irq_handler (ACKIrq irq) = (do_machine_op $ maskInterrupt False irq)"
| "arch_invoke_irq_handler _ = return ()"
definition arch_mask_irq_signal :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
where
"arch_mask_irq_signal irq \<equiv> do_machine_op $ maskInterrupt True irq"
end
end

View File

@ -92,7 +92,10 @@ fun arch_invoke_irq_handler :: "irq_handler_invocation \<Rightarrow> (unit,'z::s
"arch_invoke_irq_handler (ACKIrq irq) = (do_machine_op $ maskInterrupt False irq)"
| "arch_invoke_irq_handler _ = return ()"
end
definition arch_mask_irq_signal :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
where
"arch_mask_irq_signal irq \<equiv> do_machine_op $ maskInterrupt True irq"
end
end

View File

@ -18,7 +18,9 @@ context begin interpretation Arch .
requalify_consts
arch_invoke_irq_control
arch_invoke_irq_handler
handle_reserved_irq
arch_mask_irq_signal
end
@ -94,7 +96,7 @@ definition
cap \<leftarrow> get_cap slot;
when (is_ntfn_cap cap \<and> AllowSend \<in> cap_rights cap)
$ send_signal (obj_ref_of cap) (cap_ep_badge cap);
do_machine_op $ maskInterrupt True irq
arch_mask_irq_signal irq
od
| IRQTimer \<Rightarrow> do
do_extended_op timer_tick;

View File

@ -10,7 +10,7 @@ theory ArchInterrupt_A
imports "../Ipc_A"
begin
context begin interpretation Arch .
context Arch begin global_naming RISCV64_A
definition handle_reserved_irq :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
where
@ -21,6 +21,10 @@ fun arch_invoke_irq_handler :: "irq_handler_invocation \<Rightarrow> (unit,'z::s
"arch_invoke_irq_handler (ACKIrq irq) = (do_machine_op $ plic_complete_claim irq)"
| "arch_invoke_irq_handler _ = return ()"
definition arch_mask_irq_signal :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
where
"arch_mask_irq_signal irq \<equiv> return ()"
end
end

View File

@ -14,6 +14,7 @@ theory ArchInterrupt_A
imports "../Ipc_A"
begin
context Arch begin global_naming X64_A
definition handle_reserved_irq :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
where "handle_reserved_irq irq = return ()"
@ -23,5 +24,10 @@ fun arch_invoke_irq_handler :: "irq_handler_invocation \<Rightarrow> (unit,'z::s
"arch_invoke_irq_handler (ACKIrq irq) = (do_machine_op $ maskInterrupt False irq)"
| "arch_invoke_irq_handler _ = return ()"
definition arch_mask_irq_signal :: "irq \<Rightarrow> (unit,'z::state_ext) s_monad"
where
"arch_mask_irq_signal irq \<equiv> do_machine_op $ maskInterrupt True irq"
end
end