-
Notifications
You must be signed in to change notification settings - Fork 1
/
handle_ns_smc.v
131 lines (127 loc) · 5.97 KB
/
handle_ns_smc.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
Require Import SpecDeps.
Require Import RData.
Require Import EventReplay.
Require Import MoverTypes.
Require Import Constants.
Require Import CommonLib.
Require Import RmiSMC.Spec.
Require Import TableDataOpsIntro.Spec.
Require Import TableDataSMC.Spec.
Require Import RunSMC.Spec.
Require Import AbsAccessor.Spec.
Local Open Scope Z_scope.
Section SpecLow.
Definition handle_ns_smc_spec0 (function_id: Z64) (arg0: Z64) (arg1: Z64) (arg2: Z64) (arg3: Z64) (adt: RData) : option (RData * Z64) :=
match function_id, arg0, arg1, arg2, arg3 with
| VZ64 _function_id, VZ64 _arg0, VZ64 _arg1, VZ64 _arg2, VZ64 _arg3 =>
if (_function_id =? 0) then
Some (adt, (VZ64 1572864))
else
if (_function_id =? 1) then
rely is_int64 _arg0;
when' _t'1, adt == smc_granule_delegate_spec (VZ64 _arg0) adt;
rely is_int64 _t'1;
Some (adt, (VZ64 _t'1))
else
if (_function_id =? 2) then
rely is_int64 _arg0;
when' _t'2, adt == smc_granule_undelegate_spec (VZ64 _arg0) adt;
rely is_int64 _t'2;
Some (adt, (VZ64 _t'2))
else
if (_function_id =? 3) then
rely is_int64 _arg0;
rely is_int64 _arg1;
when' _t'3, adt == smc_realm_create_spec (VZ64 _arg0) (VZ64 _arg1) adt;
rely is_int64 _t'3;
Some (adt, (VZ64 _t'3))
else
if (_function_id =? 4) then
rely is_int64 _arg0;
when' _t'4, adt == smc_realm_destroy_spec (VZ64 _arg0) adt;
rely is_int64 _t'4;
Some (adt, (VZ64 _t'4))
else
if (_function_id =? 5) then
rely is_int64 _arg0;
when' _t'5, adt == smc_realm_activate_spec (VZ64 _arg0) adt;
rely is_int64 _t'5;
Some (adt, (VZ64 _t'5))
else
if (_function_id =? 6) then
rely is_int64 _arg0;
rely is_int64 _arg1;
rely is_int64 _arg2;
rely is_int64 _arg3;
when' _t'6, adt == smc_rec_create_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) (VZ64 _arg3) adt;
rely is_int64 _t'6;
Some (adt, (VZ64 _t'6))
else
if (_function_id =? 7) then
rely is_int64 _arg0;
when' _t'7, adt == smc_rec_destroy_spec (VZ64 _arg0) adt;
rely is_int64 _t'7;
Some (adt, (VZ64 _t'7))
else
if (_function_id =? 8) then
rely is_int64 _arg0;
rely is_int64 _arg1;
rely is_int64 _arg2;
rely is_int64 _arg3;
when' _t'8, adt == smc_data_create_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) (VZ64 _arg3) adt;
rely is_int64 _t'8;
Some (adt, (VZ64 _t'8))
else
if (_function_id =? 9) then
rely is_int64 _arg0;
rely is_int64 _arg1;
when' _t'9, adt == smc_data_destroy_spec (VZ64 _arg0) (VZ64 _arg1) adt;
rely is_int64 _t'9;
Some (adt, (VZ64 _t'9))
else
if (_function_id =? 10) then
rely is_int64 _arg0;
rely is_int64 _arg1;
rely is_int64 _arg2;
rely is_int64 _arg3;
when' _t'10, adt == smc_rtt_create_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) (VZ64 _arg3) adt;
rely is_int64 _t'10;
Some (adt, (VZ64 _t'10))
else
if (_function_id =? 11) then
rely is_int64 _arg0;
rely is_int64 _arg1;
rely is_int64 _arg2;
rely is_int64 _arg3;
when' _t'11, adt == smc_rtt_destroy_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) (VZ64 _arg3) adt;
rely is_int64 _t'11;
Some (adt, (VZ64 _t'11))
else
if (_function_id =? 12) then
rely is_int64 _arg0;
rely is_int64 _arg1;
when' _t'12, adt == smc_rec_run_spec (VZ64 _arg0) (VZ64 _arg1) adt;
rely is_int64 _t'12;
Some (adt, (VZ64 _t'12))
else
if (_function_id =? 13) then
rely is_int64 _arg0;
rely is_int64 _arg1;
rely is_int64 _arg2;
when' _t'13, adt == smc_rtt_map_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) adt;
rely is_int64 _t'13;
Some (adt, (VZ64 _t'13))
else
if (_function_id =? 14) then
rely is_int64 _arg0;
rely is_int64 _arg1;
rely is_int64 _arg2;
when' _t'14, adt == smc_rtt_unmap_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) adt;
rely is_int64 _t'14;
Some (adt, (VZ64 _t'14))
else
when adt == assert_cond_spec 0 adt;
Some (adt, (VZ64 0))
end
.
End SpecLow.