]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/Library/MpInitLib/MpLib.h
e88a5355c983f0fbc66b08c648c5d3c34f8e0d49
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / MpLib.h
1 /** @file
2 Common header file for MP Initialize Library.
3
4 Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.<BR>
5 Copyright (c) 2020, AMD Inc. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef _MP_LIB_H_
12 #define _MP_LIB_H_
13
14 #include <PiPei.h>
15
16 #include <Register/Intel/Cpuid.h>
17 #include <Register/Amd/Cpuid.h>
18 #include <Register/Intel/Msr.h>
19 #include <Register/Intel/LocalApic.h>
20 #include <Register/Intel/Microcode.h>
21
22 #include <Library/MpInitLib.h>
23 #include <Library/BaseLib.h>
24 #include <Library/BaseMemoryLib.h>
25 #include <Library/MemoryAllocationLib.h>
26 #include <Library/DebugLib.h>
27 #include <Library/LocalApicLib.h>
28 #include <Library/CpuLib.h>
29 #include <Library/UefiCpuLib.h>
30 #include <Library/TimerLib.h>
31 #include <Library/SynchronizationLib.h>
32 #include <Library/MtrrLib.h>
33 #include <Library/HobLib.h>
34 #include <Library/PcdLib.h>
35 #include <Library/MicrocodeLib.h>
36
37 #include <Guid/MicrocodePatchHob.h>
38
39 #define WAKEUP_AP_SIGNAL SIGNATURE_32 ('S', 'T', 'A', 'P')
40
41 #define CPU_INIT_MP_LIB_HOB_GUID \
42 { \
43 0x58eb6a19, 0x3699, 0x4c68, { 0xa8, 0x36, 0xda, 0xcd, 0x8e, 0xdc, 0xad, 0x4a } \
44 }
45
46 //
47 // The MP data for switch BSP
48 //
49 #define CPU_SWITCH_STATE_IDLE 0
50 #define CPU_SWITCH_STATE_STORED 1
51 #define CPU_SWITCH_STATE_LOADED 2
52
53 //
54 // Default maximum number of entries to store the microcode patches information
55 //
56 #define DEFAULT_MAX_MICROCODE_PATCH_NUM 8
57
58 //
59 // Data structure for microcode patch information
60 //
61 typedef struct {
62 UINTN Address;
63 UINTN Size;
64 } MICROCODE_PATCH_INFO;
65
66 //
67 // CPU exchange information for switch BSP
68 //
69 typedef struct {
70 UINT8 State; // offset 0
71 UINTN StackPointer; // offset 4 / 8
72 IA32_DESCRIPTOR Gdtr; // offset 8 / 16
73 IA32_DESCRIPTOR Idtr; // offset 14 / 26
74 } CPU_EXCHANGE_ROLE_INFO;
75
76 //
77 // AP loop state when APs are in idle state
78 // It's value is the same with PcdCpuApLoopMode
79 //
80 typedef enum {
81 ApInHltLoop = 1,
82 ApInMwaitLoop = 2,
83 ApInRunLoop = 3
84 } AP_LOOP_MODE;
85
86 //
87 // AP initialization state during APs wakeup
88 //
89 typedef enum {
90 ApInitConfig = 1,
91 ApInitReconfig = 2,
92 ApInitDone = 3
93 } AP_INIT_STATE;
94
95 //
96 // AP state
97 //
98 // The state transitions for an AP when it process a procedure are:
99 // Idle ----> Ready ----> Busy ----> Idle
100 // [BSP] [AP] [AP]
101 //
102 typedef enum {
103 CpuStateIdle,
104 CpuStateReady,
105 CpuStateBusy,
106 CpuStateFinished,
107 CpuStateDisabled
108 } CPU_STATE;
109
110 //
111 // CPU volatile registers around INIT-SIPI-SIPI
112 //
113 typedef struct {
114 UINTN Cr0;
115 UINTN Cr3;
116 UINTN Cr4;
117 UINTN Dr0;
118 UINTN Dr1;
119 UINTN Dr2;
120 UINTN Dr3;
121 UINTN Dr6;
122 UINTN Dr7;
123 IA32_DESCRIPTOR Gdtr;
124 IA32_DESCRIPTOR Idtr;
125 UINT16 Tr;
126 } CPU_VOLATILE_REGISTERS;
127
128 //
129 // AP related data
130 //
131 typedef struct {
132 SPIN_LOCK ApLock;
133 volatile UINT32 *StartupApSignal;
134 volatile UINTN ApFunction;
135 volatile UINTN ApFunctionArgument;
136 BOOLEAN CpuHealthy;
137 volatile CPU_STATE State;
138 CPU_VOLATILE_REGISTERS VolatileRegisters;
139 BOOLEAN Waiting;
140 BOOLEAN *Finished;
141 UINT64 ExpectedTime;
142 UINT64 CurrentTime;
143 UINT64 TotalTime;
144 EFI_EVENT WaitEvent;
145 UINT32 ProcessorSignature;
146 UINT8 PlatformId;
147 UINT64 MicrocodeEntryAddr;
148 UINT32 MicrocodeRevision;
149 } CPU_AP_DATA;
150
151 //
152 // Basic CPU information saved in Guided HOB.
153 // Because the contents will be shard between PEI and DXE,
154 // we need to make sure the each fields offset same in different
155 // architecture.
156 //
157 #pragma pack (1)
158 typedef struct {
159 UINT32 InitialApicId;
160 UINT32 ApicId;
161 UINT32 Health;
162 UINT64 ApTopOfStack;
163 } CPU_INFO_IN_HOB;
164 #pragma pack ()
165
166 //
167 // AP reset code information including code address and size,
168 // this structure will be shared be C code and assembly code.
169 // It is natural aligned by design.
170 //
171 typedef struct {
172 UINT8 *RendezvousFunnelAddress;
173 UINTN ModeEntryOffset;
174 UINTN RendezvousFunnelSize;
175 UINT8 *RelocateApLoopFuncAddress;
176 UINTN RelocateApLoopFuncSize;
177 UINTN ModeTransitionOffset;
178 UINTN SwitchToRealSize;
179 UINTN SwitchToRealOffset;
180 UINTN SwitchToRealNoNxOffset;
181 UINTN SwitchToRealPM16ModeOffset;
182 UINTN SwitchToRealPM16ModeSize;
183 } MP_ASSEMBLY_ADDRESS_MAP;
184
185 typedef struct _CPU_MP_DATA CPU_MP_DATA;
186
187 #pragma pack(1)
188
189 //
190 // MP CPU exchange information for AP reset code
191 // This structure is required to be packed because fixed field offsets
192 // into this structure are used in assembly code in this module
193 //
194 typedef struct {
195 UINTN StackStart;
196 UINTN StackSize;
197 UINTN CFunction;
198 IA32_DESCRIPTOR GdtrProfile;
199 IA32_DESCRIPTOR IdtrProfile;
200 UINTN BufferStart;
201 UINTN ModeOffset;
202 UINTN ApIndex;
203 UINTN CodeSegment;
204 UINTN DataSegment;
205 UINTN EnableExecuteDisable;
206 UINTN Cr3;
207 UINTN InitFlag;
208 CPU_INFO_IN_HOB *CpuInfo;
209 UINTN NumApsExecuting;
210 CPU_MP_DATA *CpuMpData;
211 UINTN InitializeFloatingPointUnitsAddress;
212 UINT32 ModeTransitionMemory;
213 UINT16 ModeTransitionSegment;
214 UINT32 ModeHighMemory;
215 UINT16 ModeHighSegment;
216 //
217 // Enable5LevelPaging indicates whether 5-level paging is enabled in long mode.
218 //
219 BOOLEAN Enable5LevelPaging;
220 BOOLEAN SevEsIsEnabled;
221 UINTN GhcbBase;
222 } MP_CPU_EXCHANGE_INFO;
223
224 #pragma pack()
225
226 //
227 // CPU MP Data save in memory
228 //
229 struct _CPU_MP_DATA {
230 UINT64 CpuInfoInHob;
231 UINT32 CpuCount;
232 UINT32 BspNumber;
233 //
234 // The above fields data will be passed from PEI to DXE
235 // Please make sure the fields offset same in the different
236 // architecture.
237 //
238 SPIN_LOCK MpLock;
239 UINTN Buffer;
240 UINTN CpuApStackSize;
241 MP_ASSEMBLY_ADDRESS_MAP AddressMap;
242 UINTN WakeupBuffer;
243 UINTN WakeupBufferHigh;
244 UINTN BackupBuffer;
245 UINTN BackupBufferSize;
246
247 volatile UINT32 FinishedCount;
248 UINT32 RunningCount;
249 BOOLEAN SingleThread;
250 EFI_AP_PROCEDURE Procedure;
251 VOID *ProcArguments;
252 BOOLEAN *Finished;
253 UINT64 ExpectedTime;
254 UINT64 CurrentTime;
255 UINT64 TotalTime;
256 EFI_EVENT WaitEvent;
257 UINTN **FailedCpuList;
258
259 AP_INIT_STATE InitFlag;
260 BOOLEAN SwitchBspFlag;
261 UINTN NewBspNumber;
262 CPU_EXCHANGE_ROLE_INFO BSPInfo;
263 CPU_EXCHANGE_ROLE_INFO APInfo;
264 MTRR_SETTINGS MtrrTable;
265 UINT8 ApLoopMode;
266 UINT8 ApTargetCState;
267 UINT16 PmCodeSegment;
268 UINT16 Pm16CodeSegment;
269 CPU_AP_DATA *CpuData;
270 volatile MP_CPU_EXCHANGE_INFO *MpCpuExchangeInfo;
271
272 UINT32 CurrentTimerCount;
273 UINTN DivideValue;
274 UINT8 Vector;
275 BOOLEAN PeriodicMode;
276 BOOLEAN TimerInterruptState;
277 UINT64 MicrocodePatchAddress;
278 UINT64 MicrocodePatchRegionSize;
279
280 //
281 // Whether need to use Init-Sipi-Sipi to wake up the APs.
282 // Two cases need to set this value to TRUE. One is in HLT
283 // loop mode, the other is resume from S3 which loop mode
284 // will be hardcode change to HLT mode by PiSmmCpuDxeSmm
285 // driver.
286 //
287 BOOLEAN WakeUpByInitSipiSipi;
288
289 BOOLEAN SevEsIsEnabled;
290 UINTN SevEsAPBuffer;
291 UINTN SevEsAPResetStackStart;
292 CPU_MP_DATA *NewCpuMpData;
293
294 UINT64 GhcbBase;
295 };
296
297 #define AP_SAFE_STACK_SIZE 128
298 #define AP_RESET_STACK_SIZE AP_SAFE_STACK_SIZE
299
300 #pragma pack(1)
301
302 typedef struct {
303 UINT8 InsnBuffer[8];
304 UINT16 Rip;
305 UINT16 Segment;
306 } SEV_ES_AP_JMP_FAR;
307
308 #pragma pack()
309
310 /**
311 Assembly code to move an AP from long mode to real mode.
312
313 Move an AP from long mode to real mode in preparation to invoking
314 the reset vector. This is used for SEV-ES guests where a hypervisor
315 is not allowed to set the CS and RIP to point to the reset vector.
316
317 @param[in] BufferStart The reset vector target.
318 @param[in] Code16 16-bit protected mode code segment value.
319 @param[in] Code32 32-bit protected mode code segment value.
320 @param[in] StackStart The start of a stack to be used for transitioning
321 from long mode to real mode.
322 **/
323 typedef
324 VOID
325 (EFIAPI AP_RESET) (
326 IN UINTN BufferStart,
327 IN UINT16 Code16,
328 IN UINT16 Code32,
329 IN UINTN StackStart
330 );
331
332 extern EFI_GUID mCpuInitMpLibHobGuid;
333
334 /**
335 Assembly code to place AP into safe loop mode.
336
337 Place AP into targeted C-State if MONITOR is supported, otherwise
338 place AP into hlt state.
339 Place AP in protected mode if the current is long mode. Due to AP maybe
340 wakeup by some hardware event. It could avoid accessing page table that
341 may not available during booting to OS.
342
343 @param[in] MwaitSupport TRUE indicates MONITOR is supported.
344 FALSE indicates MONITOR is not supported.
345 @param[in] ApTargetCState Target C-State value.
346 @param[in] PmCodeSegment Protected mode code segment value.
347 **/
348 typedef
349 VOID
350 (EFIAPI * ASM_RELOCATE_AP_LOOP) (
351 IN BOOLEAN MwaitSupport,
352 IN UINTN ApTargetCState,
353 IN UINTN PmCodeSegment,
354 IN UINTN TopOfApStack,
355 IN UINTN NumberToFinish,
356 IN UINTN Pm16CodeSegment,
357 IN UINTN SevEsAPJumpTable,
358 IN UINTN WakeupBuffer
359 );
360
361 /**
362 Assembly code to get starting address and size of the rendezvous entry for APs.
363 Information for fixing a jump instruction in the code is also returned.
364
365 @param[out] AddressMap Output buffer for address map information.
366 **/
367 VOID
368 EFIAPI
369 AsmGetAddressMap (
370 OUT MP_ASSEMBLY_ADDRESS_MAP *AddressMap
371 );
372
373 /**
374 This function is called by both the BSP and the AP which is to become the BSP to
375 Exchange execution context including stack between them. After return from this
376 function, the BSP becomes AP and the AP becomes the BSP.
377
378 @param[in] MyInfo Pointer to buffer holding the exchanging information for the executing processor.
379 @param[in] OthersInfo Pointer to buffer holding the exchanging information for the peer.
380
381 **/
382 VOID
383 EFIAPI
384 AsmExchangeRole (
385 IN CPU_EXCHANGE_ROLE_INFO *MyInfo,
386 IN CPU_EXCHANGE_ROLE_INFO *OthersInfo
387 );
388
389 /**
390 Get the pointer to CPU MP Data structure.
391
392 @return The pointer to CPU MP Data structure.
393 **/
394 CPU_MP_DATA *
395 GetCpuMpData (
396 VOID
397 );
398
399 /**
400 Save the pointer to CPU MP Data structure.
401
402 @param[in] CpuMpData The pointer to CPU MP Data structure will be saved.
403 **/
404 VOID
405 SaveCpuMpData (
406 IN CPU_MP_DATA *CpuMpData
407 );
408
409
410 /**
411 Get available system memory below 1MB by specified size.
412
413 @param[in] WakeupBufferSize Wakeup buffer size required
414
415 @retval other Return wakeup buffer address below 1MB.
416 @retval -1 Cannot find free memory below 1MB.
417 **/
418 UINTN
419 GetWakeupBuffer (
420 IN UINTN WakeupBufferSize
421 );
422
423 /**
424 Get available EfiBootServicesCode memory below 4GB by specified size.
425
426 This buffer is required to safely transfer AP from real address mode to
427 protected mode or long mode, due to the fact that the buffer returned by
428 GetWakeupBuffer() may be marked as non-executable.
429
430 @param[in] BufferSize Wakeup transition buffer size.
431
432 @retval other Return wakeup transition buffer address below 4GB.
433 @retval 0 Cannot find free memory below 4GB.
434 **/
435 UINTN
436 GetModeTransitionBuffer (
437 IN UINTN BufferSize
438 );
439
440 /**
441 Return the address of the SEV-ES AP jump table.
442
443 This buffer is required in order for an SEV-ES guest to transition from
444 UEFI into an OS.
445
446 @return Return SEV-ES AP jump table buffer
447 **/
448 UINTN
449 GetSevEsAPMemory (
450 VOID
451 );
452
453 /**
454 This function will be called by BSP to wakeup AP.
455
456 @param[in] CpuMpData Pointer to CPU MP Data
457 @param[in] Broadcast TRUE: Send broadcast IPI to all APs
458 FALSE: Send IPI to AP by ApicId
459 @param[in] ProcessorNumber The handle number of specified processor
460 @param[in] Procedure The function to be invoked by AP
461 @param[in] ProcedureArgument The argument to be passed into AP function
462 @param[in] WakeUpDisabledAps Whether need to wake up disabled APs in broadcast mode.
463 **/
464 VOID
465 WakeUpAP (
466 IN CPU_MP_DATA *CpuMpData,
467 IN BOOLEAN Broadcast,
468 IN UINTN ProcessorNumber,
469 IN EFI_AP_PROCEDURE Procedure, OPTIONAL
470 IN VOID *ProcedureArgument, OPTIONAL
471 IN BOOLEAN WakeUpDisabledAps OPTIONAL
472 );
473
474 /**
475 Initialize global data for MP support.
476
477 @param[in] CpuMpData The pointer to CPU MP Data structure.
478 **/
479 VOID
480 InitMpGlobalData (
481 IN CPU_MP_DATA *CpuMpData
482 );
483
484 /**
485 Worker function to execute a caller provided function on all enabled APs.
486
487 @param[in] Procedure A pointer to the function to be run on
488 enabled APs of the system.
489 @param[in] SingleThread If TRUE, then all the enabled APs execute
490 the function specified by Procedure one by
491 one, in ascending order of processor handle
492 number. If FALSE, then all the enabled APs
493 execute the function specified by Procedure
494 simultaneously.
495 @param[in] ExcludeBsp Whether let BSP also trig this task.
496 @param[in] WaitEvent The event created by the caller with CreateEvent()
497 service.
498 @param[in] TimeoutInMicroseconds Indicates the time limit in microseconds for
499 APs to return from Procedure, either for
500 blocking or non-blocking mode.
501 @param[in] ProcedureArgument The parameter passed into Procedure for
502 all APs.
503 @param[out] FailedCpuList If all APs finish successfully, then its
504 content is set to NULL. If not all APs
505 finish before timeout expires, then its
506 content is set to address of the buffer
507 holding handle numbers of the failed APs.
508
509 @retval EFI_SUCCESS In blocking mode, all APs have finished before
510 the timeout expired.
511 @retval EFI_SUCCESS In non-blocking mode, function has been dispatched
512 to all enabled APs.
513 @retval others Failed to Startup all APs.
514
515 **/
516 EFI_STATUS
517 StartupAllCPUsWorker (
518 IN EFI_AP_PROCEDURE Procedure,
519 IN BOOLEAN SingleThread,
520 IN BOOLEAN ExcludeBsp,
521 IN EFI_EVENT WaitEvent OPTIONAL,
522 IN UINTN TimeoutInMicroseconds,
523 IN VOID *ProcedureArgument OPTIONAL,
524 OUT UINTN **FailedCpuList OPTIONAL
525 );
526
527 /**
528 Worker function to let the caller get one enabled AP to execute a caller-provided
529 function.
530
531 @param[in] Procedure A pointer to the function to be run on
532 enabled APs of the system.
533 @param[in] ProcessorNumber The handle number of the AP.
534 @param[in] WaitEvent The event created by the caller with CreateEvent()
535 service.
536 @param[in] TimeoutInMicroseconds Indicates the time limit in microseconds for
537 APs to return from Procedure, either for
538 blocking or non-blocking mode.
539 @param[in] ProcedureArgument The parameter passed into Procedure for
540 all APs.
541 @param[out] Finished If AP returns from Procedure before the
542 timeout expires, its content is set to TRUE.
543 Otherwise, the value is set to FALSE.
544
545 @retval EFI_SUCCESS In blocking mode, specified AP finished before
546 the timeout expires.
547 @retval others Failed to Startup AP.
548
549 **/
550 EFI_STATUS
551 StartupThisAPWorker (
552 IN EFI_AP_PROCEDURE Procedure,
553 IN UINTN ProcessorNumber,
554 IN EFI_EVENT WaitEvent OPTIONAL,
555 IN UINTN TimeoutInMicroseconds,
556 IN VOID *ProcedureArgument OPTIONAL,
557 OUT BOOLEAN *Finished OPTIONAL
558 );
559
560 /**
561 Worker function to switch the requested AP to be the BSP from that point onward.
562
563 @param[in] ProcessorNumber The handle number of AP that is to become the new BSP.
564 @param[in] EnableOldBSP If TRUE, then the old BSP will be listed as an
565 enabled AP. Otherwise, it will be disabled.
566
567 @retval EFI_SUCCESS BSP successfully switched.
568 @retval others Failed to switch BSP.
569
570 **/
571 EFI_STATUS
572 SwitchBSPWorker (
573 IN UINTN ProcessorNumber,
574 IN BOOLEAN EnableOldBSP
575 );
576
577 /**
578 Worker function to let the caller enable or disable an AP from this point onward.
579 This service may only be called from the BSP.
580
581 @param[in] ProcessorNumber The handle number of AP.
582 @param[in] EnableAP Specifies the new state for the processor for
583 enabled, FALSE for disabled.
584 @param[in] HealthFlag If not NULL, a pointer to a value that specifies
585 the new health status of the AP.
586
587 @retval EFI_SUCCESS The specified AP was enabled or disabled successfully.
588 @retval others Failed to Enable/Disable AP.
589
590 **/
591 EFI_STATUS
592 EnableDisableApWorker (
593 IN UINTN ProcessorNumber,
594 IN BOOLEAN EnableAP,
595 IN UINT32 *HealthFlag OPTIONAL
596 );
597
598 /**
599 Get pointer to CPU MP Data structure from GUIDed HOB.
600
601 @return The pointer to CPU MP Data structure.
602 **/
603 CPU_MP_DATA *
604 GetCpuMpDataFromGuidedHob (
605 VOID
606 );
607
608 /** Checks status of specified AP.
609
610 This function checks whether the specified AP has finished the task assigned
611 by StartupThisAP(), and whether timeout expires.
612
613 @param[in] ProcessorNumber The handle number of processor.
614
615 @retval EFI_SUCCESS Specified AP has finished task assigned by StartupThisAPs().
616 @retval EFI_TIMEOUT The timeout expires.
617 @retval EFI_NOT_READY Specified AP has not finished task and timeout has not expired.
618 **/
619 EFI_STATUS
620 CheckThisAP (
621 IN UINTN ProcessorNumber
622 );
623
624 /**
625 Checks status of all APs.
626
627 This function checks whether all APs have finished task assigned by StartupAllAPs(),
628 and whether timeout expires.
629
630 @retval EFI_SUCCESS All APs have finished task assigned by StartupAllAPs().
631 @retval EFI_TIMEOUT The timeout expires.
632 @retval EFI_NOT_READY APs have not finished task and timeout has not expired.
633 **/
634 EFI_STATUS
635 CheckAllAPs (
636 VOID
637 );
638
639 /**
640 Checks APs status and updates APs status if needed.
641
642 **/
643 VOID
644 CheckAndUpdateApsStatus (
645 VOID
646 );
647
648 /**
649 Detect whether specified processor can find matching microcode patch and load it.
650
651 @param[in] CpuMpData The pointer to CPU MP Data structure.
652 @param[in] ProcessorNumber The handle number of the processor. The range is
653 from 0 to the total number of logical processors
654 minus 1.
655 **/
656 VOID
657 MicrocodeDetect (
658 IN CPU_MP_DATA *CpuMpData,
659 IN UINTN ProcessorNumber
660 );
661
662 /**
663 Shadow the required microcode patches data into memory.
664
665 @param[in, out] CpuMpData The pointer to CPU MP Data structure.
666 **/
667 VOID
668 ShadowMicrocodeUpdatePatch (
669 IN OUT CPU_MP_DATA *CpuMpData
670 );
671
672 /**
673 Get the cached microcode patch base address and size from the microcode patch
674 information cache HOB.
675
676 @param[out] Address Base address of the microcode patches data.
677 It will be updated if the microcode patch
678 information cache HOB is found.
679 @param[out] RegionSize Size of the microcode patches data.
680 It will be updated if the microcode patch
681 information cache HOB is found.
682
683 @retval TRUE The microcode patch information cache HOB is found.
684 @retval FALSE The microcode patch information cache HOB is not found.
685
686 **/
687 BOOLEAN
688 GetMicrocodePatchInfoFromHob (
689 UINT64 *Address,
690 UINT64 *RegionSize
691 );
692
693 /**
694 Detect whether Mwait-monitor feature is supported.
695
696 @retval TRUE Mwait-monitor feature is supported.
697 @retval FALSE Mwait-monitor feature is not supported.
698 **/
699 BOOLEAN
700 IsMwaitSupport (
701 VOID
702 );
703
704 /**
705 Enable Debug Agent to support source debugging on AP function.
706
707 **/
708 VOID
709 EnableDebugAgent (
710 VOID
711 );
712
713 /**
714 Find the current Processor number by APIC ID.
715
716 @param[in] CpuMpData Pointer to PEI CPU MP Data
717 @param[out] ProcessorNumber Return the pocessor number found
718
719 @retval EFI_SUCCESS ProcessorNumber is found and returned.
720 @retval EFI_NOT_FOUND ProcessorNumber is not found.
721 **/
722 EFI_STATUS
723 GetProcessorNumber (
724 IN CPU_MP_DATA *CpuMpData,
725 OUT UINTN *ProcessorNumber
726 );
727
728 /**
729 This funtion will try to invoke platform specific microcode shadow logic to
730 relocate microcode update patches into memory.
731
732 @param[in, out] CpuMpData The pointer to CPU MP Data structure.
733
734 @retval EFI_SUCCESS Shadow microcode success.
735 @retval EFI_OUT_OF_RESOURCES No enough resource to complete the operation.
736 @retval EFI_UNSUPPORTED Can't find platform specific microcode shadow
737 PPI/Protocol.
738 **/
739 EFI_STATUS
740 PlatformShadowMicrocode (
741 IN OUT CPU_MP_DATA *CpuMpData
742 );
743
744 #endif
745