PiMultiPhase.h revision 04c5d169fc45456b3bb87d27301ed1f1a1830000
1/** @file
2  Include file matches things in PI for multiple module types.
3
4  Copyright (c) 2006 - 2009, Intel Corporation
5  All rights reserved. This program and the accompanying materials
6  are licensed and made available under the terms and conditions of the BSD License
7  which accompanies this distribution.  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
28/**
29  Produces an error code in the range reserved for use by the Platform Initialization
30  Architecture Specification.
31
32  The supported 32-bit range is 0xA0000000-0xBFFFFFFF
33  The supported 64-bit range is 0xA000000000000000-0xBFFFFFFFFFFFFFFF
34
35  @param  StatusCode    The status code value to convert into a warning code.
36                        StatusCode must be in the range 0x00000000..0x1FFFFFFF.
37
38  @return The value specified by StatusCode in the PI reserved range.
39
40**/
41#define DXE_ERROR(StatusCode)  (MAX_BIT | (MAX_BIT >> 2) | StatusCode)
42
43///
44/// If this value is returned by an EFI image, then the image should be unloaded.
45///
46#define EFI_REQUEST_UNLOAD_IMAGE  DXE_ERROR (1)
47
48///
49/// If this value is returned by an API, it means the capability is not yet
50/// installed/available/ready to use.
51///
52#define EFI_NOT_AVAILABLE_YET     DXE_ERROR (2)
53
54///
55/// Success and warning codes reserved for use by PI
56/// Supported 32-bit range is 0x20000000-0x3fffffff
57/// Supported 64-bit range is 0x2000000000000000-0x3fffffffffffffff
58///
59#define PI_ENCODE_WARNING(a)                ((MAX_BIT >> 2) | (a))
60
61///
62/// Error codes reserved for use by PI
63/// Supported 32-bit range is 0xa0000000-0xbfffffff
64/// Supported 64-bit range is 0xa000000000000000-0xbfffffffffffffff
65///
66#define PI_ENCODE_ERROR(a)                  (MAX_BIT | (MAX_BIT >> 2) | (a))
67
68///
69/// Return status codes defined in SMM CIS
70///
71#define EFI_INTERRUPT_PENDING               PI_ENCODE_ERROR (0)
72
73#define EFI_WARN_INTERRUPT_SOURCE_PENDING   PI_ENCODE_WARNING (0)
74#define EFI_WARN_INTERRUPT_SOURCE_QUIESCED  PI_ENCODE_WARNING (1)
75
76///
77/// Bitmask of values for Authentication Status.
78/// Authentication Status is returned from EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL
79/// and the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
80///
81/// xx00 Image was not signed.
82/// xxx1 Platform security policy override. Assumes same meaning as 0010 (the image was signed, the
83///      signature was tested, and the signature passed authentication test).
84/// 0010 Image was signed, the signature was tested, and the signature passed authentication test.
85/// 0110 Image was signed and the signature was not tested.
86/// 1010 Image was signed, the signature was tested, and the signature failed the authentication test.
87///
88///@{
89#define EFI_AUTH_STATUS_PLATFORM_OVERRIDE   0x01
90#define EFI_AUTH_STATUS_IMAGE_SIGNED        0x02
91#define EFI_AUTH_STATUS_NOT_TESTED          0x04
92#define EFI_AUTH_STATUS_TEST_FAILED         0x08
93#define EFI_AUTH_STATUS_ALL                 0x0f
94///@}
95
96#endif
97