drm/bridge: adv7511: Switch to atomic operations
[drm/drm-misc.git] / tools / testing / selftests / sgx / defines.h
blob402f8787a71cc0221b1af0690efbee1c8e0bfb42
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright(c) 2016-20 Intel Corporation.
4 */
6 #ifndef DEFINES_H
7 #define DEFINES_H
9 #include <stdint.h>
11 #define PAGE_SIZE 4096
12 #define PAGE_MASK (~(PAGE_SIZE - 1))
14 #define __aligned(x) __attribute__((__aligned__(x)))
15 #define __packed __attribute__((packed))
16 #define __used __attribute__((used))
17 #define __section(x)__attribute__((__section__(x)))
19 #include "../../../../arch/x86/include/asm/sgx.h"
20 #include "../../../../arch/x86/include/asm/enclu.h"
21 #include "../../../../arch/x86/include/uapi/asm/sgx.h"
23 enum encl_op_type {
24 ENCL_OP_PUT_TO_BUFFER,
25 ENCL_OP_GET_FROM_BUFFER,
26 ENCL_OP_PUT_TO_ADDRESS,
27 ENCL_OP_GET_FROM_ADDRESS,
28 ENCL_OP_NOP,
29 ENCL_OP_EACCEPT,
30 ENCL_OP_EMODPE,
31 ENCL_OP_INIT_TCS_PAGE,
32 ENCL_OP_MAX,
35 struct encl_op_header {
36 uint64_t type;
39 struct encl_op_put_to_buf {
40 struct encl_op_header header;
41 uint64_t value;
44 struct encl_op_get_from_buf {
45 struct encl_op_header header;
46 uint64_t value;
49 struct encl_op_put_to_addr {
50 struct encl_op_header header;
51 uint64_t value;
52 uint64_t addr;
55 struct encl_op_get_from_addr {
56 struct encl_op_header header;
57 uint64_t value;
58 uint64_t addr;
61 struct encl_op_eaccept {
62 struct encl_op_header header;
63 uint64_t epc_addr;
64 uint64_t flags;
65 uint64_t ret;
68 struct encl_op_emodpe {
69 struct encl_op_header header;
70 uint64_t epc_addr;
71 uint64_t flags;
74 struct encl_op_init_tcs_page {
75 struct encl_op_header header;
76 uint64_t tcs_page;
77 uint64_t ssa;
78 uint64_t entry;
81 #endif /* DEFINES_H */