diff options
author | Olivier Martin <olivier.martin@arm.com> | 2014-08-04 14:18:13 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-08-04 14:18:13 +0000 |
commit | b4e53e389d2a04678fb28bc445cd5b554bb175e0 (patch) | |
tree | 02f998bd9cc6b4be7b903943872c0c5a5cbeda6f /ArmPkg/Library/ArmSmcLibNull | |
parent | 9a9dd4e8393177a48e5d8a773ce8aa42566045b9 (diff) | |
download | edk2-b4e53e389d2a04678fb28bc445cd5b554bb175e0.tar.gz edk2-b4e53e389d2a04678fb28bc445cd5b554bb175e0.tar.bz2 edk2-b4e53e389d2a04678fb28bc445cd5b554bb175e0.zip |
ArmPkg/ArmSmcLib: Fixed SMC helper functions
The SMC helper functions were buggy as they were assuming that
the values in x1-x7 registers were preserved across an SMC call,
which is not the case. This patch fixes this issue.
It also simplifies the code by providing only 1 version of the SMC
helper function. We used to have 4 versions depending on the number
of arguments. The problem with this approach was that the number of
arguments also dictated the number of return values, which is
completely unrelated. E.g. you can have an SMC call that takes
1 argument but returns 4 values.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15748 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Library/ArmSmcLibNull')
-rw-r--r-- | ArmPkg/Library/ArmSmcLibNull/AArch64/ArmSmcNull.S | 14 | ||||
-rw-r--r-- | ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.S | 15 | ||||
-rw-r--r-- | ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.asm | 15 |
3 files changed, 3 insertions, 41 deletions
diff --git a/ArmPkg/Library/ArmSmcLibNull/AArch64/ArmSmcNull.S b/ArmPkg/Library/ArmSmcLibNull/AArch64/ArmSmcNull.S index ec6e067ac3..a6ef0e04da 100644 --- a/ArmPkg/Library/ArmSmcLibNull/AArch64/ArmSmcNull.S +++ b/ArmPkg/Library/ArmSmcLibNull/AArch64/ArmSmcNull.S @@ -1,5 +1,5 @@ //
-// Copyright (c) 2012-2013, ARM Limited. All rights reserved.
+// 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
@@ -15,18 +15,6 @@ .align 3
GCC_ASM_EXPORT(ArmCallSmc)
-GCC_ASM_EXPORT(ArmCallSmcArg1)
-GCC_ASM_EXPORT(ArmCallSmcArg2)
-GCC_ASM_EXPORT(ArmCallSmcArg3)
ASM_PFX(ArmCallSmc):
ret
-
-ASM_PFX(ArmCallSmcArg1):
- ret
-
-ASM_PFX(ArmCallSmcArg2):
- ret
-
-ASM_PFX(ArmCallSmcArg3):
- ret
diff --git a/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.S b/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.S index 4896dd0c9b..9eaefd30cf 100644 --- a/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.S +++ b/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.S @@ -1,5 +1,5 @@ //
-// Copyright (c) 2012-2013, ARM Limited. All rights reserved.
+// 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
@@ -15,19 +15,6 @@ .align 3
GCC_ASM_EXPORT(ArmCallSmc)
-GCC_ASM_EXPORT(ArmCallSmcArg1)
-GCC_ASM_EXPORT(ArmCallSmcArg2)
-GCC_ASM_EXPORT(ArmCallSmcArg3)
ASM_PFX(ArmCallSmc):
bx lr
-
-// Arg1 in R1
-ASM_PFX(ArmCallSmcArg1):
- bx lr
-
-ASM_PFX(ArmCallSmcArg2):
- bx lr
-
-ASM_PFX(ArmCallSmcArg3):
- bx lr
diff --git a/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.asm b/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.asm index 24c20752e3..3d3f554554 100644 --- a/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.asm +++ b/ArmPkg/Library/ArmSmcLibNull/Arm/ArmSmcNull.asm @@ -1,5 +1,5 @@ //
-// Copyright (c) 2012-2013, ARM Limited. All rights reserved.
+// 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
@@ -12,23 +12,10 @@ //
EXPORT ArmCallSmc
- EXPORT ArmCallSmcArg1
- EXPORT ArmCallSmcArg2
- EXPORT ArmCallSmcArg3
AREA ArmSmc, CODE, READONLY
ArmCallSmc
bx lr
-// Arg1 in R1
-ArmCallSmcArg1
- bx lr
-
-ArmCallSmcArg2
- bx lr
-
-ArmCallSmcArg3
- bx lr
-
END
|