Asylo
primitives.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 Asylo authors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef ASYLO_PLATFORM_PRIMITIVES_PRIMITIVES_H_
20 #define ASYLO_PLATFORM_PRIMITIVES_PRIMITIVES_H_
21 
22 #include <cstddef>
23 #include <cstdint>
24 
25 namespace asylo {
26 namespace primitives {
27 
28 /// \file This file declares types and constants used by both trusted and
29 /// untrusted code, but which are not passed across the enclave boundary.
30 
31 //////////////////////////////////////
32 // Entry handler selectors //
33 //////////////////////////////////////
34 
35 /// Invalid entry point selector.
36 static constexpr uint64_t kSelectorAsyloInvalid = 0;
37 
38 /// Enclave enter and donate thread entry point selector.
39 static constexpr uint64_t kSelectorAsyloDonateThread = 2;
40 
41 /// Enclave finalization entry point selector.
42 static constexpr uint64_t kSelectorAsyloFini = 3;
43 
44 //////////////////////////////////////
45 // Exit handler selectors //
46 //////////////////////////////////////
47 
48 /// Selector for thread creation handler.
49 static constexpr uint64_t kSelectorCreateThread = 87;
50 
51 /// Selector values in [`kSelectorHostCall`, `kSelectorRemote`) range are
52 /// reserved for untrusted host call handlers and cannot be used by any other
53 /// component.
54 static constexpr uint64_t kSelectorHostCall = 88;
55 
56 /// Selector values in [`kSelectorRemote`, `kSelectorUser`) range are reserved
57 /// for remote backend needs and cannot be used by any other component.
58 static constexpr uint64_t kSelectorRemote = 120;
59 
60 /// Selector values less than `kSelectorUser` are reserved by the runtime and
61 /// may not be registered by the applications.
62 static constexpr uint64_t kSelectorUser = 128;
63 
64 } // namespace primitives
65 } // namespace asylo
66 
67 #endif // ASYLO_PLATFORM_PRIMITIVES_PRIMITIVES_H_
ABSL_CONST_INIT const char kStatusMoveAssignmentMsg[]
Definition: extent.h:29