]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPlatformPkg/Sec/SecInternal.h
ArmPlatformPkg/Sec: Fix transition to Trusted Monitor World with ARMGCC
[mirror_edk2.git] / ArmPlatformPkg / Sec / SecInternal.h
1 /** @file
2 * Main file supporting the SEC Phase on ARM PLatforms
3 *
4 * Copyright (c) 2011-2012, ARM Limited. All rights reserved.
5 *
6 * This program and the accompanying materials
7 * are licensed and made available under the terms and conditions of the BSD License
8 * which accompanies this distribution. The full text of the license may be found at
9 * http://opensource.org/licenses/bsd-license.php
10 *
11 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 *
14 **/
15
16 #ifndef __SEC_H__
17 #define __SEC_H__
18
19 #include <Base.h>
20 #include <Library/ArmLib.h>
21 #include <Library/ArmCpuLib.h>
22 #include <Library/ArmPlatformLib.h>
23 #include <Library/BaseLib.h>
24 #include <Library/DebugLib.h>
25 #include <Library/PcdLib.h>
26
27 #define IS_ALIGNED(Address, Align) (((UINTN)Address & (Align-1)) == 0)
28
29 VOID
30 TrustedWorldInitialization (
31 IN UINTN MpId
32 );
33
34 VOID
35 NonTrustedWorldTransition (
36 IN UINTN MpId
37 );
38
39 VOID
40 ArmSetupGicNonSecure (
41 IN INTN GicDistributorBase,
42 IN INTN GicInterruptInterfaceBase
43 );
44
45 // Vector Table for Sec Phase
46 VOID
47 SecVectorTable (
48 VOID
49 );
50
51 VOID
52 NonSecureWaitForFirmware (
53 VOID
54 );
55
56 VOID
57 enter_monitor_mode (
58 IN UINTN MonitorEntryPoint,
59 IN UINTN MpId,
60 IN VOID* Stack
61 );
62
63 VOID
64 return_from_exception (
65 IN UINTN NonSecureBase
66 );
67
68 VOID
69 copy_cpsr_into_spsr (
70 VOID
71 );
72
73 VOID
74 set_non_secure_mode (
75 IN ARM_PROCESSOR_MODE Mode
76 );
77
78 VOID
79 SecCommonExceptionEntry (
80 IN UINT32 Entry,
81 IN UINT32 LR
82 );
83
84 #endif