File: defines.h

package info (click to toggle)
linux 6.1.139-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,495,880 kB
  • sloc: ansic: 23,469,452; asm: 266,614; sh: 110,522; makefile: 49,887; python: 36,990; perl: 36,834; cpp: 6,056; yacc: 4,908; lex: 2,725; awk: 1,440; ruby: 25; sed: 5
file content (79 lines) | stat: -rw-r--r-- 1,426 bytes parent folder | download | duplicates (10)
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
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright(c) 2016-20 Intel Corporation.
 */

#ifndef DEFINES_H
#define DEFINES_H

#include <stdint.h>

#define PAGE_SIZE 4096
#define PAGE_MASK (~(PAGE_SIZE - 1))

#define __aligned(x) __attribute__((__aligned__(x)))
#define __packed __attribute__((packed))

#include "../../../../arch/x86/include/asm/sgx.h"
#include "../../../../arch/x86/include/asm/enclu.h"
#include "../../../../arch/x86/include/uapi/asm/sgx.h"

enum encl_op_type {
	ENCL_OP_PUT_TO_BUFFER,
	ENCL_OP_GET_FROM_BUFFER,
	ENCL_OP_PUT_TO_ADDRESS,
	ENCL_OP_GET_FROM_ADDRESS,
	ENCL_OP_NOP,
	ENCL_OP_EACCEPT,
	ENCL_OP_EMODPE,
	ENCL_OP_INIT_TCS_PAGE,
	ENCL_OP_MAX,
};

struct encl_op_header {
	uint64_t type;
};

struct encl_op_put_to_buf {
	struct encl_op_header header;
	uint64_t value;
};

struct encl_op_get_from_buf {
	struct encl_op_header header;
	uint64_t value;
};

struct encl_op_put_to_addr {
	struct encl_op_header header;
	uint64_t value;
	uint64_t addr;
};

struct encl_op_get_from_addr {
	struct encl_op_header header;
	uint64_t value;
	uint64_t addr;
};

struct encl_op_eaccept {
	struct encl_op_header header;
	uint64_t epc_addr;
	uint64_t flags;
	uint64_t ret;
};

struct encl_op_emodpe {
	struct encl_op_header header;
	uint64_t epc_addr;
	uint64_t flags;
};

struct encl_op_init_tcs_page {
	struct encl_op_header header;
	uint64_t tcs_page;
	uint64_t ssa;
	uint64_t entry;
};

#endif /* DEFINES_H */