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
37typedef struct {
38 UINT64 BufferAddress;
39 UINT64 Size;
40 UINT64 SharedMemoryReference;
42
43typedef struct {
44 UINT64 A;
45 UINT64 B;
46 UINT64 C;
48
49typedef union {
53
54typedef struct {
55 UINT64 Attribute;
58
59#define OPTEE_MAX_CALL_PARAMS 4
60
61typedef 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];
74
75typedef 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
81
82typedef 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
89
90BOOLEAN
91EFIAPI
93 VOID
94 );
95
97EFIAPI
98OpteeInit (
99 VOID
100 );
101
103EFIAPI
104OpteeOpenSession (
105 IN OUT OPTEE_OPEN_SESSION_ARG *OpenSessionArg
106 );
107
109EFIAPI
110OpteeCloseSession (
111 IN UINT32 Session
112 );
113
115EFIAPI
116OpteeInvokeFunction (
117 IN OUT OPTEE_INVOKE_FUNCTION_ARG *InvokeFunctionArg
118 );
119
120#endif // OPTEE_LIB_H_
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
BOOLEAN EFIAPI IsOpteePresent(VOID)
Definition: Optee.c:30
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213