]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Update CpuSleep to use ARMv7 instruction.
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 Jul 2011 17:47:44 +0000 (17:47 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 Jul 2011 17:47:44 +0000 (17:47 +0000)
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

MdePkg/Library/BaseCpuLib/Arm/CpuSleep.S
MdePkg/Library/BaseCpuLib/Arm/CpuSleep.asm

index 44160d4c32f887c8df731b5000426a7e800d296f..2c859306db0891c75cbfab7bab230f0d0905fc6f 100644 (file)
@@ -1,6 +1,12 @@
 #------------------------------------------------------------------------------ \r
 #\r
-# CpuSleep() for ARM\r
+# CpuSleep() for ARMv7\r
+#\r
+# ARMv6 versions was:\r
+#    MOV r0,#0\r
+#    MCR p15,0,r0,c7,c0,4   ;Wait for Interrupt instruction\r
+#\r
+# But this is a no-op on ARMv7\r
 #\r
 # Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
@@ -33,6 +39,5 @@ GCC_ASM_EXPORT(CpuSleep)
 #  );\r
 #\r
 ASM_PFX(CpuSleep):\r
-    mov r0,#0\r
-    mcr p15,0,r0,c7,c0,4   // Wait for Interrupt instruction\r
+    wfi\r
     bx  lr\r
index 1a18eb0d071e483aaca8e90b72deb028839000d5..a51e2cd9dd02fa3e9e80f8d0f37242b1fb49f0b4 100644 (file)
@@ -1,9 +1,15 @@
 ;------------------------------------------------------------------------------ \r
 ;\r
-; CpuSleep() for ARM\r
+; CpuSleep() for ARMv7\r
+;\r
+; ARMv6 versions was:\r
+;    MOV r0,#0\r
+;    MCR p15,0,r0,c7,c0,4   ;Wait for Interrupt instruction\r
+;\r
+; But this is a no-op on ARMv7\r
 ;\r
 ; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
-; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+; Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -32,8 +38,7 @@
 ;  );\r
 ;\r
 CpuSleep\r
-    MOV r0,#0\r
-    MCR p15,0,r0,c7,c0,4   ;Wait for Interrupt instruction\r
+    WFI\r
     BX LR\r
 \r
   END\r