1d4225560494fe6dd1381896312792ad7a172b34cHao Wu/** @file
2d4225560494fe6dd1381896312792ad7a172b34cHao Wu  This file declares UEFI PI Multi-processor PPI.
3d4225560494fe6dd1381896312792ad7a172b34cHao Wu  This PPI is installed by some platform or chipset-specific PEIM that abstracts
4d4225560494fe6dd1381896312792ad7a172b34cHao Wu  handling multiprocessor support.
5d4225560494fe6dd1381896312792ad7a172b34cHao Wu
6d4225560494fe6dd1381896312792ad7a172b34cHao Wu  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
7d4225560494fe6dd1381896312792ad7a172b34cHao Wu  This program and the accompanying materials
8d4225560494fe6dd1381896312792ad7a172b34cHao Wu  are licensed and made available under the terms and conditions of the BSD License
9d4225560494fe6dd1381896312792ad7a172b34cHao Wu  which accompanies this distribution. The full text of the license may be found at
10d4225560494fe6dd1381896312792ad7a172b34cHao Wu  http://opensource.org/licenses/bsd-license.php
11d4225560494fe6dd1381896312792ad7a172b34cHao Wu
12d4225560494fe6dd1381896312792ad7a172b34cHao Wu  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13d4225560494fe6dd1381896312792ad7a172b34cHao Wu  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14d4225560494fe6dd1381896312792ad7a172b34cHao Wu
15d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @par Revision Reference:
16d4225560494fe6dd1381896312792ad7a172b34cHao Wu  This PPI is introduced in PI Version 1.4.
17d4225560494fe6dd1381896312792ad7a172b34cHao Wu
18d4225560494fe6dd1381896312792ad7a172b34cHao Wu**/
19d4225560494fe6dd1381896312792ad7a172b34cHao Wu
20d4225560494fe6dd1381896312792ad7a172b34cHao Wu#ifndef __PEI_MP_SERVICES_PPI_H__
21d4225560494fe6dd1381896312792ad7a172b34cHao Wu#define __PEI_MP_SERVICES_PPI_H__
22d4225560494fe6dd1381896312792ad7a172b34cHao Wu
23d4225560494fe6dd1381896312792ad7a172b34cHao Wu#include <Protocol/MpService.h>
24d4225560494fe6dd1381896312792ad7a172b34cHao Wu
25d4225560494fe6dd1381896312792ad7a172b34cHao Wu#define EFI_PEI_MP_SERVICES_PPI_GUID \
26d4225560494fe6dd1381896312792ad7a172b34cHao Wu  { \
27d4225560494fe6dd1381896312792ad7a172b34cHao Wu    0xee16160a, 0xe8be, 0x47a6, { 0x82, 0xa, 0xc6, 0x90, 0xd, 0xb0, 0x25, 0xa } \
28d4225560494fe6dd1381896312792ad7a172b34cHao Wu  }
29d4225560494fe6dd1381896312792ad7a172b34cHao Wu
30d4225560494fe6dd1381896312792ad7a172b34cHao Wutypedef struct _EFI_PEI_MP_SERVICES_PPI  EFI_PEI_MP_SERVICES_PPI ;
31d4225560494fe6dd1381896312792ad7a172b34cHao Wu
32d4225560494fe6dd1381896312792ad7a172b34cHao Wu/**
33d4225560494fe6dd1381896312792ad7a172b34cHao Wu  Get the number of CPU's.
34d4225560494fe6dd1381896312792ad7a172b34cHao Wu
35d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in]  PeiServices         An indirect pointer to the PEI Services Table
36d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  published by the PEI Foundation.
37d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in]  This                Pointer to this instance of the PPI.
38d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[out] NumberOfProcessors  Pointer to the total number of logical processors in
39d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  the system, including the BSP and disabled APs.
40d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[out] NumberOfEnabledProcessors
41d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  Number of processors in the system that are enabled.
42d4225560494fe6dd1381896312792ad7a172b34cHao Wu
43d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_SUCCESS             The number of logical processors and enabled
44d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  logical processors was retrieved.
45d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_DEVICE_ERROR        The calling processor is an AP.
46d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_INVALID_PARAMETER   NumberOfProcessors is NULL.
47d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  NumberOfEnabledProcessors is NULL.
48d4225560494fe6dd1381896312792ad7a172b34cHao Wu**/
49d4225560494fe6dd1381896312792ad7a172b34cHao Wutypedef
50d4225560494fe6dd1381896312792ad7a172b34cHao WuEFI_STATUS
51d4225560494fe6dd1381896312792ad7a172b34cHao Wu(EFIAPI *EFI_PEI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS) (
52d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  CONST EFI_PEI_SERVICES      **PeiServices,
53d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  EFI_PEI_MP_SERVICES_PPI     *This,
54d4225560494fe6dd1381896312792ad7a172b34cHao Wu  OUT UINTN                       *NumberOfProcessors,
55d4225560494fe6dd1381896312792ad7a172b34cHao Wu  OUT UINTN                       *NumberOfEnabledProcessors
56d4225560494fe6dd1381896312792ad7a172b34cHao Wu  );
57d4225560494fe6dd1381896312792ad7a172b34cHao Wu
58d4225560494fe6dd1381896312792ad7a172b34cHao Wu/**
59d4225560494fe6dd1381896312792ad7a172b34cHao Wu  Get information on a specific CPU.
60d4225560494fe6dd1381896312792ad7a172b34cHao Wu
61d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in]  PeiServices         An indirect pointer to the PEI Services Table
62d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  published by the PEI Foundation.
63d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in]  This                Pointer to this instance of the PPI.
64d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in]  ProcessorNumber     Pointer to the total number of logical processors in
65d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  the system, including the BSP and disabled APs.
66d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[out] ProcessorInfoBuffer Number of processors in the system that are enabled.
67d4225560494fe6dd1381896312792ad7a172b34cHao Wu
68d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_SUCCESS             Processor information was returned.
69d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_DEVICE_ERROR        The calling processor is an AP.
70d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_INVALID_PARAMETER   ProcessorInfoBuffer is NULL.
71d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_NOT_FOUND           The processor with the handle specified by
72d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  ProcessorNumber does not exist in the platform.
73d4225560494fe6dd1381896312792ad7a172b34cHao Wu**/
74d4225560494fe6dd1381896312792ad7a172b34cHao Wutypedef
75d4225560494fe6dd1381896312792ad7a172b34cHao WuEFI_STATUS
76d4225560494fe6dd1381896312792ad7a172b34cHao Wu(EFIAPI *EFI_PEI_MP_SERVICES_GET_PROCESSOR_INFO) (
77d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  CONST EFI_PEI_SERVICES      **PeiServices,
78d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  EFI_PEI_MP_SERVICES_PPI     *This,
79d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  UINTN                       ProcessorNumber,
80d4225560494fe6dd1381896312792ad7a172b34cHao Wu  OUT EFI_PROCESSOR_INFORMATION   *ProcessorInfoBuffer
81d4225560494fe6dd1381896312792ad7a172b34cHao Wu  );
82d4225560494fe6dd1381896312792ad7a172b34cHao Wu
83d4225560494fe6dd1381896312792ad7a172b34cHao Wu/**
84d4225560494fe6dd1381896312792ad7a172b34cHao Wu  Activate all of the application proessors.
85d4225560494fe6dd1381896312792ad7a172b34cHao Wu
86d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] PeiServices          An indirect pointer to the PEI Services Table
87d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  published by the PEI Foundation.
88d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] This                 A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
89d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] Procedure            A pointer to the function to be run on enabled APs of
90d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  the system.
91d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] SingleThread         If TRUE, then all the enabled APs execute the function
92d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  specified by Procedure one by one, in ascending order
93d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  of processor handle number. If FALSE, then all the
94d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  enabled APs execute the function specified by Procedure
95d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  simultaneously.
96d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] TimeoutInMicroSeconds
97d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  Indicates the time limit in microseconds for APs to
98d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  return from Procedure, for blocking mode only. Zero
99d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  means infinity. If the timeout expires before all APs
100d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  return from Procedure, then Procedure on the failed APs
101d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  is terminated. All enabled APs are available for next
102d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs()
103d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the
104d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  timeout expires in blocking mode, BSP returns
105d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  EFI_TIMEOUT.
106d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] ProcedureArgument    The parameter passed into Procedure for all APs.
107d4225560494fe6dd1381896312792ad7a172b34cHao Wu
108d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_SUCCESS             In blocking mode, all APs have finished before the
109d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  timeout expired.
110d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_DEVICE_ERROR        Caller processor is AP.
111d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_NOT_STARTED         No enabled APs exist in the system.
112d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_NOT_READY           Any enabled APs are busy.
113d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_TIMEOUT             In blocking mode, the timeout expired before all
114d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  enabled APs have finished.
115d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_INVALID_PARAMETER   Procedure is NULL.
116d4225560494fe6dd1381896312792ad7a172b34cHao Wu**/
117d4225560494fe6dd1381896312792ad7a172b34cHao Wutypedef
118d4225560494fe6dd1381896312792ad7a172b34cHao WuEFI_STATUS
119d4225560494fe6dd1381896312792ad7a172b34cHao Wu(EFIAPI *EFI_PEI_MP_SERVICES_STARTUP_ALL_APS) (
120d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  CONST EFI_PEI_SERVICES      **PeiServices,
121d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  EFI_PEI_MP_SERVICES_PPI     *This,
122d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  EFI_AP_PROCEDURE            Procedure,
123d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  BOOLEAN                     SingleThread,
124d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  UINTN                       TimeoutInMicroSeconds,
125d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  VOID                        *ProcedureArgument      OPTIONAL
126d4225560494fe6dd1381896312792ad7a172b34cHao Wu  );
127d4225560494fe6dd1381896312792ad7a172b34cHao Wu
128d4225560494fe6dd1381896312792ad7a172b34cHao Wu/**
129d4225560494fe6dd1381896312792ad7a172b34cHao Wu  Activate a specific application processor.
130d4225560494fe6dd1381896312792ad7a172b34cHao Wu
131d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] PeiServices          An indirect pointer to the PEI Services Table
132d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  published by the PEI Foundation.
133d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] This                 A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
134d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] Procedure            A pointer to the function to be run on enabled APs of
135d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  the system.
136d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] ProcessorNumber      The handle number of the AP. The range is from 0 to the
137d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  total number of logical processors minus 1. The total
138d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  number of logical processors can be retrieved by
139d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
140d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] TimeoutInMicroSeconds
141d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  Indicates the time limit in microseconds for APs to
142d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  return from Procedure, for blocking mode only. Zero
143d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  means infinity. If the timeout expires before all APs
144d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  return from Procedure, then Procedure on the failed APs
145d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  is terminated. All enabled APs are available for next
146d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs()
147d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the
148d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  timeout expires in blocking mode, BSP returns
149d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  EFI_TIMEOUT.
150d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] ProcedureArgument    The parameter passed into Procedure for all APs.
151d4225560494fe6dd1381896312792ad7a172b34cHao Wu
152d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_SUCCESS             In blocking mode, specified AP finished before the
153d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  timeout expires.
154d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_DEVICE_ERROR        The calling processor is an AP.
155d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_TIMEOUT             In blocking mode, the timeout expired before the
156d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  specified AP has finished.
157d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_NOT_FOUND           The processor with the handle specified by
158d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  ProcessorNumber does not exist.
159d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_INVALID_PARAMETER   ProcessorNumber specifies the BSP or disabled AP.
160d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_INVALID_PARAMETER   Procedure is NULL.
161d4225560494fe6dd1381896312792ad7a172b34cHao Wu**/
162d4225560494fe6dd1381896312792ad7a172b34cHao Wutypedef
163d4225560494fe6dd1381896312792ad7a172b34cHao WuEFI_STATUS
164d4225560494fe6dd1381896312792ad7a172b34cHao Wu(EFIAPI *EFI_PEI_MP_SERVICES_STARTUP_THIS_AP) (
165d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  CONST EFI_PEI_SERVICES      **PeiServices,
166d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  EFI_PEI_MP_SERVICES_PPI     *This,
167d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  EFI_AP_PROCEDURE            Procedure,
168d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  UINTN                       ProcessorNumber,
169d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  UINTN                       TimeoutInMicroseconds,
170d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  VOID                        *ProcedureArgument      OPTIONAL
171d4225560494fe6dd1381896312792ad7a172b34cHao Wu  );
172d4225560494fe6dd1381896312792ad7a172b34cHao Wu
173d4225560494fe6dd1381896312792ad7a172b34cHao Wu/**
174d4225560494fe6dd1381896312792ad7a172b34cHao Wu  Switch the boot strap processor.
175d4225560494fe6dd1381896312792ad7a172b34cHao Wu
176d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] PeiServices          An indirect pointer to the PEI Services Table
177d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  published by the PEI Foundation.
178d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] This                 A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
179d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] ProcessorNumber      The handle number of the AP. The range is from 0 to the
180d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  total number of logical processors minus 1. The total
181d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  number of logical processors can be retrieved by
182d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
183d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] EnableOldBSP         If TRUE, then the old BSP will be listed as an enabled
184d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  AP. Otherwise, it will be disabled.
185d4225560494fe6dd1381896312792ad7a172b34cHao Wu
186d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_SUCCESS             BSP successfully switched.
187d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_UNSUPPORTED         Switching the BSP cannot be completed prior to this
188d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  service returning.
189d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_UNSUPPORTED         Switching the BSP is not supported.
190d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_SUCCESS             The calling processor is an AP.
191d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_NOT_FOUND           The processor with the handle specified by
192d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  ProcessorNumber does not exist.
193d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_INVALID_PARAMETER   ProcessorNumber specifies the current BSP or a disabled
194d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  AP.
195d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_NOT_READY           The specified AP is busy.
196d4225560494fe6dd1381896312792ad7a172b34cHao Wu**/
197d4225560494fe6dd1381896312792ad7a172b34cHao Wutypedef
198d4225560494fe6dd1381896312792ad7a172b34cHao WuEFI_STATUS
199d4225560494fe6dd1381896312792ad7a172b34cHao Wu(EFIAPI *EFI_PEI_MP_SERVICES_SWITCH_BSP) (
200d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  CONST EFI_PEI_SERVICES      **PeiServices,
201d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  EFI_PEI_MP_SERVICES_PPI     *This,
202d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  UINTN                       ProcessorNumber,
203d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  BOOLEAN                     EnableOldBSP
204d4225560494fe6dd1381896312792ad7a172b34cHao Wu  );
205d4225560494fe6dd1381896312792ad7a172b34cHao Wu
206d4225560494fe6dd1381896312792ad7a172b34cHao Wu/**
207d4225560494fe6dd1381896312792ad7a172b34cHao Wu  Enable or disable an application processor.
208d4225560494fe6dd1381896312792ad7a172b34cHao Wu
209d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] PeiServices          An indirect pointer to the PEI Services Table
210d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  published by the PEI Foundation.
211d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] This                 A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
212d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] ProcessorNumber      The handle number of the AP. The range is from 0 to the
213d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  total number of logical processors minus 1. The total
214d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  number of logical processors can be retrieved by
215d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
216d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] EnableAP             Specifies the new state for the processor for enabled,
217d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  FALSE for disabled.
218d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in] HealthFlag           If not NULL, a pointer to a value that specifies the
219d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  new health status of the AP. This flag corresponds to
220d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  StatusFlag defined in EFI_PEI_MP_SERVICES_PPI.GetProcessorInfo().
221d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  Only the PROCESSOR_HEALTH_STATUS_BIT is used. All other
222d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  bits are ignored. If it is NULL, this parameter is
223d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  ignored.
224d4225560494fe6dd1381896312792ad7a172b34cHao Wu
225d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_SUCCESS             The specified AP was enabled or disabled successfully.
226d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_UNSUPPORTED         Enabling or disabling an AP cannot be completed prior
227d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  to this service returning.
228d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_UNSUPPORTED         Enabling or disabling an AP is not supported.
229d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_DEVICE_ERROR        The calling processor is an AP.
230d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_NOT_FOUND           Processor with the handle specified by ProcessorNumber
231d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  does not exist.
232d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_INVALID_PARAMETER   ProcessorNumber specifies the BSP.
233d4225560494fe6dd1381896312792ad7a172b34cHao Wu**/
234d4225560494fe6dd1381896312792ad7a172b34cHao Wutypedef
235d4225560494fe6dd1381896312792ad7a172b34cHao WuEFI_STATUS
236d4225560494fe6dd1381896312792ad7a172b34cHao Wu(EFIAPI *EFI_PEI_MP_SERVICES_ENABLEDISABLEAP) (
237d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  CONST EFI_PEI_SERVICES      **PeiServices,
238d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  EFI_PEI_MP_SERVICES_PPI     *This,
239d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  UINTN                       ProcessorNumber,
240d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  BOOLEAN                     EnableAP,
241d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  UINT32                      *HealthFlag      OPTIONAL
242d4225560494fe6dd1381896312792ad7a172b34cHao Wu  );
243d4225560494fe6dd1381896312792ad7a172b34cHao Wu
244d4225560494fe6dd1381896312792ad7a172b34cHao Wu/**
245c8c2815802f335fd6cfe971d984762e479142879Hao Wu  Identify the currently executing processor.
246d4225560494fe6dd1381896312792ad7a172b34cHao Wu
247d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in]  PeiServices         An indirect pointer to the PEI Services Table
248d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  published by the PEI Foundation.
249d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[in]  This                A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
250d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @param[out] ProcessorNumber     The handle number of the AP. The range is from 0 to the
251d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  total number of logical processors minus 1. The total
252d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  number of logical processors can be retrieved by
253d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
254d4225560494fe6dd1381896312792ad7a172b34cHao Wu
255d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_SUCCESS             The current processor handle number was returned in
256d4225560494fe6dd1381896312792ad7a172b34cHao Wu                                  ProcessorNumber.
257d4225560494fe6dd1381896312792ad7a172b34cHao Wu  @retval EFI_INVALID_PARAMETER   ProcessorNumber is NULL.
258d4225560494fe6dd1381896312792ad7a172b34cHao Wu**/
259d4225560494fe6dd1381896312792ad7a172b34cHao Wutypedef
260d4225560494fe6dd1381896312792ad7a172b34cHao WuEFI_STATUS
261d4225560494fe6dd1381896312792ad7a172b34cHao Wu(EFIAPI *EFI_PEI_MP_SERVICES_WHOAMI) (
262d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  CONST EFI_PEI_SERVICES      **PeiServices,
263d4225560494fe6dd1381896312792ad7a172b34cHao Wu  IN  EFI_PEI_MP_SERVICES_PPI     *This,
264d4225560494fe6dd1381896312792ad7a172b34cHao Wu  OUT UINTN                       *ProcessorNumber
265d4225560494fe6dd1381896312792ad7a172b34cHao Wu  );
266d4225560494fe6dd1381896312792ad7a172b34cHao Wu
267d4225560494fe6dd1381896312792ad7a172b34cHao Wu///
268d4225560494fe6dd1381896312792ad7a172b34cHao Wu/// This PPI is installed by some platform or chipset-specific PEIM that abstracts
269d4225560494fe6dd1381896312792ad7a172b34cHao Wu/// handling multiprocessor support.
270d4225560494fe6dd1381896312792ad7a172b34cHao Wu///
271d4225560494fe6dd1381896312792ad7a172b34cHao Wustruct _EFI_PEI_MP_SERVICES_PPI {
272d4225560494fe6dd1381896312792ad7a172b34cHao Wu  EFI_PEI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS   GetNumberOfProcessors;
273d4225560494fe6dd1381896312792ad7a172b34cHao Wu  EFI_PEI_MP_SERVICES_GET_PROCESSOR_INFO         GetProcessorInfo;
274d4225560494fe6dd1381896312792ad7a172b34cHao Wu  EFI_PEI_MP_SERVICES_STARTUP_ALL_APS            StartupAllAPs;
275d4225560494fe6dd1381896312792ad7a172b34cHao Wu  EFI_PEI_MP_SERVICES_STARTUP_THIS_AP            StartupThisAP;
276d4225560494fe6dd1381896312792ad7a172b34cHao Wu  EFI_PEI_MP_SERVICES_SWITCH_BSP                 SwitchBSP;
277d4225560494fe6dd1381896312792ad7a172b34cHao Wu  EFI_PEI_MP_SERVICES_ENABLEDISABLEAP            EnableDisableAP;
278d4225560494fe6dd1381896312792ad7a172b34cHao Wu  EFI_PEI_MP_SERVICES_WHOAMI                     WhoAmI;
279d4225560494fe6dd1381896312792ad7a172b34cHao Wu};
280d4225560494fe6dd1381896312792ad7a172b34cHao Wu
281d4225560494fe6dd1381896312792ad7a172b34cHao Wuextern EFI_GUID gEfiPeiMpServicesPpiGuid;
282d4225560494fe6dd1381896312792ad7a172b34cHao Wu
283d4225560494fe6dd1381896312792ad7a172b34cHao Wu#endif
284