summaryrefslogtreecommitdiffstats
path: root/MdePkg/Include/Ppi/SecPlatformInformation.h
blob: 573939af3dcc55a807999403a06f96b11eeab4e7 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/** @file
  This file declares Sec Platform Information PPI.

  This service is the primary handoff state into the PEI Foundation. 
  The Security (SEC) component creates the early, transitory memory 
  environment and also encapsulates knowledge of at least the 
  location of the Boot Firmware Volume (BFV).

  Copyright (c) 2006 - 2008, Intel Corporation                                                         
  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.             

  @par Revision Reference:
  This PPI is defined in PI.
  Version 1.00.

**/

#ifndef __SEC_PLATFORM_INFORMATION_PPI_H__
#define __SEC_PLATFORM_INFORMATION_PPI_H__

#define EFI_SEC_PLATFORM_INFORMATION_GUID \
  { \
    0x6f8c2b35, 0xfef4, 0x448d, {0x82, 0x56, 0xe1, 0x1b, 0x19, 0xd6, 0x10, 0x77 } \
  }

typedef struct _EFI_SEC_PLATFORM_INFORMATION_PPI EFI_SEC_PLATFORM_INFORMATION_PPI;


///
/// EFI_HEALTH_FLAGS
/// Contains information generated by microcode, hardware, and/or the Itanium
/// processor PAL code about the state of the processor upon reset.
///
typedef union {
  struct {
    ///
    /// A 2-bit field indicating self-test state after reset.
    ///
    UINT32   Status                   : 2;
    ///
    /// A 1-bit field indicating whether testing has occurred.
    /// If this field is zero, the processor has not been tested,
    /// and no further fields in the self-test State parameter are valid.
    ///
    UINT32   Tested                   : 1;
    ///
    /// Reserved 13 bits.
    ///
    UINT32   Reserved1                :13;
    ///
    /// A 1-bit field. If set to 1, indicates that virtual
    /// memory features are not available.
    ///
    UINT32   VirtualMemoryUnavailable : 1;
    ///
    /// A 1-bit field. If set to 1, indicates that IA-32 execution
    /// is not available.
    ///
    UINT32   Ia32ExecutionUnavailable : 1;
    ///
    /// A 1-bit field. If set to 1, indicates that the floating
    /// point unit is not available.
    ///
    UINT32   FloatingPointUnavailable : 1;
    ///
    /// A 1-bit field. If set to 1, indicates miscellaneous
    /// functional failure other than vm, ia, or fp.
    /// The test status field provides additional information on
    /// test failures when the State field returns a value of
    /// performance restricted or functionally restricted.
    /// The value returned is implementation dependent.
    ///
    UINT32   MiscFeaturesUnavailable  : 1;
    ///
    /// Reserved 12 bits.
    ///
    UINT32   Reserved2                :12;
  } Bits;
  UINT32     Uint32;
} EFI_HEALTH_FLAGS;

#define NORMAL_BOOT_CALL    0x0
#define RECOVERY_CHECK_CALL 0x3

typedef struct {
  UINT8 BootPhase;
  UINT8 FWStatus;
  UINT16 Reserved1;
  UINT32 Reserved2;

  UINT16 ProcId;
  UINT16 Reserved3;
  UINT8  IdMask;
  UINT8  EidMask;
  UINT16 Reserved4;

  UINT64 PalCallAddress;
  UINT64 PalSpecialAddress;
  UINT64 SelfTestStatus;
  UINT64 SelfTestControl;
  UINT64 MemoryBufferRequired;

} IPF_HANDOFF_STATUS;

///
/// EFI_SEC_PLATFORM_INFORMATION_RECORD
///
typedef struct {
  ///
  /// Contains information generated by microcode, hardware,
  /// and/or the Itanium processor PAL code about the state
  /// of the processor upon reset.
  ///
  EFI_HEALTH_FLAGS HealthFlags;
} EFI_SEC_PLATFORM_INFORMATION_RECORD;



/**
  This interface conveys state information out of the Security (SEC) phase into PEI.

  This service is published by the SEC phase. The SEC phase handoff has an optional
  EFI_PEI_PPI_DESCRIPTOR list as its final argument when control is passed from SEC into the
  PEI Foundation. As such, if the platform supports the built-in self test (BIST) on IA-32 Intel
  architecture or the PAL-A handoff state for Itanium architecture, this information is encapsulated
  into the data structure abstracted by this service. This information is collected for the boot-strap
  processor (BSP) on IA-32, and for Itanium architecture, it is available on all processors that execute
  the PEI Foundation.

  @param  PeiServices               Pointer to the PEI Services Table.
  @param  StructureSize             Pointer to the variable describing size of the input buffer.
  @param  PlatformInformationRecord Pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD.

  @retval EFI_SUCCESS               The data was successfully returned.
  @retval EFI_BUFFER_TOO_SMALL      The buffer was too small.

**/
typedef
EFI_STATUS
(EFIAPI *EFI_SEC_PLATFORM_INFORMATION)(
  IN CONST  EFI_PEI_SERVICES                    **PeiServices,
  IN OUT    UINT64                              *StructureSize,
  OUT       EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord
);


///
/// This service abstracts platform-specific information. It is necessary 
/// to convey this information to the PEI Foundation so that it can 
/// discover where to begin dispatching PEIMs.
///
struct _EFI_SEC_PLATFORM_INFORMATION_PPI {
  ///
  /// Conveys state information out of the SEC phase into PEI.
  ///
  EFI_SEC_PLATFORM_INFORMATION  PlatformInformation;
};


extern EFI_GUID gEfiSecPlatformInformationPpiGuid;

#endif