-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_create_unknown.v
166 lines (162 loc) · 7.41 KB
/
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
Require Import CodeDeps.
Require Import Ident.
Local Open Scope Z_scope.
Definition _a := 1%positive.
Definition _addr := 2%positive.
Definition _b := 3%positive.
Definition _data := 4%positive.
Definition _data_addr := 5%positive.
Definition _g := 6%positive.
Definition _g_data := 7%positive.
Definition _g_llt := 8%positive.
Definition _g_rd := 9%positive.
Definition _granule := 10%positive.
Definition _i := 11%positive.
Definition _index := 12%positive.
Definition _ipa_state := 13%positive.
Definition _ll_table := 14%positive.
Definition _llt_pgte := 15%positive.
Definition _lock := 16%positive.
Definition _map_addr := 17%positive.
Definition _pa := 18%positive.
Definition _pgte := 19%positive.
Definition _pte := 20%positive.
Definition _pte_val := 21%positive.
Definition _rd := 22%positive.
Definition _ret := 23%positive.
Definition _s := 24%positive.
Definition _state := 25%positive.
Definition _table := 26%positive.
Definition _val := 27%positive.
Definition _wi_g_llt := 28%positive.
Definition _wi_index := 29%positive.
Definition _t'1 := 30%positive.
Definition _t'2 := 31%positive.
Definition _t'3 := 32%positive.
Definition _t'4 := 33%positive.
Definition _t'5 := 34%positive.
Definition data_create_unknown_body :=
(Ssequence
(Scall None
(Evar _table_walk_lock_unlock (Tfunction
(Tcons (tptr Tvoid)
(Tcons tulong (Tcons tulong Tnil)))
tvoid cc_default))
((Etempvar _g_rd (tptr Tvoid)) ::
(Etempvar _map_addr tulong) ::
(Ebinop Osub (Econst_int (Int.repr 4) tuint)
(Econst_int (Int.repr 1) tuint) tuint) :: nil))
(Ssequence
(Ssequence
(Scall (Some _t'1)
(Evar _get_wi_g_llt (Tfunction Tnil (tptr Tvoid)
cc_default)) nil)
(Sset _g_llt (Etempvar _t'1 (tptr Tvoid))))
(Ssequence
(Ssequence
(Scall (Some _t'2)
(Evar _get_wi_index (Tfunction Tnil tulong cc_default)) nil)
(Sset _index (Etempvar _t'2 tulong)))
(Ssequence
(Ssequence
(Scall (Some _t'5)
(Evar _is_null (Tfunction (Tcons (tptr Tvoid) Tnil) tuint
cc_default))
((Etempvar _g_llt (tptr Tvoid)) :: nil))
(Sifthenelse (Ebinop Oeq (Etempvar _t'5 tuint)
(Econst_int (Int.repr 1) tuint) tint)
(Sset _ret (Econst_long (Int64.repr 1) tulong))
(Ssequence
(Ssequence
(Scall (Some _t'3)
(Evar _granule_map (Tfunction
(Tcons
(tptr Tvoid)
(Tcons tuint Tnil)) (tptr Tvoid)
cc_default))
((Etempvar _g_llt (tptr Tvoid)) ::
(Econst_int (Int.repr 5) tuint) :: nil))
(Sset _ll_table (Etempvar _t'3 (tptr Tvoid))))
(Ssequence
(Ssequence
(Scall (Some _t'4)
(Evar _pgte_read (Tfunction
(Tcons (tptr Tvoid)
(Tcons tulong Tnil)) tulong
cc_default))
((Etempvar _ll_table (tptr Tvoid)) ::
(Etempvar _index tulong) :: nil))
(Sset _pte_val (Etempvar _t'4 tulong)))
(Ssequence
(Sifthenelse (Ebinop One
(Ebinop Odiv
(Ebinop Oand (Etempvar _pte_val tulong)
(Econst_long (Int64.repr 504403158265495552) tulong)
tulong)
(Econst_long (Int64.repr 72057594037927936) tulong)
tulong) (Econst_int (Int.repr 0) tuint)
tint)
(Sset _ret (Econst_long (Int64.repr 1) tulong))
(Ssequence
(Sset _pte_val
(Ebinop Oor
(Ebinop Omul (Econst_int (Int.repr 1) tuint)
(Econst_long (Int64.repr 72057594037927936) tulong)
tulong) (Etempvar _data_addr tulong) tulong))
(Ssequence
(Scall None
(Evar _pgte_write (Tfunction
(Tcons (tptr Tvoid)
(Tcons tulong
(Tcons tulong Tnil))) tvoid
cc_default))
((Etempvar _ll_table (tptr Tvoid)) ::
(Etempvar _index tulong) ::
(Etempvar _pte_val tulong) :: nil))
(Ssequence
(Scall None
(Evar _set_mapping (Tfunction
(Tcons tulong
(Tcons tulong Tnil)) tvoid
cc_default))
((Etempvar _map_addr tulong) ::
(Etempvar _data_addr tulong) :: nil))
(Ssequence
(Scall None
(Evar _granule_get (Tfunction
(Tcons
(tptr Tvoid)
Tnil) tvoid cc_default))
((Etempvar _g_llt (tptr Tvoid)) ::
nil))
(Sset _ret (Econst_long (Int64.repr 0) tulong)))))))
(Ssequence
(Scall None
(Evar _buffer_unmap (Tfunction
(Tcons (tptr Tvoid) Tnil) tvoid
cc_default))
((Etempvar _ll_table (tptr Tvoid)) :: nil))
(Scall None
(Evar _granule_unlock (Tfunction
(Tcons
(tptr Tvoid)
Tnil) tvoid cc_default))
((Etempvar _g_llt (tptr Tvoid)) ::
nil))))))))
(Sreturn (Some (Etempvar _ret tulong)))))))
.
Definition f_data_create_unknown := {|
fn_return := tulong;
fn_callconv := cc_default;
fn_params := ((_g_rd, (tptr Tvoid)) ::
(_data_addr, tulong) :: (_map_addr, tulong) ::
(_g_data, (tptr Tvoid)) :: nil);
fn_vars := nil;
fn_temps := ((_ll_table, (tptr Tvoid)) :: (_llt_pgte, tulong) ::
(_pte_val, tulong) :: (_ipa_state, tulong) ::
(_ret, tulong) :: (_index, tulong) ::
(_g_llt, (tptr Tvoid)) :: (_t'5, tuint) ::
(_t'4, tulong) :: (_t'3, (tptr Tvoid)) :: (_t'2, tulong) ::
(_t'1, (tptr Tvoid)) :: nil);
fn_body := data_create_unknown_body
|}.