1 /** @file
2   OP-TEE SMC header file.
3 
4   Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
5 
6   SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8 **/
9 
10 #ifndef _OPTEE_SMC_H_
11 #define _OPTEE_SMC_H_
12 
13 /* Returned in Arg0 only from Trusted OS functions */
14 #define OPTEE_SMC_RETURN_OK                     0x0
15 
16 #define OPTEE_SMC_RETURN_FROM_RPC               0x32000003
17 #define OPTEE_SMC_CALL_WITH_ARG                 0x32000004
18 #define OPTEE_SMC_GET_SHARED_MEMORY_CONFIG      0xb2000007
19 
20 #define OPTEE_SMC_SHARED_MEMORY_CACHED          1
21 
22 #define OPTEE_SMC_RETURN_UNKNOWN_FUNCTION       0xffffffff
23 #define OPTEE_SMC_RETURN_RPC_PREFIX_MASK        0xffff0000
24 #define OPTEE_SMC_RETURN_RPC_PREFIX             0xffff0000
25 #define OPTEE_SMC_RETURN_RPC_FOREIGN_INTERRUPT  0xffff0004
26 
27 #define OPTEE_MESSAGE_COMMAND_OPEN_SESSION      0
initWithSocketServer:(rtc rtc rtc MacCocoaSocketServer*)28 #define OPTEE_MESSAGE_COMMAND_INVOKE_FUNCTION   1
29 #define OPTEE_MESSAGE_COMMAND_CLOSE_SESSION     2
30 
31 #define OPTEE_MESSAGE_ATTRIBUTE_META            0x100
32 
33 #define OPTEE_LOGIN_PUBLIC                      0x0
34 
35 typedef struct {
36   UINTN    Base;
37   UINTN    Size;
38 } OPTEE_SHARED_MEMORY_INFORMATION;
39 
breakMainloop()40 //
41 // UUID struct compliant with RFC4122 (network byte order).
42 //
43 typedef struct {
44   UINT32  Data1;
45   UINT16  Data2;
46   UINT16  Data3;
47   UINT8   Data4[8];
48 } RFC4122_UUID;
49 
50 #endif
51