2 Include file for SMM CPU Services protocol implementation.
4 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _CPU_SERVICE_H_
10 #define _CPU_SERVICE_H_
20 // SMM CPU Service Protocol function prototypes.
24 Gets processor information on the requested processor at the instant this call is made.
26 @param[in] This A pointer to the EFI_SMM_CPU_SERVICE_PROTOCOL instance.
27 @param[in] ProcessorNumber The handle number of processor.
28 @param[out] ProcessorInfoBuffer A pointer to the buffer where information for
29 the requested processor is deposited.
31 @retval EFI_SUCCESS Processor information was returned.
32 @retval EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.
33 @retval EFI_INVALID_PARAMETER ProcessorNumber is invalid.
34 @retval EFI_NOT_FOUND The processor with the handle specified by
35 ProcessorNumber does not exist in the platform.
41 IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL
*This
,
42 IN UINTN ProcessorNumber
,
43 OUT EFI_PROCESSOR_INFORMATION
*ProcessorInfoBuffer
47 This service switches the requested AP to be the BSP since the next SMI.
49 @param[in] This A pointer to the EFI_SMM_CPU_SERVICE_PROTOCOL instance.
50 @param[in] ProcessorNumber The handle number of AP that is to become the new BSP.
52 @retval EFI_SUCCESS BSP will be switched in next SMI.
53 @retval EFI_UNSUPPORTED Switching the BSP or a processor to be hot-removed is not supported.
54 @retval EFI_NOT_FOUND The processor with the handle specified by ProcessorNumber does not exist.
55 @retval EFI_INVALID_PARAMETER ProcessorNumber is invalid.
60 IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL
*This
,
61 IN UINTN ProcessorNumber
65 Notify that a processor was hot-added.
67 @param[in] This A pointer to the EFI_SMM_CPU_SERVICE_PROTOCOL instance.
68 @param[in] ProcessorId Local APIC ID of the hot-added processor.
69 @param[out] ProcessorNumber The handle number of the hot-added processor.
71 @retval EFI_SUCCESS The hot-addition of the specified processors was successfully notified.
72 @retval EFI_UNSUPPORTED Hot addition of processor is not supported.
73 @retval EFI_NOT_FOUND The processor with the handle specified by ProcessorNumber does not exist.
74 @retval EFI_INVALID_PARAMETER ProcessorNumber is invalid.
75 @retval EFI_ALREADY_STARTED The processor is already online in the system.
80 IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL
*This
,
81 IN UINT64 ProcessorId
,
82 OUT UINTN
*ProcessorNumber
86 Notify that a processor was hot-removed.
88 @param[in] This A pointer to the EFI_SMM_CPU_SERVICE_PROTOCOL instance.
89 @param[in] ProcessorNumber The handle number of the hot-added processor.
91 @retval EFI_SUCCESS The hot-removal of the specified processors was successfully notified.
92 @retval EFI_UNSUPPORTED Hot removal of processor is not supported.
93 @retval EFI_UNSUPPORTED Hot removal of BSP is not supported.
94 @retval EFI_UNSUPPORTED Hot removal of a processor with pending hot-plug operation is not supported.
95 @retval EFI_INVALID_PARAMETER ProcessorNumber is invalid.
100 IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL
*This
,
101 IN UINTN ProcessorNumber
105 This return the handle number for the calling processor.
107 @param[in] This A pointer to the EFI_SMM_CPU_SERVICE_PROTOCOL instance.
108 @param[out] ProcessorNumber The handle number of currently executing processor.
110 @retval EFI_SUCCESS The current processor handle number was returned
112 @retval EFI_INVALID_PARAMETER ProcessorNumber is NULL.
118 IN CONST EFI_SMM_CPU_SERVICE_PROTOCOL
*This
,
119 OUT UINTN
*ProcessorNumber
123 Register exception handler.
125 @param This A pointer to the SMM_CPU_SERVICE_PROTOCOL instance.
126 @param ExceptionType Defines which interrupt or exception to hook. Type EFI_EXCEPTION_TYPE and
127 the valid values for this parameter are defined in EFI_DEBUG_SUPPORT_PROTOCOL
128 of the UEFI 2.0 specification.
129 @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER
130 that is called when a processor interrupt occurs.
131 If this parameter is NULL, then the handler will be uninstalled.
133 @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
134 @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was previously installed.
135 @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not previously installed.
136 @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
141 SmmRegisterExceptionHandler (
142 IN EFI_SMM_CPU_SERVICE_PROTOCOL
*This
,
143 IN EFI_EXCEPTION_TYPE ExceptionType
,
144 IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
148 // Internal function prototypes
152 Update the SMM CPU list per the pending operation.
154 This function is called after return from SMI handlers.
162 Initialize SMM CPU Services.
164 It installs EFI SMM CPU Services Protocol.
166 @param ImageHandle The firmware allocated handle for the EFI image.
168 @retval EFI_SUCCESS EFI SMM CPU Services Protocol was installed successfully.
171 InitializeSmmCpuServices (