]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/ArmLib: Added ArmReadMidr()
authorOlivier Martin <olivier.martin@arm.com>
Wed, 12 Feb 2014 15:14:41 +0000 (15:14 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 12 Feb 2014 15:14:41 +0000 (15:14 +0000)
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@15240 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Include/Library/ArmLib.h
ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
ArmPkg/Library/ArmLib/Arm11/Arm11Support.S
ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S
ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm

index b874b29c672a21aba6a6d37afc00be7f58e6fbbb..1726984f5baf142672fb7b73904293f62f8dbf0f 100644 (file)
@@ -535,6 +535,12 @@ ArmReadMpidr (
   VOID\r
   );\r
 \r
+UINTN\r
+EFIAPI\r
+ArmReadMidr (\r
+  VOID\r
+  );\r
+\r
 UINT32\r
 EFIAPI\r
 ArmReadCpacr (\r
index 29251c9961ec9148c4a12378685510293e9bf061..5901ffacd4405cc682be5855a34f2412461adaca 100644 (file)
@@ -1,7 +1,7 @@
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-# Copyright (c) 2011 - 2013, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
 #\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
@@ -50,6 +50,7 @@ GCC_ASM_EXPORT (ArmEnableVFP)
 GCC_ASM_EXPORT (ArmCallWFI)\r
 GCC_ASM_EXPORT (ArmInvalidateInstructionAndDataTlb)\r
 GCC_ASM_EXPORT (ArmReadMpidr)\r
+GCC_ASM_EXPORT (ArmReadMidr)\r
 GCC_ASM_EXPORT (ArmReadTpidrurw)\r
 GCC_ASM_EXPORT (ArmWriteTpidrurw)\r
 GCC_ASM_EXPORT (ArmIsArchTimerImplemented)\r
@@ -457,6 +458,9 @@ ASM_PFX(ArmReadMpidr):
   mrs   x0, mpidr_el1           // read EL1 MPIDR\r
   ret\r
 \r
+ASM_PFX(ArmReadMidr):\r
+  mrs   x0, midr_el1            // Read Main ID Register\r
+  ret\r
 \r
 // Keep old function names for C compatibilty for now. Change later?\r
 ASM_PFX(ArmReadTpidrurw):\r
index 2f4be7e93f54495c31ee37a2ec9130f1e49d1f3b..e18023e6ae66b84ac3b815d3ba2b0149df5712a0 100644 (file)
@@ -43,6 +43,7 @@ GCC_ASM_EXPORT(ArmSetHighVectors)
 GCC_ASM_EXPORT(ArmIsMpCore)\r
 GCC_ASM_EXPORT(ArmCallWFI)\r
 GCC_ASM_EXPORT(ArmReadMpidr)\r
+GCC_ASM_EXPORT(ArmReadMidr)\r
 GCC_ASM_EXPORT(ArmUpdateTranslationTableEntry)\r
 GCC_ASM_EXPORT(ArmEnableFiq)\r
 GCC_ASM_EXPORT(ArmDisableFiq)\r
@@ -216,6 +217,10 @@ ASM_PFX(ArmReadMpidr):
   mrc     p15, 0, r0, c0, c0, 5       @ read MPIDR\r
   bx      lr\r
 \r
+ASM_PFX(ArmReadMpidr):\r
+  mrc     p15, 0, r0, c0, c0, 0       @ Read Main ID Register\r
+  bx      lr\r
+\r
 ASM_PFX(ArmEnableFiq):\r
   mrs     R0,CPSR\r
   bic     R0,R0,#0x40    @Enable FIQ interrupts\r
index ee6eb417092222ace285fcec146c7b40187bf3a7..d402118ce2ccdc8fe26605cd517416ff90a534a2 100644 (file)
@@ -1,7 +1,7 @@
 #------------------------------------------------------------------------------ \r
 #\r
 # Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-# Copyright (c) 2011, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
 #\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
@@ -49,6 +49,7 @@ GCC_ASM_EXPORT (ArmCallWFI)
 GCC_ASM_EXPORT (ArmReadCbar)\r
 GCC_ASM_EXPORT (ArmInvalidateInstructionAndDataTlb)\r
 GCC_ASM_EXPORT (ArmReadMpidr)\r
+GCC_ASM_EXPORT (ArmReadMidr)\r
 GCC_ASM_EXPORT (ArmReadTpidrurw)\r
 GCC_ASM_EXPORT (ArmWriteTpidrurw)\r
 GCC_ASM_EXPORT (ArmIsArchTimerImplemented)\r
@@ -376,7 +377,11 @@ ASM_PFX(ArmInvalidateInstructionAndDataTlb):
 ASM_PFX(ArmReadMpidr):\r
   mrc     p15, 0, r0, c0, c0, 5       @ read MPIDR\r
   bx      lr\r
-  \r
+\r
+ASM_PFX(ArmReadMidr):\r
+  mrc     p15, 0, r0, c0, c0, 0       @ Read Main ID Register\r
+  bx      lr\r
+\r
 ASM_PFX(ArmReadTpidrurw):\r
   mrc     p15, 0, r0, c13, c0, 2    @ read TPIDRURW\r
   bx      lr\r
index e75438844d9c96e18e04430adb63e60d72113b12..8eee50dcfde51067b5badef1a8779bf75c5fcd83 100644 (file)
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------ \r
 //\r
 // Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-// Copyright (c) 2011, ARM Limited. All rights reserved.\r
+// Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
 //\r
 // This program and the accompanying materials\r
 // are licensed and made available under the terms and conditions of the BSD License\r
@@ -46,6 +46,7 @@
     EXPORT  ArmReadCbar\r
     EXPORT  ArmInvalidateInstructionAndDataTlb\r
     EXPORT  ArmReadMpidr\r
+    EXPORT  ArmReadMidr\r
     EXPORT  ArmReadTpidrurw\r
     EXPORT  ArmWriteTpidrurw\r
     EXPORT  ArmIsArchTimerImplemented\r
@@ -371,6 +372,10 @@ ArmReadMpidr
   mrc     p15, 0, r0, c0, c0, 5     ; read MPIDR\r
   bx      lr\r
 \r
+ArmReadMidr\r
+  mrc     p15, 0, r0, c0, c0, 0      ; Read Main ID Register\r
+  bx      lr\r
+\r
 ArmReadTpidrurw\r
   mrc     p15, 0, r0, c13, c0, 2    ; read TPIDRURW\r
   bx      lr\r