]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Pi/PiMultiPhase.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / Pi / PiMultiPhase.h
1 /** @file
2 Include file matches things in PI for multiple module types.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 @par Revision Reference:
14 These elements are defined in UEFI Platform Initialization Specification 1.2.
15
16 **/
17
18 #ifndef __PI_MULTIPHASE_H__
19 #define __PI_MULTIPHASE_H__
20
21 #include <Pi/PiFirmwareVolume.h>
22 #include <Pi/PiFirmwareFile.h>
23 #include <Pi/PiBootMode.h>
24 #include <Pi/PiHob.h>
25 #include <Pi/PiDependency.h>
26 #include <Pi/PiStatusCode.h>
27 #include <Pi/PiS3BootScript.h>
28
29 /**
30 Produces an error code in the range reserved for use by the Platform Initialization
31 Architecture Specification.
32
33 The supported 32-bit range is 0xA0000000-0xBFFFFFFF
34 The supported 64-bit range is 0xA000000000000000-0xBFFFFFFFFFFFFFFF
35
36 @param StatusCode The status code value to convert into a warning code.
37 StatusCode must be in the range 0x00000000..0x1FFFFFFF.
38
39 @return The value specified by StatusCode in the PI reserved range.
40
41 **/
42 #define DXE_ERROR(StatusCode) (MAX_BIT | (MAX_BIT >> 2) | StatusCode)
43
44 ///
45 /// If this value is returned by an EFI image, then the image should be unloaded.
46 ///
47 #define EFI_REQUEST_UNLOAD_IMAGE DXE_ERROR (1)
48
49 ///
50 /// If this value is returned by an API, it means the capability is not yet
51 /// installed/available/ready to use.
52 ///
53 #define EFI_NOT_AVAILABLE_YET DXE_ERROR (2)
54
55 ///
56 /// Success and warning codes reserved for use by PI.
57 /// Supported 32-bit range is 0x20000000-0x3fffffff.
58 /// Supported 64-bit range is 0x2000000000000000-0x3fffffffffffffff.
59 ///
60 #define PI_ENCODE_WARNING(a) ((MAX_BIT >> 2) | (a))
61
62 ///
63 /// Error codes reserved for use by PI.
64 /// Supported 32-bit range is 0xa0000000-0xbfffffff.
65 /// Supported 64-bit range is 0xa000000000000000-0xbfffffffffffffff.
66 ///
67 #define PI_ENCODE_ERROR(a) (MAX_BIT | (MAX_BIT >> 2) | (a))
68
69 ///
70 /// Return status codes defined in SMM CIS.
71 ///
72 #define EFI_INTERRUPT_PENDING PI_ENCODE_ERROR (0)
73
74 #define EFI_WARN_INTERRUPT_SOURCE_PENDING PI_ENCODE_WARNING (0)
75 #define EFI_WARN_INTERRUPT_SOURCE_QUIESCED PI_ENCODE_WARNING (1)
76
77 ///
78 /// Bitmask of values for Authentication Status.
79 /// Authentication Status is returned from EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL
80 /// and the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
81 ///
82 /// xx00 Image was not signed.
83 /// xxx1 Platform security policy override. Assumes the same meaning as 0010 (the image was signed, the
84 /// signature was tested, and the signature passed authentication test).
85 /// 0010 Image was signed, the signature was tested, and the signature passed authentication test.
86 /// 0110 Image was signed and the signature was not tested.
87 /// 1010 Image was signed, the signature was tested, and the signature failed the authentication test.
88 ///
89 ///@{
90 #define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x01
91 #define EFI_AUTH_STATUS_IMAGE_SIGNED 0x02
92 #define EFI_AUTH_STATUS_NOT_TESTED 0x04
93 #define EFI_AUTH_STATUS_TEST_FAILED 0x08
94 #define EFI_AUTH_STATUS_ALL 0x0f
95 ///@}
96
97 ///
98 /// MMRAM states and capabilities
99 ///
100 #define EFI_MMRAM_OPEN 0x00000001
101 #define EFI_MMRAM_CLOSED 0x00000002
102 #define EFI_MMRAM_LOCKED 0x00000004
103 #define EFI_CACHEABLE 0x00000008
104 #define EFI_ALLOCATED 0x00000010
105 #define EFI_NEEDS_TESTING 0x00000020
106 #define EFI_NEEDS_ECC_INITIALIZATION 0x00000040
107
108 #define EFI_SMRAM_OPEN EFI_MMRAM_OPEN
109 #define EFI_SMRAM_CLOSED EFI_MMRAM_CLOSED
110 #define EFI_SMRAM_LOCKED EFI_MMRAM_LOCKED
111
112 ///
113 /// Structure describing a MMRAM region and its accessibility attributes.
114 ///
115 typedef struct {
116 ///
117 /// Designates the physical address of the MMRAM in memory. This view of memory is
118 /// the same as seen by I/O-based agents, for example, but it may not be the address seen
119 /// by the processors.
120 ///
121 EFI_PHYSICAL_ADDRESS PhysicalStart;
122 ///
123 /// Designates the address of the MMRAM, as seen by software executing on the
124 /// processors. This address may or may not match PhysicalStart.
125 ///
126 EFI_PHYSICAL_ADDRESS CpuStart;
127 ///
128 /// Describes the number of bytes in the MMRAM region.
129 ///
130 UINT64 PhysicalSize;
131 ///
132 /// Describes the accessibility attributes of the MMRAM. These attributes include the
133 /// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheable), logical
134 /// allocation (e.g., allocated), and pre-use initialization (e.g., needs testing/ECC
135 /// initialization).
136 ///
137 UINT64 RegionState;
138 } EFI_MMRAM_DESCRIPTOR;
139
140 typedef EFI_MMRAM_DESCRIPTOR EFI_SMRAM_DESCRIPTOR;
141
142 typedef enum {
143 EFI_PCD_TYPE_8,
144 EFI_PCD_TYPE_16,
145 EFI_PCD_TYPE_32,
146 EFI_PCD_TYPE_64,
147 EFI_PCD_TYPE_BOOL,
148 EFI_PCD_TYPE_PTR
149 } EFI_PCD_TYPE;
150
151 typedef struct {
152 ///
153 /// The returned information associated with the requested TokenNumber. If
154 /// TokenNumber is 0, then PcdType is set to EFI_PCD_TYPE_8.
155 ///
156 EFI_PCD_TYPE PcdType;
157 ///
158 /// The size of the data in bytes associated with the TokenNumber specified. If
159 /// TokenNumber is 0, then PcdSize is set 0.
160 ///
161 UINTN PcdSize;
162 ///
163 /// The null-terminated ASCII string associated with a given token. If the
164 /// TokenNumber specified was 0, then this field corresponds to the null-terminated
165 /// ASCII string associated with the token's namespace Guid. If NULL, there is no
166 /// name associated with this request.
167 ///
168 CHAR8 *PcdName;
169 } EFI_PCD_INFO;
170
171 /**
172 The function prototype for invoking a function on an Application Processor.
173
174 This definition is used by the UEFI MP Serices Protocol, and the
175 PI SMM System Table.
176
177 @param[in,out] Buffer The pointer to private data buffer.
178 **/
179 typedef
180 VOID
181 (EFIAPI *EFI_AP_PROCEDURE)(
182 IN OUT VOID *Buffer
183 );
184
185 #endif