2 OP-TEE specific header file.
4 Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 * The 'Trusted OS Call UID' is supposed to return the following UUID for
21 * OP-TEE OS. This is a 128-bit value.
23 #define OPTEE_OS_UID0 0x384fb3e0
24 #define OPTEE_OS_UID1 0xe7f811e3
25 #define OPTEE_OS_UID2 0xaf630002
26 #define OPTEE_OS_UID3 0xa5d5c51b
28 #define OPTEE_MESSAGE_ATTRIBUTE_TYPE_NONE 0x0
29 #define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INPUT 0x1
30 #define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_OUTPUT 0x2
31 #define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INOUT 0x3
32 #define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INPUT 0x9
33 #define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_OUTPUT 0xa
34 #define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INOUT 0xb
36 #define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MASK 0xff
38 #define OPTEE_ORIGIN_COMMUNICATION 0x00000002
39 #define OPTEE_ERROR_COMMUNICATION 0xFFFF000E
44 UINT64 SharedMemoryReference
;
45 } OPTEE_MESSAGE_PARAM_MEMORY
;
51 } OPTEE_MESSAGE_PARAM_VALUE
;
56 OPTEE_MESSAGE_PARAM_MEMORY Memory
;
57 OPTEE_MESSAGE_PARAM_VALUE Value
;
59 } OPTEE_MESSAGE_PARAM
;
61 #define OPTEE_MAX_CALL_PARAMS 4
73 // NumParams tells the actual number of element in Params
74 OPTEE_MESSAGE_PARAM Params
[OPTEE_MAX_CALL_PARAMS
];
78 EFI_GUID Uuid
; // [in] GUID/UUID of the Trusted Application
79 UINT32 Session
; // [out] Session id
80 UINT32 Return
; // [out] Return value
81 UINT32 ReturnOrigin
; // [out] Origin of the return value
82 } OPTEE_OPEN_SESSION_ARG
;
85 UINT32 Function
; // [in] Trusted Application function, specific to the TA
86 UINT32 Session
; // [in] Session id
87 UINT32 Return
; // [out] Return value
88 UINT32 ReturnOrigin
; // [out] Origin of the return value
89 OPTEE_MESSAGE_PARAM Params
[OPTEE_MAX_CALL_PARAMS
]; // Params for function to be invoked
90 } OPTEE_INVOKE_FUNCTION_ARG
;
107 IN OUT OPTEE_OPEN_SESSION_ARG
*OpenSessionArg
118 OpteeInvokeFunction (
119 IN OUT OPTEE_INVOKE_FUNCTION_ARG
*InvokeFunctionArg