55 *)
66
77theory InitCSpace_SI
8- imports
9- " DSpecProofs.CNode_DP"
10- ObjectInitialised_SI
11- RootTask_SI
12- SysInit_SI
13- Mapped_Separating_Conjunction
8+ imports
9+ DSpecProofs.CNode_DP
10+ ObjectInitialised_SI
11+ RootTask_SI
12+ SysInitSpec. SysInit_SI
13+ Mapped_Separating_Conjunction
1414begin
1515
1616(*********************
@@ -48,7 +48,7 @@ lemma irqhandler_cap_cap_irq [simp]:
4848
4949lemma InitThreadCNode_guard_equal [ simp ]:
5050 "guard_equal si_cspace_cap seL4_CapInitThreadCNode word_bits"
51- apply ( clarsimp simp : seL4_CapInitThreadCNode_def word_bits_def )
51+ apply ( clarsimp simp : seL4_CapInitThreadCNode_def )
5252 apply ( rule guard_equal_si_cspace_cap )
5353 apply ( simp add : si_cnode_size_def )
5454 done
@@ -341,7 +341,7 @@ lemma mint_pre:
341341 src_root = seL4_CapInitThreadCNode;
342342 Some src_index = orig_caps (cap_object spec_cap);
343343 src_index < 2 ^ si_cnode_size;
344- src_depth = (32 ::word32);
344+ src_depth = (of_nat word_bits ::word32);
345345
346346 rights = cap_rights spec_cap;
347347
@@ -388,8 +388,8 @@ lemma mint_pre:
388388 R\<guillemotright> s \<and>
389389
390390 \<comment> \<open>Cap slots match their cptrs.\<close>
391- one_lvl_lookup si_cspace_cap 32 si_cnode_size \<and>
392- one_lvl_lookup si_cspace_cap 32 si_cnode_size \<and>
391+ one_lvl_lookup si_cspace_cap (of_nat word_bits) si_cnode_size \<and>
392+ one_lvl_lookup si_cspace_cap (of_nat word_bits) si_cnode_size \<and>
393393 one_lvl_lookup si_cspace_cap (unat src_depth) si_cnode_size \<and>
394394 one_lvl_lookup dest_root_cap (unat dest_depth) dest_size \<and>
395395
@@ -503,8 +503,8 @@ lemma move_pre_irq_handler:
503503 R\<guillemotright> s \<and>
504504
505505 \<comment> \<open>Cap slots match their cptrs.\<close>
506- one_lvl_lookup si_cspace_cap 32 si_cnode_size \<and>
507- one_lvl_lookup si_cspace_cap 32 si_cnode_size \<and>
506+ one_lvl_lookup si_cspace_cap word_bits si_cnode_size \<and>
507+ one_lvl_lookup si_cspace_cap word_bits si_cnode_size \<and>
508508 one_lvl_lookup si_cspace_cap (unat src_depth) si_cnode_size \<and>
509509 one_lvl_lookup dest_root_cap (unat dest_depth) dest_size \<and>
510510
@@ -804,7 +804,7 @@ lemma seL4_CNode_Mutate_object_slot_initialised_sep_helper:
804804 si_cap_at t dup_caps spec dev obj_id \<and>*
805805 object_fields_empty spec t obj_id \<and>* si_objects \<and>* R\<guillemotright> \<rbrace>
806806 seL4_CNode_Mutate dest_root (of_nat slot) (of_nat (object_size_bits spec_obj))
807- seL4_CapInitThreadCNode src_index 32 data
807+ seL4_CapInitThreadCNode src_index (of_nat word_bits) data
808808 \<lbrace>\<lambda>_.\<guillemotleft>object_slot_initialised spec t obj_id slot \<and>*
809809 si_null_cap_at t orig_caps spec (cap_object spec_cap) \<and>*
810810 si_cap_at t dup_caps spec dev obj_id \<and>*
@@ -815,11 +815,12 @@ lemma seL4_CNode_Mutate_object_slot_initialised_sep_helper:
815815 and dest_root_cap = "default_cap CNodeType {dest_id} (object_size_bits spec_obj) False"
816816 and root_size = si_cnode_size
817817 and src_root = seL4_CapInitThreadCNode
818- and src_depth = 32
818+ and src_depth = "of_nat word_bits"
819819 and tcb = root_tcb
820820 and src_cap = "default_cap type {client_object_id} (object_size_bits spec_cap_obj) dev"
821821 in seL4_CNode_Mutate_sep [ where
822- R = "(si_cnode_id, unat seL4_CapIRQControl) \<mapsto>c IrqControlCap \<and>* si_asid \<and>* R" ])
822+ R = "(si_cnode_id, unat seL4_CapIRQControl) \<mapsto>c IrqControlCap \<and>* si_asid \<and>* R" ,
823+ folded word_bits_num ])
823824 apply ( assumption | simp add : ep_related_cap_default_cap
824825 default_cap_has_type valid_src_cap_if_cnode
825826 get_index_def )+
@@ -832,7 +833,7 @@ lemma seL4_CNode_Mutate_object_slot_initialised_sep_helper:
832833 simp_all add : has_type_default_not_non ep_related_cap_default_cap )
833834 apply ( thin_tac "\<guillemotleft>P \<and>* Q \<guillemotright>s" for P Q )
834835 apply sep_solve
835- apply (( clarsimp simp : si_cnode_cap_def word_bits_def si_cspace_cap_def
836+ apply (( clarsimp simp : si_cnode_cap_def si_cspace_cap_def
836837 dest !: guard_equal_si_cspace_cap |
837838 rule is_cnode_cap_si_cnode_cap )+)[ 2 ]
838839 (* it works because si_cnode_cap = si_cspace_cap *)
@@ -869,7 +870,7 @@ lemma seL4_CNode_Move_object_slot_initialised_cap_has_object_sep_helper:
869870 si_cap_at t dup_caps spec dev obj_id \<and>*
870871 object_fields_empty spec t obj_id \<and>* si_objects \<and>* R\<guillemotright> \<rbrace>
871872 seL4_CNode_Move dest_root (of_nat slot) (of_nat (object_size_bits spec_obj))
872- seL4_CapInitThreadCNode src_index 32
873+ seL4_CapInitThreadCNode src_index (of_nat word_bits)
873874 \<lbrace>\<lambda>_.\<guillemotleft>object_slot_initialised spec t obj_id slot \<and>*
874875 si_null_cap_at t orig_caps spec (cap_object spec_cap) \<and>*
875876 si_cap_at t dup_caps spec dev obj_id \<and>*
@@ -880,7 +881,7 @@ lemma seL4_CNode_Move_object_slot_initialised_cap_has_object_sep_helper:
880881 and dest_root_cap = "default_cap CNodeType {dest_id} (object_size_bits spec_obj) False"
881882 and root_size = si_cnode_size
882883 and src_root = seL4_CapInitThreadCNode
883- and src_depth = 32
884+ and src_depth = "of_nat word_bits"
884885 and tcb = root_tcb
885886 and src_cap = "default_cap type {client_object_id} (object_size_bits spec_cap_obj) dev"
886887 in seL4_CNode_Move_sep [ where
@@ -896,7 +897,7 @@ lemma seL4_CNode_Move_object_slot_initialised_cap_has_object_sep_helper:
896897 simp_all add : has_type_default_not_non ep_related_cap_default_cap )
897898 apply ( thin_tac "\<guillemotleft>P \<and>* Q \<guillemotright>s" for P Q )
898899 apply sep_solve
899- apply (( clarsimp simp : si_cnode_cap_def word_bits_def si_cspace_cap_def
900+ apply (( clarsimp simp : si_cnode_cap_def si_cspace_cap_def
900901 dest !: guard_equal_si_cspace_cap |
901902 rule is_cnode_cap_si_cnode_cap )+)[ 2 ]
902903 (* it works because si_cnode_cap = si_cspace_cap *)
@@ -926,7 +927,7 @@ lemma seL4_CNode_Move_object_slot_initialised_irqhandler_cap_sep_helper:
926927 si_cap_at t dup_caps spec False obj_id \<and>*
927928 object_fields_empty spec t obj_id \<and>* si_objects \<and>* R\<guillemotright> \<rbrace>
928929 seL4_CNode_Move dest_root (of_nat slot) (of_nat (object_size_bits spec_obj))
929- seL4_CapInitThreadCNode src_index 32
930+ seL4_CapInitThreadCNode src_index (of_nat word_bits)
930931 \<lbrace>\<lambda>_.\<guillemotleft>object_slot_initialised spec t obj_id slot \<and>*
931932 si_null_irq_cap_at irq_caps spec (cap_irq spec_cap) \<and>*
932933 si_cap_at t dup_caps spec dev obj_id \<and>*
@@ -937,7 +938,7 @@ lemma seL4_CNode_Move_object_slot_initialised_irqhandler_cap_sep_helper:
937938 and dest_root_cap = "default_cap CNodeType {dest_id} (object_size_bits spec_obj) False"
938939 and root_size = si_cnode_size
939940 and src_root = seL4_CapInitThreadCNode
940- and src_depth = 32
941+ and src_depth = "of_nat word_bits"
941942 and tcb = root_tcb
942943 and src_cap = " IrqHandlerCap (cap_irq spec_cap)"
943944 in seL4_CNode_Move_sep [ where
@@ -952,9 +953,9 @@ lemma seL4_CNode_Move_object_slot_initialised_irqhandler_cap_sep_helper:
952953 simp_all add : has_type_default_not_non ep_related_cap_default_cap )
953954 apply ( thin_tac "\<guillemotleft>P \<and>* Q \<guillemotright>s" for P Q )
954955 apply ( sep_solve add : sep_any_imp )
955- apply (( clarsimp simp : si_cnode_cap_def word_bits_def si_cspace_cap_def
956+ apply (( clarsimp simp : si_cnode_cap_def si_cspace_cap_def
956957 dest !: guard_equal_si_cspace_cap |
957- rule is_cnode_cap_si_cnode_cap )+)[ 2 ]
958+ rule is_cnode_cap_si_cnode_cap )+)[ 3 ]
958959 (* it works because si_cnode_cap = si_cspace_cap *)
959960 apply ( drule_tac s = s and dest_root = dest_root and src_index = src_index and R = R
960961 in move_post_irq_handler , ( assumption | simp )+)
@@ -977,7 +978,7 @@ lemma seL4_CNode_Move_object_slot_initialised_cap_has_object_sep:
977978 si_cap_at t dup_caps spec dev obj_id \<and>*
978979 object_fields_empty spec t obj_id \<and>* si_objects \<and>* R\<guillemotright> s\<rbrace>
979980 seL4_CNode_Move dest_root (of_nat slot) (of_nat (object_size_bits spec_obj))
980- seL4_CapInitThreadCNode src_index 32
981+ seL4_CapInitThreadCNode src_index (of_nat word_bits)
981982 \<lbrace>\<lambda>_.\<guillemotleft>object_slot_initialised spec t obj_id slot \<and>*
982983 si_null_cap_at t orig_caps spec (cap_object spec_cap) \<and>*
983984 si_cap_at t dup_caps spec dev obj_id \<and>*
@@ -1014,7 +1015,7 @@ lemma seL4_CNode_Move_object_slot_initialised_irqhandler_cap_sep:
10141015 si_cap_at t dup_caps spec False obj_id \<and>*
10151016 object_fields_empty spec t obj_id \<and>* si_objects \<and>* R\<guillemotright> s\<rbrace>
10161017 seL4_CNode_Move dest_root (of_nat slot) (of_nat (object_size_bits spec_obj))
1017- seL4_CapInitThreadCNode src_index 32
1018+ seL4_CapInitThreadCNode src_index (of_nat word_bits)
10181019 \<lbrace>\<lambda>_.\<guillemotleft>object_slot_initialised spec t obj_id slot \<and>*
10191020 si_null_irq_cap_at irq_caps spec (cap_irq spec_cap) \<and>*
10201021 si_cap_at t dup_caps spec False obj_id \<and>*
@@ -1043,7 +1044,7 @@ lemma seL4_CNode_Move_object_slot_initialised_irqhandler_cap_sep_new:
10431044 Some dest_root = dup_caps obj_id \<and>
10441045 Some src_index = irq_caps (cap_irq spec_cap))\<rbrace>
10451046 seL4_CNode_Move dest_root (of_nat slot) (of_nat (object_size_bits spec_obj))
1046- seL4_CapInitThreadCNode src_index 32
1047+ seL4_CapInitThreadCNode src_index (of_nat word_bits)
10471048 \<lbrace>\<lambda>_.\<guillemotleft>object_slot_initialised spec t obj_id slot \<and>*
10481049 si_null_irq_cap_at irq_caps spec (cap_irq spec_cap) \<and>*
10491050 si_cap_at t dup_caps spec False obj_id \<and>*
@@ -1075,7 +1076,7 @@ lemma seL4_CNode_Mutate_object_slot_initialised_sep:
10751076 si_cap_at t dup_caps spec dev obj_id \<and>*
10761077 object_fields_empty spec t obj_id \<and>* si_objects \<and>* R\<guillemotright> s \<rbrace>
10771078 seL4_CNode_Mutate dest_root (of_nat slot) (of_nat (object_size_bits spec_obj))
1078- seL4_CapInitThreadCNode src_index 32 data
1079+ seL4_CapInitThreadCNode src_index (of_nat word_bits) data
10791080 \<lbrace>\<lambda>_.\<guillemotleft>object_slot_initialised spec t obj_id slot \<and>*
10801081 si_null_cap_at t orig_caps spec (cap_object spec_cap) \<and>*
10811082 si_cap_at t dup_caps spec dev obj_id \<and>*
@@ -1387,7 +1388,7 @@ lemma seL4_CNode_Mint_object_slot_initialised_sep_helper:
13871388 si_cap_at t dup_caps spec dev obj_id \<and>*
13881389 object_fields_empty spec t obj_id \<and>* si_objects \<and>* R\<guillemotright> \<rbrace>
13891390 seL4_CNode_Mint dest_root (of_nat slot) (of_nat (object_size_bits spec_obj))
1390- seL4_CapInitThreadCNode src_index 32 rights data
1391+ seL4_CapInitThreadCNode src_index (of_nat word_bits) rights data
13911392 \<lbrace>\<lambda>_.\<guillemotleft>object_slot_initialised spec t obj_id slot \<and>*
13921393 si_cap_at t orig_caps spec dev (cap_object spec_cap) \<and>*
13931394 si_cap_at t dup_caps spec dev obj_id \<and>*
@@ -1399,7 +1400,7 @@ lemma seL4_CNode_Mint_object_slot_initialised_sep_helper:
13991400 and dest_root_cap = "default_cap CNodeType {dest_id} (object_size_bits spec_obj) False"
14001401 and root_size = si_cnode_size
14011402 and src_root = seL4_CapInitThreadCNode
1402- and src_depth = 32
1403+ and src_depth = "of_nat word_bits"
14031404 and tcb = root_tcb
14041405 and src_cap = "default_cap type {client_object_id} (object_size_bits spec_cap_obj) dev"
14051406 in seL4_CNode_Mint_sep ,
@@ -1452,7 +1453,7 @@ lemma seL4_CNode_Mint_object_slot_initialised_sep:
14521453 si_cap_at t dup_caps spec dev obj_id \<and>*
14531454 object_fields_empty spec t obj_id \<and>* si_objects \<and>* R\<guillemotright> s \<rbrace>
14541455 seL4_CNode_Mint dest_root (of_nat slot) (of_nat (object_size_bits spec_obj))
1455- seL4_CapInitThreadCNode src_index 32 rights data
1456+ seL4_CapInitThreadCNode src_index (of_nat word_bits) rights data
14561457 \<lbrace>\<lambda>_ s. \<guillemotleft>object_slot_initialised spec t obj_id slot \<and>*
14571458 si_cap_at t orig_caps spec dev (cap_object spec_cap) \<and>*
14581459 si_cap_at t dup_caps spec dev obj_id \<and>*
0 commit comments