]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/BaseCpuLib: Added ARM Aarch64 architecture support
authorHarry Liebel <Harry.Liebel@arm.com>
Mon, 29 Jul 2013 09:56:36 +0000 (09:56 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 29 Jul 2013 09:56:36 +0000 (09:56 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14516 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S [new file with mode: 0644]
MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S [new file with mode: 0644]
MdePkg/Library/BaseCpuLib/BaseCpuLib.inf

diff --git a/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S b/MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S
new file mode 100644 (file)
index 0000000..8e12bdd
--- /dev/null
@@ -0,0 +1,38 @@
+#------------------------------------------------------------------------------\r
+#\r
+# CpuFlushTlb() for ARM\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) 2011 - 2013, ARM Ltd. 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
+# http://opensource.org/licenses/bsd-license.php.\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+.text\r
+.p2align 2\r
+ASM_GLOBAL ASM_PFX(CpuFlushTlb)\r
+\r
+#/**\r
+#  Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.\r
+#\r
+#  Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.\r
+#\r
+#**/\r
+#VOID\r
+#EFIAPI\r
+#CpuFlushTlb (\r
+#  VOID\r
+#  )#\r
+#\r
+ASM_PFX(CpuFlushTlb):\r
+  tlbi  vmalle1                 // Invalidate Inst TLB and Data TLB\r
+  dsb   sy\r
+  isb\r
+  ret\r
diff --git a/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S b/MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S
new file mode 100644 (file)
index 0000000..86c3e63
--- /dev/null
@@ -0,0 +1,39 @@
+#------------------------------------------------------------------------------\r
+#\r
+# CpuSleep() for AArch64\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) 2011 - 2013, ARM LTD. 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
+# http://opensource.org/licenses/bsd-license.php.\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+.text\r
+.align 3\r
+ASM_GLOBAL ASM_PFX(CpuSleep)\r
+\r
+#/**\r
+#  Places the CPU in a sleep state until an interrupt is received.\r
+#\r
+#  Places the CPU in a sleep state until an interrupt is received. If interrupts\r
+#  are disabled prior to calling this function, then the CPU will be placed in a\r
+#  sleep state indefinitely.\r
+#\r
+#**/\r
+#VOID\r
+#EFIAPI\r
+#CpuSleep (\r
+#  VOID\r
+#  );\r
+#\r
+\r
+ASM_PFX(CpuSleep):\r
+    wfi\r
+    ret\r
index 5d64b455de68f03d210b0a0c37b47eb227355903..3e9f41312cfb8763bdfc58a6490fce2b2e0fdc08 100644 (file)
@@ -6,6 +6,7 @@
 #\r
 #  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+#  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -27,7 +28,7 @@
 \r
 \r
 #\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC ARM\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC ARM AARCH64\r
 #\r
 \r
 [Sources.IA32]\r
   Arm/CpuFlushTlb.S   | GCC\r
   Arm/CpuSleep.S      | GCC  \r
 \r
+[Sources.AARCH64]\r
+  AArch64/CpuFlushTlb.S | GCC\r
+  AArch64/CpuSleep.S    | GCC\r
+\r
 [Packages]\r
   MdePkg/MdePkg.dec\r
 \r