summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Include/Library/ArmHvcLib.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2014-09-10 18:46:23 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2014-09-10 18:46:23 +0000
commit58e92b394ee359d2768abdace4dab7baf73c1231 (patch)
treec723c4befc93ae50846029ab809e2125dc1de9a3 /ArmPkg/Include/Library/ArmHvcLib.h
parentae9bc0576c6aac3ee2f1aaa4e44f611eb706ec90 (diff)
downloadedk2-58e92b394ee359d2768abdace4dab7baf73c1231.tar.gz
edk2-58e92b394ee359d2768abdace4dab7baf73c1231.tar.bz2
edk2-58e92b394ee359d2768abdace4dab7baf73c1231.zip
ArmPkg: Add ArmHvcLib
This is a utility library closely modeled after ArmSmcLib, that allows hypervisor call (HVC) instructions to be issued from C code. Change-Id: I5f5c65f83e910ff98dbb2f5b031dad8c4f663daa Contributed-under: TianoCore Contribution Agreement 1.0 Acked-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16088 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Include/Library/ArmHvcLib.h')
-rw-r--r--ArmPkg/Include/Library/ArmHvcLib.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/ArmPkg/Include/Library/ArmHvcLib.h b/ArmPkg/Include/Library/ArmHvcLib.h
new file mode 100644
index 0000000000..4e9d1c4011
--- /dev/null
+++ b/ArmPkg/Include/Library/ArmHvcLib.h
@@ -0,0 +1,46 @@
+/** @file
+*
+* Copyright (c) 2012-2014, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
+
+#ifndef __ARM_HVC_LIB__
+#define __ARM_HVC_LIB__
+
+/**
+ * The size of the HVC arguments are different between AArch64 and AArch32.
+ * The native size is used for the arguments.
+ */
+typedef struct {
+ UINTN Arg0;
+ UINTN Arg1;
+ UINTN Arg2;
+ UINTN Arg3;
+ UINTN Arg4;
+ UINTN Arg5;
+ UINTN Arg6;
+ UINTN Arg7;
+} ARM_HVC_ARGS;
+
+/**
+ Trigger an HVC call
+
+ HVC calls can take up to 8 arguments and return up to 4 return values.
+ Therefore, the 4 first fields in the ARM_HVC_ARGS structure are used
+ for both input and output values.
+
+**/
+VOID
+ArmCallHvc (
+ IN OUT ARM_HVC_ARGS *Args
+ );
+
+#endif