]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/Sec: Fixed Monitor stack setup
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Dec 2011 10:22:43 +0000 (10:22 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Dec 2011 10:22:43 +0000 (10:22 +0000)
Because GET_CORE_POS(MpId) returns 0x0 for the primary core, the
stack position must be defined by the top of the stack. It means
stack_size must be added to the stack base.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12858 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/Sec/Sec.c

index b32f4ffb55375b07de49f74926e551156b8dd33b..a32cd3857e3975b56771cdb21c65f21f95455cb5 100644 (file)
@@ -112,7 +112,7 @@ CEntryPoint (
     }
 
     // Enter Monitor Mode
     }
 
     // Enter Monitor Mode
-    enter_monitor_mode ((VOID*)(PcdGet32(PcdCPUCoresSecMonStackBase) + (PcdGet32(PcdCPUCoreSecMonStackSize) * GET_CORE_POS(MpId))));
+    enter_monitor_mode ((VOID*)(PcdGet32(PcdCPUCoresSecMonStackBase) + (PcdGet32(PcdCPUCoreSecMonStackSize) * (GET_CORE_POS(MpId) + 1))));
 
     //Write the monitor mode vector table address
     ArmWriteVMBar((UINT32) &monitor_vector_table);
 
     //Write the monitor mode vector table address
     ArmWriteVMBar((UINT32) &monitor_vector_table);