diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-05-02 20:05:36 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-05-02 20:05:36 +0000 |
commit | 9133aa80a977fcd764a4237af3e9e21afb67881d (patch) | |
tree | a1cb44d2abe2cf9c48844128276f57101ae39fcc /ArmPkg | |
parent | 40ab42ddca705bc0fedce6a933ef3b4787863445 (diff) | |
download | edk2-9133aa80a977fcd764a4237af3e9e21afb67881d.zip edk2-9133aa80a977fcd764a4237af3e9e21afb67881d.tar.gz edk2-9133aa80a977fcd764a4237af3e9e21afb67881d.tar.bz2 |
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
Diffstat (limited to 'ArmPkg')
-rw-r--r-- | ArmPkg/Include/Library/ArmLib.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h index f34ab42..6bce7fb 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 |