ArmPlatformPkg/Sec: Fix transition to Trusted Monitor World with ARMGCC

The enter_monitor_world() function was trashing r0/r1/r2 registers and then
was returning back to 'C'. The compiler might have used these registers in the C code.
These new design prevents register corruptions.



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13060 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
oliviermartin
2012-02-28 17:28:44 +00:00
parent 8cc852f791
commit a853088911
4 changed files with 98 additions and 54 deletions

View File

@@ -1,7 +1,7 @@
/** @file
* Main file supporting the SEC Phase on ARM PLatforms
*
* Copyright (c) 2011, ARM Limited. All rights reserved.
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
@@ -26,10 +26,20 @@
#define IS_ALIGNED(Address, Align) (((UINTN)Address & (Align-1)) == 0)
VOID
TrustedWorldInitialization (
IN UINTN MpId
);
VOID
NonTrustedWorldTransition (
IN UINTN MpId
);
VOID
ArmSetupGicNonSecure (
IN INTN GicDistributorBase,
IN INTN GicInterruptInterfaceBase
IN INTN GicDistributorBase,
IN INTN GicInterruptInterfaceBase
);
// Vector Table for Sec Phase
@@ -45,12 +55,14 @@ NonSecureWaitForFirmware (
VOID
enter_monitor_mode (
IN VOID* Stack
IN UINTN MonitorEntryPoint,
IN UINTN MpId,
IN VOID* Stack
);
VOID
return_from_exception (
IN UINTN NonSecureBase
IN UINTN NonSecureBase
);
VOID
@@ -60,7 +72,7 @@ copy_cpsr_into_spsr (
VOID
set_non_secure_mode (
IN ARM_PROCESSOR_MODE Mode
IN ARM_PROCESSOR_MODE Mode
);
VOID