X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPkg%2FInclude%2FAsmMacroIoLib.h;h=c5073297417568a7ced154547a70fbb4cf31ffc0;hp=c8692fcfd71e7cd70f3677ea17fee105d32cc3f7;hb=bebda7ceec3d3024c76b3c2ed0c9b4e502a13d61;hpb=bc7b889a033a2617b650fbb5596d4f02530090bd diff --git a/ArmPkg/Include/AsmMacroIoLib.h b/ArmPkg/Include/AsmMacroIoLib.h index c8692fcfd7..c507329741 100644 --- a/ArmPkg/Include/AsmMacroIoLib.h +++ b/ArmPkg/Include/AsmMacroIoLib.h @@ -122,9 +122,12 @@ // Convert the (ClusterId,CoreId) into a Core Position // We assume there are 4 cores per cluster -#define GetCorePositionFromMpId(Pos, MpId, Tmp) \ - lsr Pos, MpId, #6 ; \ - and Tmp, MpId, #3 ; \ +// Note: 0xFFFF is the magic value for ARM_CORE_MASK | ARM_CLUSTER_MASK +#define GetCorePositionFromMpId(Pos, MpId, Tmp) \ + ldr Tmp, =0xFFFF \ + and MpId, Tmp \ + lsr Pos, MpId, #6 ; \ + and Tmp, MpId, #3 ; \ add Pos, Pos, Tmp // Reserve a region at the top of the Primary Core stack @@ -207,10 +210,15 @@ _InitializePrimaryStackEnd: #define LoadConstantToReg(Data, Reg) \ ldr Reg, =Data - -#define GetCorePositionFromMpId(Pos, MpId, Tmp) \ - lsr Pos, MpId, #6 ; \ - and Tmp, MpId, #3 ; \ + +// Convert the (ClusterId,CoreId) into a Core Position +// We assume there are 4 cores per cluster +// Note: 0xFFFF is the magic value for ARM_CORE_MASK | ARM_CLUSTER_MASK +#define GetCorePositionFromMpId(Pos, MpId, Tmp) \ + ldr Tmp, =0xFFFF ; \ + and MpId, Tmp ; \ + lsr Pos, MpId, #6 ; \ + and Tmp, MpId, #3 ; \ add Pos, Pos, Tmp #define SetPrimaryStack(StackTop, GlobalSize, Tmp) \