[LibraryClasses.common.SEC]\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf\r
ArmPlatformLib|ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNullSec.inf\r
+ ArmTrustedMonitorLib|ArmPlatformPkg/Library/ArmTrustedMonitorLibNull/ArmTrustedMonitorLibNull.inf\r
\r
ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf\r
ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf\r
#\r
-# Copyright (c) 2011, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
# \r
# This program and the accompanying materials \r
# are licensed and made available under the terms and conditions of the BSD License \r
[LibraryClasses.common.SEC]\r
ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf\r
ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf\r
+ ArmTrustedMonitorLib|ArmPlatformPkg/Library/ArmTrustedMonitorLibNull/ArmTrustedMonitorLibNull.inf\r
\r
DebugAgentLib|ArmPkg/Library/DebugAgentSymbolsOnlyLib/DebugAgentSymbolsOnlyLib.inf\r
# Uncomment to turn on GDB stub in SEC. \r
#\r
-# Copyright (c) 2011, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
# \r
# This program and the accompanying materials \r
# are licensed and made available under the terms and conditions of the BSD License \r
MemoryInitPeiLib|ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf\r
!endif\r
\r
+ # Trustzone Support\r
+ ArmTrustedMonitorLib|ArmPlatformPkg/Library/ArmTrustedMonitorLibNull/ArmTrustedMonitorLibNull.inf\r
+\r
[LibraryClasses.common.PEI_CORE]\r
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
--- /dev/null
+/** @file\r
+* Main file supporting the Monitor World on ARM PLatforms\r
+*\r
+* Copyright (c) 2011, ARM Limited. All rights reserved.\r
+*\r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+*\r
+**/\r
+\r
+#ifndef __ARM_TRUSTED_MONITOR_LIB_H_\r
+#define __ARM_TRUSTED_MONITOR_LIB_H_\r
+\r
+VOID\r
+ArmSecureMonitorWorldInitialize (\r
+ VOID\r
+ );\r
+\r
+#endif\r
--- /dev/null
+/** @file\r
+* Main file supporting the Monitor World on ARM PLatforms\r
+*\r
+* Copyright (c) 2011, ARM Limited. All rights reserved.\r
+*\r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+*\r
+**/\r
+\r
+#include <Library/ArmLib.h>\r
+#include <Library/ArmTrustedMonitorLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+#define IS_ALIGNED(Address, Align) (((UINTN)Address & (Align-1)) == 0)\r
+\r
+VOID\r
+MonitorVectorTable (\r
+ VOID\r
+ );\r
+\r
+VOID\r
+ArmSecureMonitorWorldInitialize (\r
+ VOID\r
+ )\r
+{\r
+ // Ensure the Monitor Table is 32bit aligned\r
+ ASSERT (IS_ALIGNED(MonitorVectorTable, BIT5));\r
+\r
+ // Write the Monitor Mode Vector Table Address\r
+ ArmWriteVMBar ((UINT32) &MonitorVectorTable);\r
+}\r
--- /dev/null
+#/* @file\r
+# Copyright (c) 2011, ARM Limited. All rights reserved.\r
+# \r
+# This program and the accompanying materials \r
+# are licensed and made available under the terms and conditions of the BSD License \r
+# which accompanies this distribution. The full text of the license may be found at \r
+# http://opensource.org/licenses/bsd-license.php \r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+#\r
+#*/\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = ArmTrustedMonitorLibNull\r
+ FILE_GUID = c4b50eb2-ed16-4283-a5b0-a7341c3f997b\r
+ MODULE_TYPE = BASE\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = ArmTrustedMonitorLib\r
+\r
+[Sources.common]\r
+ ArmTrustedMonitorLibNull.c\r
+ MonitorTable.asm | RVCT\r
+ MonitorTable.S | GCC\r
+\r
+[Packages]\r
+ ArmPkg/ArmPkg.dec\r
+ ArmPlatformPkg/ArmPlatformPkg.dec\r
+ MdePkg/MdePkg.dec\r
+\r
+[LibraryClasses]\r
+ ArmLib\r
+ BaseLib\r
+ DebugLib\r
+ PcdLib\r
+
\ No newline at end of file
--- /dev/null
+//\r
+// Copyright (c) 2011, ARM Limited. All rights reserved.\r
+//\r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+//\r
+//\r
+\r
+#include <AsmMacroIoLib.h>\r
+#include <AutoGen.h>\r
+#include <Library/PcdLib.h>\r
+\r
+.text\r
+.align 5\r
+\r
+GCC_ASM_EXPORT(MonitorVectorTable)\r
+\r
+ASM_PFX(MonitorVectorTable):\r
+\r
+_MonitorResetEntry:\r
+ b _MonitorResetEntry\r
+_MonitorUndefinedEntry:\r
+ b _MonitorUndefinedEntry\r
+_MonitorSmcEntry:\r
+ b _MonitorSmcEntry\r
+_MonitorPrefetchEntry:\r
+ b _MonitorPrefetchEntry\r
+_MonitorDataAbortEntry:\r
+ b _MonitorDataAbortEntry\r
+_MonitorReservedEntry:\r
+ b _MonitorReservedEntry\r
+_MonitorIrqEntry:\r
+ b _MonitorIrqEntry\r
+_MonitorFiqEntry:\r
+ b _MonitorFiqEntry\r
+\r
--- /dev/null
+//\r
+// Copyright (c) 2011, ARM Limited. All rights reserved.\r
+//\r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+//\r
+//\r
+\r
+#include <Library/PcdLib.h>\r
+\r
+ EXPORT MonitorVectorTable\r
+\r
+ PRESERVE8\r
+ AREA MonitoVectorTableArea, CODE, READONLY, CODEALIGN, ALIGN=5\r
+\r
+MonitorVectorTable\r
+\r
+_MonitorResetEntry\r
+ b _MonitorResetEntry\r
+_MonitorUndefinedEntry\r
+ b _MonitorUndefinedEntry\r
+_MonitorSmcEntry\r
+ b _MonitorSmcEntry\r
+_MonitorPrefetchEntry\r
+ b _MonitorPrefetchEntry\r
+_MonitorDataAbortEntry\r
+ b _MonitorDataAbortEntry\r
+_MonitorReservedEntry\r
+ b _MonitorReservedEntry\r
+_MonitorIrqEntry\r
+ b _MonitorIrqEntry\r
+_MonitorFiqEntry\r
+ b _MonitorFiqEntry\r
+\r
+ END\r
#========================================================================================\r
-# Copyright (c) 2011, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
# \r
# This program and the accompanying materials \r
# are licensed and made available under the terms and conditions of the BSD License \r
.text \r
.align 3\r
\r
-GCC_ASM_EXPORT(monitor_vector_table)\r
GCC_ASM_EXPORT(return_from_exception)\r
GCC_ASM_EXPORT(enter_monitor_mode)\r
GCC_ASM_EXPORT(copy_cpsr_into_spsr)\r
GCC_ASM_EXPORT(set_non_secure_mode)\r
\r
-ASM_PFX(monitor_vector_table):\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
-\r
# arg0: Secure Monitor mode stack\r
ASM_PFX(enter_monitor_mode):\r
mov r2, lr @ Save current lr\r
//\r
-// Copyright (c) 2011, ARM Limited. All rights reserved.\r
+// Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
// \r
// This program and the accompanying materials \r
// are licensed and made available under the terms and conditions of the BSD License \r
//\r
//\r
\r
- EXPORT monitor_vector_table\r
EXPORT return_from_exception\r
EXPORT enter_monitor_mode\r
EXPORT copy_cpsr_into_spsr\r
\r
AREA Helper, CODE, READONLY\r
\r
- ALIGN 32\r
-monitor_vector_table\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
- ldr pc, dead\r
-\r
// arg0: Secure Monitor mode stack\r
enter_monitor_mode\r
mov r2, lr // Save current lr\r
/** @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
*
**/
+#include <Library/ArmTrustedMonitorLib.h>
#include <Library/DebugAgentLib.h>
#include <Library/PrintLib.h>
#include <Library/BaseMemoryLib.h>
#define SerialPrint(txt) SerialPortWrite ((UINT8*)txt, AsciiStrLen(txt)+1);
-extern VOID *monitor_vector_table;
-
VOID
CEntryPoint (
IN UINTN MpId
// Enter Monitor Mode
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);
+ //-------------------- Monitor Mode ---------------------
+
+ // Set up Monitor World (Vector Table, etc)
+ ArmSecureMonitorWorldInitialize ();
- //-------------------- Monitor Mode ---------------------
// Setup the Trustzone Chipsets
if (IS_PRIMARY_CORE(MpId)) {
ArmPlatformTrustzoneInit ();
#/** @file\r
# SEC - Reset vector code that jumps to C and loads DXE core\r
# \r
-# Copyright (c) 2011, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
# \r
# This program and the accompanying materials \r
# are licensed and made available under the terms and conditions of the BSD License \r
ArmCpuLib\r
ArmLib\r
ArmPlatformLib\r
+ ArmTrustedMonitorLib\r
BaseLib\r
DebugLib\r
DebugAgentLib\r