diff options
author | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-07-20 17:47:44 +0000 |
---|---|---|
committer | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-07-20 17:47:44 +0000 |
commit | f7c8bd9f9d22d3124ef30737dae2fbe49fdacd41 (patch) | |
tree | b299a4f58a1b67e6993c9812fa085cd56d77d95b /MdePkg | |
parent | 2d08d17d651d81d267f00dcfdff0a46013b49907 (diff) | |
download | edk2-platforms-f7c8bd9f9d22d3124ef30737dae2fbe49fdacd41.tar.xz |
MdePkg: Update CpuSleep to use ARMv7 instruction.
The code was using ARMv6 co-processor reg, that is a no-op on ARMv7. WFI is the instruction on ARMv7.
signed-off-by: andrewfish
reviewed-by: mdkinney
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12035 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r-- | MdePkg/Library/BaseCpuLib/Arm/CpuSleep.S | 11 | ||||
-rw-r--r-- | MdePkg/Library/BaseCpuLib/Arm/CpuSleep.asm | 13 |
2 files changed, 17 insertions, 7 deletions
diff --git a/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.S b/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.S index 44160d4c32..2c859306db 100644 --- a/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.S +++ b/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.S @@ -1,6 +1,12 @@ #------------------------------------------------------------------------------
#
-# CpuSleep() for ARM
+# CpuSleep() for ARMv7
+#
+# ARMv6 versions was:
+# MOV r0,#0
+# MCR p15,0,r0,c7,c0,4 ;Wait for Interrupt instruction
+#
+# But this is a no-op on ARMv7
#
# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
@@ -33,6 +39,5 @@ GCC_ASM_EXPORT(CpuSleep) # );
#
ASM_PFX(CpuSleep):
- mov r0,#0
- mcr p15,0,r0,c7,c0,4 // Wait for Interrupt instruction
+ wfi
bx lr
diff --git a/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.asm b/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.asm index 1a18eb0d07..a51e2cd9dd 100644 --- a/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.asm +++ b/MdePkg/Library/BaseCpuLib/Arm/CpuSleep.asm @@ -1,9 +1,15 @@ ;------------------------------------------------------------------------------
;
-; CpuSleep() for ARM
+; CpuSleep() for ARMv7
+;
+; ARMv6 versions was:
+; MOV r0,#0
+; MCR p15,0,r0,c7,c0,4 ;Wait for Interrupt instruction
+;
+; But this is a no-op on ARMv7
;
; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
+; Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
; 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
@@ -32,8 +38,7 @@ ; );
;
CpuSleep
- MOV r0,#0
- MCR p15,0,r0,c7,c0,4 ;Wait for Interrupt instruction
+ WFI
BX LR
END
|