TianoCore EDK2
master
Loading...
Searching...
No Matches
OpteeLib.h
Go to the documentation of this file.
1
11
#ifndef OPTEE_LIB_H_
12
#define OPTEE_LIB_H_
13
14
/*
15
* The 'Trusted OS Call UID' is supposed to return the following UUID for
16
* OP-TEE OS. This is a 128-bit value.
17
*/
18
#define OPTEE_OS_UID0 0x384fb3e0
19
#define OPTEE_OS_UID1 0xe7f811e3
20
#define OPTEE_OS_UID2 0xaf630002
21
#define OPTEE_OS_UID3 0xa5d5c51b
22
23
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_NONE 0x0
24
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INPUT 0x1
25
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_OUTPUT 0x2
26
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INOUT 0x3
27
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INPUT 0x9
28
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_OUTPUT 0xa
29
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INOUT 0xb
30
31
#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MASK 0xff
32
33
#define OPTEE_SUCCESS 0x00000000
34
#define OPTEE_ORIGIN_COMMUNICATION 0x00000002
35
#define OPTEE_ERROR_COMMUNICATION 0xFFFF000E
36
37
typedef
struct
{
38
UINT64 BufferAddress;
39
UINT64 Size;
40
UINT64 SharedMemoryReference;
41
}
OPTEE_MESSAGE_PARAM_MEMORY
;
42
43
typedef
struct
{
44
UINT64 A;
45
UINT64 B;
46
UINT64 C;
47
}
OPTEE_MESSAGE_PARAM_VALUE
;
48
49
typedef
union
{
50
OPTEE_MESSAGE_PARAM_MEMORY
Memory;
51
OPTEE_MESSAGE_PARAM_VALUE
Value;
52
}
OPTEE_MESSAGE_PARAM_UNION
;
53
54
typedef
struct
{
55
UINT64 Attribute;
56
OPTEE_MESSAGE_PARAM_UNION
Union;
57
}
OPTEE_MESSAGE_PARAM
;
58
59
#define OPTEE_MAX_CALL_PARAMS 4
60
61
typedef
struct
{
62
UINT32 Command;
63
UINT32 Function;
64
UINT32 Session;
65
UINT32 CancelId;
66
UINT32 Pad;
67
UINT32 Return;
68
UINT32 ReturnOrigin;
69
UINT32 NumParams;
70
71
// NumParams tells the actual number of element in Params
72
OPTEE_MESSAGE_PARAM
Params[OPTEE_MAX_CALL_PARAMS];
73
}
OPTEE_MESSAGE_ARG
;
74
75
typedef
struct
{
76
EFI_GUID
Uuid;
// [in] GUID/UUID of the Trusted Application
77
UINT32 Session;
// [out] Session id
78
UINT32 Return;
// [out] Return value
79
UINT32 ReturnOrigin;
// [out] Origin of the return value
80
}
OPTEE_OPEN_SESSION_ARG
;
81
82
typedef
struct
{
83
UINT32 Function;
// [in] Trusted Application function, specific to the TA
84
UINT32 Session;
// [in] Session id
85
UINT32 Return;
// [out] Return value
86
UINT32 ReturnOrigin;
// [out] Origin of the return value
87
OPTEE_MESSAGE_PARAM
Params[OPTEE_MAX_CALL_PARAMS];
// Params for function to be invoked
88
}
OPTEE_INVOKE_FUNCTION_ARG
;
89
90
BOOLEAN
91
EFIAPI
92
IsOpteePresent
(
93
VOID
94
);
95
96
EFI_STATUS
97
EFIAPI
98
OpteeInit (
99
VOID
100
);
101
102
EFI_STATUS
103
EFIAPI
104
OpteeOpenSession (
105
IN
OUT
OPTEE_OPEN_SESSION_ARG
*OpenSessionArg
106
);
107
108
EFI_STATUS
109
EFIAPI
110
OpteeCloseSession (
111
IN
UINT32 Session
112
);
113
114
EFI_STATUS
115
EFIAPI
116
OpteeInvokeFunction (
117
IN
OUT
OPTEE_INVOKE_FUNCTION_ARG
*InvokeFunctionArg
118
);
119
120
#endif
// OPTEE_LIB_H_
IN
#define IN
Definition:
Base.h:279
OUT
#define OUT
Definition:
Base.h:284
IsOpteePresent
BOOLEAN EFIAPI IsOpteePresent(VOID)
Definition:
Optee.c:30
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
GUID
Definition:
Base.h:213
OPTEE_INVOKE_FUNCTION_ARG
Definition:
OpteeLib.h:82
OPTEE_MESSAGE_ARG
Definition:
OpteeLib.h:61
OPTEE_MESSAGE_PARAM_MEMORY
Definition:
OpteeLib.h:37
OPTEE_MESSAGE_PARAM_VALUE
Definition:
OpteeLib.h:43
OPTEE_MESSAGE_PARAM
Definition:
OpteeLib.h:54
OPTEE_OPEN_SESSION_ARG
Definition:
OpteeLib.h:75
OPTEE_MESSAGE_PARAM_UNION
Definition:
OpteeLib.h:49
ArmPkg
Include
Library
OpteeLib.h
Generated on Fri Nov 15 2024 18:01:04 for TianoCore EDK2 by
1.9.6