-
Notifications
You must be signed in to change notification settings - Fork 2
/
handle_ns_smc.v
66 lines (61 loc) · 2.73 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
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 Spec.
Definition handle_ns_smc_spec (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 =>
rely is_int64 _arg0; rely is_int64 _arg1; rely is_int64 _arg2; rely is_int64 _arg3;
if (_function_id =? 0) then
Some (adt, (VZ64 1572864))
else
if (_function_id =? 1) then
smc_granule_delegate_spec (VZ64 _arg0) adt
else
if (_function_id =? 2) then
smc_granule_undelegate_spec (VZ64 _arg0) adt
else
if (_function_id =? 3) then
smc_realm_create_spec (VZ64 _arg0) (VZ64 _arg1) adt
else
if (_function_id =? 4) then
smc_realm_destroy_spec (VZ64 _arg0) adt
else
if (_function_id =? 5) then
smc_realm_activate_spec (VZ64 _arg0) adt
else
if (_function_id =? 6) then
smc_rec_create_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) (VZ64 _arg3) adt
else
if (_function_id =? 7) then
smc_rec_destroy_spec (VZ64 _arg0) adt
else
if (_function_id =? 8) then
smc_data_create_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) (VZ64 _arg3) adt
else
if (_function_id =? 9) then
smc_data_destroy_spec (VZ64 _arg0) (VZ64 _arg1) adt
else
if (_function_id =? 10) then
smc_rtt_create_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) (VZ64 _arg3) adt
else
if (_function_id =? 11) then
smc_rtt_destroy_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) (VZ64 _arg3) adt
else
if (_function_id =? 13) then
smc_rtt_map_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) adt
else
if (_function_id =? 14) then
smc_rtt_unmap_spec (VZ64 _arg0) (VZ64 _arg1) (VZ64 _arg2) adt
else None
end.
End Spec.