From 54108793a1e9421d64cd10252420347feac7525e Mon Sep 17 00:00:00 2001 From: Corey Lewis Date: Thu, 26 Sep 2024 13:03:54 +1000 Subject: [PATCH] squash abstract: PR suggestions Signed-off-by: Corey Lewis --- spec/abstract/AARCH64/FPU_A.thy | 12 ++++++------ spec/abstract/Schedule_A.thy | 6 +++--- spec/machine/AARCH64/MachineOps.thy | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/abstract/AARCH64/FPU_A.thy b/spec/abstract/AARCH64/FPU_A.thy index fc5b51c87b..9d6fd6cffc 100644 --- a/spec/abstract/AARCH64/FPU_A.thy +++ b/spec/abstract/AARCH64/FPU_A.thy @@ -25,15 +25,15 @@ definition load_fpu_state :: "obj_ref \ (unit,'z::state_ext) s_monad do_machine_op (writeFpuState fpu_state) od" -\ \FIXME: maybe use a case instead of the if (depends on if wpc or if_split is easier)\ +\ \FIXME: maybe use an if instead of the case (depends on if wpc or if\_split is easier)\ definition switch_local_fpu_owner :: "obj_ref option \ (unit,'z::state_ext) s_monad" where "switch_local_fpu_owner new_owner \ do do_machine_op enableFpu; cur_fpu_owner \ gets (arm_current_fpu_owner \ arch_state); - when (cur_fpu_owner \ None) $ save_fpu_state (the cur_fpu_owner); - if (new_owner \ None) - then load_fpu_state (the new_owner) - else do_machine_op disableFpu; + maybeM save_fpu_state cur_fpu_owner; + case new_owner of + None \ do_machine_op disableFpu + | Some tcb_ptr \ load_fpu_state tcb_ptr; modify (\s. s \arch_state := arch_state s\arm_current_fpu_owner := new_owner\\) od" @@ -46,7 +46,7 @@ definition fpu_release :: "obj_ref \ (unit,'z::state_ext) s_monad" w definition lazy_fpu_restore :: "obj_ref \ (unit,'z::state_ext) s_monad" where "lazy_fpu_restore thread_ptr \ do flags \ thread_get tcb_flags thread_ptr; - if (ArchFlag FpuDisabled \ flags) + if ArchFlag FpuDisabled \ flags then do_machine_op disableFpu else do do_machine_op enableFpu; diff --git a/spec/abstract/Schedule_A.thy b/spec/abstract/Schedule_A.thy index 39afe19362..699733490d 100644 --- a/spec/abstract/Schedule_A.thy +++ b/spec/abstract/Schedule_A.thy @@ -168,7 +168,7 @@ instantiation unit :: state_ext_sched begin \ \FIXME: update this comment to mention the state that might be - saved as part of arch_prepare_next_domain\ + saved as part of @{term arch_prepare_next_domain}\ text \ The scheduler is heavily underspecified. It is allowed to pick any active thread or the idle thread. @@ -193,9 +193,9 @@ definition schedule_unit :: "(unit,unit) s_monad" where cur_active \ gets (getActiveTCB cur); idl \ gets idle_thread; if cur_active \ None \ idl = cur then - return () \ (do pre_choose_thread_unit; choose_thread_unit od) + return () \ do pre_choose_thread_unit; choose_thread_unit od else - (do pre_choose_thread_unit; choose_thread_unit od) + do pre_choose_thread_unit; choose_thread_unit od od)" instance .. diff --git a/spec/machine/AARCH64/MachineOps.thy b/spec/machine/AARCH64/MachineOps.thy index c778e280df..f5791f8f55 100644 --- a/spec/machine/AARCH64/MachineOps.thy +++ b/spec/machine/AARCH64/MachineOps.thy @@ -168,7 +168,7 @@ definition setNextPC :: "machine_word \ unit user_monad" where subsection "FPU-related" -\ \FIXME: Should this modify fpu_enabled? The C doesn't update isFPUEnabledCached when this is called directly.\ +\ \FIXME: Should this modify @{term fpu_enabled}? The C doesn't update isFPUEnabledCached when this is called directly.\ consts' enableFpuEL01_impl :: "unit machine_rest_monad" definition enableFpuEL01 :: "unit machine_monad" where "enableFpuEL01 \ machine_op_lift enableFpuEL01_impl"