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_SUCCESS 0x00000000
39 #define OPTEE_ORIGIN_COMMUNICATION 0x00000002
40 #define OPTEE_ERROR_COMMUNICATION 0xFFFF000E
45 UINT64 SharedMemoryReference
;
46 } OPTEE_MESSAGE_PARAM_MEMORY
;
52 } OPTEE_MESSAGE_PARAM_VALUE
;
57 OPTEE_MESSAGE_PARAM_MEMORY Memory
;
58 OPTEE_MESSAGE_PARAM_VALUE Value
;
60 } OPTEE_MESSAGE_PARAM
;
62 #define OPTEE_MAX_CALL_PARAMS 4
74 // NumParams tells the actual number of element in Params
75 OPTEE_MESSAGE_PARAM Params
[OPTEE_MAX_CALL_PARAMS
];
79 EFI_GUID Uuid
; // [in] GUID/UUID of the Trusted Application
80 UINT32 Session
; // [out] Session id
81 UINT32 Return
; // [out] Return value
82 UINT32 ReturnOrigin
; // [out] Origin of the return value
83 } OPTEE_OPEN_SESSION_ARG
;
86 UINT32 Function
; // [in] Trusted Application function, specific to the TA
87 UINT32 Session
; // [in] Session id
88 UINT32 Return
; // [out] Return value
89 UINT32 ReturnOrigin
; // [out] Origin of the return value
90 OPTEE_MESSAGE_PARAM Params
[OPTEE_MAX_CALL_PARAMS
]; // Params for function to be invoked
91 } OPTEE_INVOKE_FUNCTION_ARG
;
108 IN OUT OPTEE_OPEN_SESSION_ARG
*OpenSessionArg
119 OpteeInvokeFunction (
120 IN OUT OPTEE_INVOKE_FUNCTION_ARG
*InvokeFunctionArg