diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-22 23:05:20 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-09-22 23:05:20 +0000 |
commit | 2dbcb8f0a3250395c0ea8436ac519b6908dc0ee7 (patch) | |
tree | fcc7592f5e22d5f0cc56be5339176545d885be52 /ArmPkg/Include/AsmMacroIoLib.inc | |
parent | f156d5b49d3f1c3dd1a9dc3c9b6d94b02c056ad1 (diff) | |
download | edk2-platforms-2dbcb8f0a3250395c0ea8436ac519b6908dc0ee7.tar.xz |
ArmPlatformPkg: Changed memory model for the stacks
In the previous version, every cores had the same stack size.
To avoid to waste memory with secondary core stacks, the primary core stack
size is now different from the secondary cores stack size.
These are the Stack PCDs and their default values:
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecPrimaryStackSize|0x10000
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecSecondaryStackSize|0x1000
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase|0
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecMonStackSize|0x1000
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x10000
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize|0x1000
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12415 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Include/AsmMacroIoLib.inc')
-rw-r--r-- | ArmPkg/Include/AsmMacroIoLib.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ArmPkg/Include/AsmMacroIoLib.inc b/ArmPkg/Include/AsmMacroIoLib.inc index 78e2ae2945..5644bf9b30 100644 --- a/ArmPkg/Include/AsmMacroIoLib.inc +++ b/ArmPkg/Include/AsmMacroIoLib.inc @@ -77,5 +77,21 @@ LoadConstantToRegMacro $Data, $Reg
ldr $Reg, =($Data)
MEND
+
+ MACRO
+ GetCorePositionInStack $Pos, $MpId, $Tmp
+ lsr $Pos, $MpId, #6
+ and $Tmp, $MpId, #3
+ add $Pos, $Pos, $Tmp
+ MEND
+
+ ; The reserved place must be 8-bytes aligned for pushing 64-bit variable on the stack
+ MACRO
+ SetPrimaryStack $StackTop, $GlobalSize, $Tmp
+ and $Tmp, $GlobalSize, #7
+ rsbne $Tmp, $Tmp, #8
+ add $GlobalSize, $GlobalSize, $Tmp
+ sub sp, $StackTop, $GlobalSize
+ MEND
END
|