summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Sec/SecInternal.h
blob: 0d6daf993aabdc2c648f31b41cea33c5e228a91d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/** @file
*  Main file supporting the SEC Phase on ARM PLatforms
*
*  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
*  which accompanies this distribution.  The full text of the license may be found at
*  http://opensource.org/licenses/bsd-license.php
*
*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*
**/

#ifndef __SEC_H__
#define __SEC_H__

#include <Base.h>
#include <Library/ArmLib.h>
#include <Library/ArmCpuLib.h>
#include <Library/ArmPlatformSecLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>

#define IS_ALIGNED(Address, Align) (((UINTN)Address & (Align-1)) == 0)

VOID
TrustedWorldInitialization (
  IN  UINTN                 MpId
  );

VOID
NonTrustedWorldTransition (
  IN  UINTN                     MpId,
  IN  UINTN                     JumpAddress
  );

VOID
ArmSetupGicNonSecure (
  IN  INTN                  GicDistributorBase,
  IN  INTN                  GicInterruptInterfaceBase
);

// Vector Table for Sec Phase
VOID
SecVectorTable (
  VOID
  );

VOID
enter_monitor_mode (
  IN UINTN                  MonitorEntryPoint,
  IN UINTN                  MpId,
  IN VOID*                  Stack
  );

VOID
return_from_exception (
  IN UINTN                  NonSecureBase
  );

VOID
copy_cpsr_into_spsr (
  VOID
  );

VOID
set_non_secure_mode (
  IN ARM_PROCESSOR_MODE     Mode
  );

VOID
SecCommonExceptionEntry (
  IN UINT32 Entry,
  IN UINT32 LR
  );

#endif