]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/OpteeLib/OpteeSmc.h
ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE
[mirror_edk2.git] / ArmPkg / Library / OpteeLib / OpteeSmc.h
1 /** @file
2 OP-TEE SMC header file.
3
4 Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
5
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
10
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.
13
14 **/
15
16 #ifndef _OPTEE_SMC_H_
17 #define _OPTEE_SMC_H_
18
19 /* Returned in Arg0 only from Trusted OS functions */
20 #define OPTEE_SMC_RETURN_OK 0x0
21
22 #define OPTEE_SMC_RETURN_FROM_RPC 0x32000003
23 #define OPTEE_SMC_CALL_WITH_ARG 0x32000004
24 #define OPTEE_SMC_GET_SHARED_MEMORY_CONFIG 0xb2000007
25
26 #define OPTEE_SMC_SHARED_MEMORY_CACHED 1
27
28 #define OPTEE_SMC_RETURN_RPC_FOREIGN_INTERRUPT 0xffff0004
29
30 #define OPTEE_MESSAGE_COMMAND_OPEN_SESSION 0
31 #define OPTEE_MESSAGE_COMMAND_INVOKE_FUNCTION 1
32 #define OPTEE_MESSAGE_COMMAND_CLOSE_SESSION 2
33
34 #define OPTEE_MESSAGE_ATTRIBUTE_META 0x100
35
36 #define OPTEE_LOGIN_PUBLIC 0x0
37
38 typedef struct {
39 UINTN Base;
40 UINTN Size;
41 } OPTEE_SHARED_MEMORY_INFORMATION;
42
43 //
44 // UUID struct compliant with RFC4122 (network byte order).
45 //
46 typedef struct {
47 UINT32 Data1;
48 UINT16 Data2;
49 UINT16 Data3;
50 UINT8 Data4[8];
51 } RFC4122_UUID;
52
53 #endif