]>
git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/OpteeLib/Optee.c
2 Api's to communicate with OP-TEE OS (Trusted OS based on ARM TrustZone) via
5 Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Library/ArmSmcLib.h>
18 #include <Library/BaseLib.h>
19 #include <Library/OpteeLib.h>
21 #include <IndustryStandard/ArmStdSmc.h>
24 Check for OP-TEE presence.
32 ARM_SMC_ARGS ArmSmcArgs
;
34 // Send a Trusted OS Calls UID command
35 ArmSmcArgs
.Arg0
= ARM_SMC_ID_TOS_UID
;
36 ArmCallSmc (&ArmSmcArgs
);
38 if ((ArmSmcArgs
.Arg0
== OPTEE_OS_UID0
) &&
39 (ArmSmcArgs
.Arg1
== OPTEE_OS_UID1
) &&
40 (ArmSmcArgs
.Arg2
== OPTEE_OS_UID2
) &&
41 (ArmSmcArgs
.Arg3
== OPTEE_OS_UID3
)) {