-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsmc_data_create_unknown.v
57 lines (53 loc) · 2.31 KB
/
smc_data_create_unknown.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Require Import SpecDeps.
Require Import RData.
Require Import EventReplay.
Require Import MoverTypes.
Require Import Constants.
Require Import CommonLib.
Require Import AbsAccessor.Spec.
Require Import TableDataOpsIntro.Spec.
Require Import TableDataOpsRef3.Spec.
Local Open Scope Z_scope.
Section SpecLow.
Definition smc_data_create_unknown_spec0 (data_addr: Z64) (rd_addr: Z64) (map_addr: Z64) (adt: RData) : option (RData * Z64) :=
match data_addr, rd_addr, map_addr with
| VZ64 _data_addr, VZ64 _rd_addr, VZ64 _map_addr =>
let _new_data_state := 1 in
rely is_int64 _data_addr;
when'' _g_data_base, _g_data_ofst, adt == find_lock_granule_spec (VZ64 _data_addr) (VZ64 1) adt;
rely is_int _g_data_ofst;
when _t'6 == is_null_spec (_g_data_base, _g_data_ofst) adt;
rely is_int _t'6;
if (_t'6 =? 1) then
let _ret := 1 in
Some (adt, (VZ64 _ret))
else
rely is_int64 _rd_addr;
when'' _g_rd_base, _g_rd_ofst, adt == find_lock_granule_spec (VZ64 _rd_addr) (VZ64 2) adt;
rely is_int _g_rd_ofst;
when _t'5 == is_null_spec (_g_rd_base, _g_rd_ofst) adt;
rely is_int _t'5;
if (_t'5 =? 1) then
let _ret := 1 in
when adt == granule_unlock_spec (_g_data_base, _g_data_ofst) adt;
Some (adt, (VZ64 _ret))
else
when'' _rd_base, _rd_ofst, adt == granule_map_spec (_g_rd_base, _g_rd_ofst) 2 adt;
rely is_int _rd_ofst;
rely is_int64 _map_addr;
when' _ret, adt == data_create_unknown3_spec (_g_rd_base, _g_rd_ofst) (VZ64 _data_addr) (VZ64 _map_addr) (_g_data_base, _g_data_ofst) adt;
rely is_int64 _ret;
if (_ret =? 0) then
when adt == granule_set_state_spec (_g_data_base, _g_data_ofst) 4 adt;
when adt == buffer_unmap_spec (_rd_base, _rd_ofst) adt;
when adt == granule_unlock_spec (_g_rd_base, _g_rd_ofst) adt;
when adt == granule_unlock_spec (_g_data_base, _g_data_ofst) adt;
Some (adt, (VZ64 _ret))
else
when adt == buffer_unmap_spec (_rd_base, _rd_ofst) adt;
when adt == granule_unlock_spec (_g_rd_base, _g_rd_ofst) adt;
when adt == granule_unlock_spec (_g_data_base, _g_data_ofst) adt;
Some (adt, (VZ64 _ret))
end
.
End SpecLow.