Skip to content

Commit

Permalink
aspec: change arch_prepare_set_domain to not be an extended op
Browse files Browse the repository at this point in the history
Now that domains are part of the extensible state,
arch_prepare_set_domain does not need to be in the det_ext monad.

Signed-off-by: Corey Lewis <[email protected]>
  • Loading branch information
corlewis committed Dec 19, 2024
1 parent 8b01191 commit a068f41
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion spec/abstract/AARCH64/ArchTcb_A.thy
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ definition arch_post_set_flags :: "obj_ref \<Rightarrow> tcb_flags \<Rightarrow>
"arch_post_set_flags t flags \<equiv>
when (ArchFlag FpuDisabled \<in> flags) (fpu_release t)"

definition arch_prepare_set_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> unit det_ext_monad" where
definition arch_prepare_set_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> (unit, 'a::state_ext) s_monad" where
"arch_prepare_set_domain t new_dom \<equiv> do
cur_domain \<leftarrow> gets cur_domain;
when (cur_domain \<noteq> new_dom) $ fpu_release t
Expand Down
2 changes: 1 addition & 1 deletion spec/abstract/ARM/ArchTcb_A.thy
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ where
definition arch_post_set_flags :: "obj_ref \<Rightarrow> tcb_flags \<Rightarrow> (unit, 'a::state_ext) s_monad" where
"arch_post_set_flags t flags \<equiv> return ()"

definition arch_prepare_set_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> unit det_ext_monad" where
definition arch_prepare_set_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> (unit, 'a::state_ext) s_monad" where
"arch_prepare_set_domain t new_dom \<equiv> return ()"

end
Expand Down
2 changes: 1 addition & 1 deletion spec/abstract/ARM_HYP/ArchTcb_A.thy
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ where
definition arch_post_set_flags :: "obj_ref \<Rightarrow> tcb_flags \<Rightarrow> (unit, 'a::state_ext) s_monad" where
"arch_post_set_flags t flags \<equiv> return ()"

definition arch_prepare_set_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> unit det_ext_monad" where
definition arch_prepare_set_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> (unit, 'a::state_ext) s_monad" where
"arch_prepare_set_domain t new_dom \<equiv> return ()"

end
Expand Down
2 changes: 1 addition & 1 deletion spec/abstract/RISCV64/ArchTcb_A.thy
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ definition arch_post_modify_registers :: "obj_ref \<Rightarrow> obj_ref \<Righta
definition arch_post_set_flags :: "obj_ref \<Rightarrow> tcb_flags \<Rightarrow> (unit, 'a::state_ext) s_monad" where
"arch_post_set_flags t flags \<equiv> return ()"

definition arch_prepare_set_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> unit det_ext_monad" where
definition arch_prepare_set_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> (unit, 'a::state_ext) s_monad" where
"arch_prepare_set_domain t new_dom \<equiv> return ()"

end
Expand Down
6 changes: 2 additions & 4 deletions spec/abstract/Tcb_A.thy
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,10 @@ definition
when (tptr = cur) reschedule_required
od"

\<comment> \<open>FIXME FPU: @{term arch_prepare_set_domain} shouldn't be an extended op. Fixing this will require either
adding domains to the non-det spec, or removing the non-det spec completely.\<close>
definition invoke_domain:: "obj_ref \<Rightarrow> domain \<Rightarrow> (data list,'z::state_ext) p_monad" where
definition invoke_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> (data list,'z::state_ext) p_monad" where
"invoke_domain thread domain \<equiv>
liftE $ do
do_extended_op (arch_prepare_set_domain thread domain);
arch_prepare_set_domain thread domain;
set_domain thread domain;
return []
od"
Expand Down
2 changes: 1 addition & 1 deletion spec/abstract/X64/ArchTcb_A.thy
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ definition arch_post_set_flags :: "obj_ref \<Rightarrow> tcb_flags \<Rightarrow>
"arch_post_set_flags t flags \<equiv>
when (ArchFlag FpuDisabled \<in> flags) (fpu_release t)"

definition arch_prepare_set_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> unit det_ext_monad" where
definition arch_prepare_set_domain :: "obj_ref \<Rightarrow> domain \<Rightarrow> (unit, 'a::state_ext) s_monad" where
"arch_prepare_set_domain t new_dom \<equiv> do
cur_domain \<leftarrow> gets cur_domain;
when (cur_domain \<noteq> new_dom) $ fpu_release t
Expand Down

0 comments on commit a068f41

Please sign in to comment.