summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2012-05-02 20:05:36 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2012-05-02 20:05:36 +0000
commit9133aa80a977fcd764a4237af3e9e21afb67881d (patch)
treea1cb44d2abe2cf9c48844128276f57101ae39fcc
parent40ab42ddca705bc0fedce6a933ef3b4787863445 (diff)
downloadedk2-platforms-9133aa80a977fcd764a4237af3e9e21afb67881d.tar.xz
ArmPkg/ArmLib: Fixed MpCore macros
Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13256 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--ArmPkg/Include/Library/ArmLib.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h
index f34ab42ced..6bce7fb739 100644
--- a/ArmPkg/Include/Library/ArmLib.h
+++ b/ArmPkg/Include/Library/ArmLib.h
@@ -89,13 +89,19 @@ typedef enum {
ARM_PROCESSOR_MODE_MASK = 0x1F
} ARM_PROCESSOR_MODE;
+
+//
+// ARM MP Core IDs
+//
#define IS_PRIMARY_CORE(MpId) (((MpId) & PcdGet32(PcdArmPrimaryCoreMask)) == PcdGet32(PcdArmPrimaryCore))
-#define GET_CORE_ID(MpId) ((MpId) & 0xFF)
-#define GET_CLUSTER_ID(MpId) (((MpId) >> 8) & 0xFF)
+#define ARM_CORE_MASK 0xFF
+#define ARM_CLUSTER_MASK (0xFF << 8)
+#define GET_CORE_ID(MpId) ((MpId) & ARM_CORE_MASK)
+#define GET_CLUSTER_ID(MpId) (((MpId) & ARM_CLUSTER_MASK) >> 8)
// Get the position of the core for the Stack Offset (4 Core per Cluster)
// Position = (ClusterId * 4) + CoreId
-#define GET_CORE_POS(MpId) ((((MpId) >> 6) & 0xFF) + ((MpId) & 0xFF))
-#define PRIMARY_CORE_ID (PcdGet32(PcdArmPrimaryCore) & 0xFF)
+#define GET_CORE_POS(MpId) ((((MpId) & ARM_CLUSTER_MASK) >> 6) + ((MpId) & ARM_CORE_MASK))
+#define PRIMARY_CORE_ID (PcdGet32(PcdArmPrimaryCore) & ARM_CORE_MASK)
ARM_CACHE_TYPE
EFIAPI