]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/Pei/Ppi/Ppi.c
Enhance the PEI Core to convert pointers pointing to PPI descriptors on the temporary...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Ppi / Ppi.c
1 /** @file
2 EFI PEI Core PPI services
3
4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5 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 **/
14
15 #include "PeiMain.h"
16
17 /**
18
19 Initialize PPI services.
20
21 @param PrivateData Pointer to the PEI Core data.
22 @param OldCoreData Pointer to old PEI Core data.
23 NULL if being run in non-permament memory mode.
24
25 **/
26 VOID
27 InitializePpiServices (
28 IN PEI_CORE_INSTANCE *PrivateData,
29 IN PEI_CORE_INSTANCE *OldCoreData
30 )
31 {
32 if (OldCoreData == NULL) {
33 PrivateData->PpiData.NotifyListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
34 PrivateData->PpiData.DispatchListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
35 PrivateData->PpiData.LastDispatchedNotify = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
36 }
37 }
38
39 /**
40
41 Migrate the Hob list from the temporary memory stack to PEI installed memory.
42
43 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
44 and location of temporary RAM, the stack location and the BFV location.
45 @param PrivateData Pointer to PeiCore's private data structure.
46
47 **/
48 VOID
49 ConvertPpiPointers (
50 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
51 IN PEI_CORE_INSTANCE *PrivateData
52 )
53 {
54 UINT8 Index;
55 PEI_PPI_LIST_POINTERS *PpiPointer;
56 UINTN OldHeapTop;
57 UINTN OldHeapBottom;
58 UINTN OldStackTop;
59 UINTN OldStackBottom;
60
61 OldHeapBottom = (UINTN)SecCoreData->PeiTemporaryRamBase;
62 OldHeapTop = (UINTN)SecCoreData->PeiTemporaryRamBase + SecCoreData->PeiTemporaryRamSize;
63 OldStackBottom = (UINTN)SecCoreData->StackBase;
64 OldStackTop = (UINTN)SecCoreData->StackBase + SecCoreData->StackSize;
65
66 for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {
67 if (Index < PrivateData->PpiData.PpiListEnd ||
68 Index > PrivateData->PpiData.NotifyListEnd) {
69 PpiPointer = &PrivateData->PpiData.PpiListPtrs[Index];
70
71 if (((UINTN)PpiPointer->Raw < OldHeapTop) &&
72 ((UINTN)PpiPointer->Raw >= OldHeapBottom)) {
73 //
74 // Convert the pointer to the PPI descriptor from the old HOB heap
75 // to the relocated HOB heap.
76 //
77 if (PrivateData->HeapOffsetPositive) {
78 PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw + PrivateData->HeapOffset);
79 } else {
80 PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw - PrivateData->HeapOffset);
81 }
82
83 //
84 // Only when the PEIM descriptor is in the old HOB should it be necessary
85 // to try to convert the pointers in the PEIM descriptor
86 //
87
88 if (((UINTN)PpiPointer->Ppi->Guid < OldHeapTop) &&
89 ((UINTN)PpiPointer->Ppi->Guid >= OldHeapBottom)) {
90 //
91 // Convert the pointer to the GUID in the PPI or NOTIFY descriptor
92 // from the old HOB heap to the relocated HOB heap.
93 //
94 if (PrivateData->HeapOffsetPositive) {
95 PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid + PrivateData->HeapOffset);
96 } else {
97 PpiPointer->Ppi->Guid = (VOID *) ((UINTN)PpiPointer->Ppi->Guid - PrivateData->HeapOffset);
98 }
99 }
100
101 //
102 // Assume that no code is located in the temporary memory, so the pointer to
103 // the notification function in the NOTIFY descriptor needs not be converted.
104 //
105 if (Index < PrivateData->PpiData.PpiListEnd &&
106 (UINTN)PpiPointer->Ppi->Ppi < OldHeapTop &&
107 (UINTN)PpiPointer->Ppi->Ppi >= OldHeapBottom) {
108 //
109 // Convert the pointer to the PPI interface structure in the PPI descriptor
110 // from the old HOB heap to the relocated HOB heap.
111 //
112 if (PrivateData->HeapOffsetPositive) {
113 PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi + PrivateData->HeapOffset);
114 } else {
115 PpiPointer->Ppi->Ppi = (VOID *) ((UINTN)PpiPointer->Ppi->Ppi - PrivateData->HeapOffset);
116 }
117 }
118 } else if (((UINTN)PpiPointer->Raw < OldStackTop) && ((UINTN)PpiPointer->Raw >= OldStackBottom)) {
119 //
120 // Convert the pointer to the PPI descriptor from the temporary stack
121 // to the permanent PEI stack.
122 //
123 if (PrivateData->StackOffsetPositive) {
124 PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw + PrivateData->StackOffset);
125 } else {
126 PpiPointer->Raw = (VOID *) ((UINTN)PpiPointer->Raw - PrivateData->StackOffset);
127 }
128 }
129 }
130 }
131 }
132
133 /**
134
135 This function installs an interface in the PEI PPI database by GUID.
136 The purpose of the service is to publish an interface that other parties
137 can use to call additional PEIMs.
138
139 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
140 @param PpiList Pointer to a list of PEI PPI Descriptors.
141
142 @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed.
143 @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer
144 if any PPI in PpiList is not valid
145 @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI
146
147 **/
148 EFI_STATUS
149 EFIAPI
150 PeiInstallPpi (
151 IN CONST EFI_PEI_SERVICES **PeiServices,
152 IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
153 )
154 {
155 PEI_CORE_INSTANCE *PrivateData;
156 INTN Index;
157 INTN LastCallbackInstall;
158
159
160 if (PpiList == NULL) {
161 return EFI_INVALID_PARAMETER;
162 }
163
164 PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
165
166 Index = PrivateData->PpiData.PpiListEnd;
167 LastCallbackInstall = Index;
168
169 //
170 // This is loop installs all PPI descriptors in the PpiList. It is terminated
171 // by the EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST being set in the last
172 // EFI_PEI_PPI_DESCRIPTOR in the list.
173 //
174
175 for (;;) {
176 //
177 // Since PpiData is used for NotifyList and PpiList, max resource
178 // is reached if the Install reaches the NotifyList
179 // PcdPeiCoreMaxPpiSupported can be set to a larger value in DSC to satisfy more PPI requirement.
180 //
181 if (Index == PrivateData->PpiData.NotifyListEnd + 1) {
182 return EFI_OUT_OF_RESOURCES;
183 }
184 //
185 // Check if it is a valid PPI.
186 // If not, rollback list to exclude all in this list.
187 // Try to indicate which item failed.
188 //
189 if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_PPI) == 0) {
190 PrivateData->PpiData.PpiListEnd = LastCallbackInstall;
191 DEBUG((EFI_D_ERROR, "ERROR -> InstallPpi: %g %p\n", PpiList->Guid, PpiList->Ppi));
192 return EFI_INVALID_PARAMETER;
193 }
194
195 DEBUG((EFI_D_INFO, "Install PPI: %g\n", PpiList->Guid));
196 PrivateData->PpiData.PpiListPtrs[Index].Ppi = (EFI_PEI_PPI_DESCRIPTOR*) PpiList;
197 PrivateData->PpiData.PpiListEnd++;
198
199 //
200 // Continue until the end of the PPI List.
201 //
202 if ((PpiList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) ==
203 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) {
204 break;
205 }
206 PpiList++;
207 Index++;
208 }
209
210 //
211 // Dispatch any callback level notifies for newly installed PPIs.
212 //
213 DispatchNotify (
214 PrivateData,
215 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK,
216 LastCallbackInstall,
217 PrivateData->PpiData.PpiListEnd,
218 PrivateData->PpiData.DispatchListEnd,
219 PrivateData->PpiData.NotifyListEnd
220 );
221
222
223 return EFI_SUCCESS;
224 }
225
226 /**
227
228 This function reinstalls an interface in the PEI PPI database by GUID.
229 The purpose of the service is to publish an interface that other parties can
230 use to replace an interface of the same name in the protocol database with a
231 different interface.
232
233 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
234 @param OldPpi Pointer to the old PEI PPI Descriptors.
235 @param NewPpi Pointer to the new PEI PPI Descriptors.
236
237 @retval EFI_SUCCESS if the operation was successful
238 @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL
239 @retval EFI_INVALID_PARAMETER if NewPpi is not valid
240 @retval EFI_NOT_FOUND if the PPI was not in the database
241
242 **/
243 EFI_STATUS
244 EFIAPI
245 PeiReInstallPpi (
246 IN CONST EFI_PEI_SERVICES **PeiServices,
247 IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi,
248 IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi
249 )
250 {
251 PEI_CORE_INSTANCE *PrivateData;
252 INTN Index;
253
254
255 if ((OldPpi == NULL) || (NewPpi == NULL)) {
256 return EFI_INVALID_PARAMETER;
257 }
258
259 if ((NewPpi->Flags & EFI_PEI_PPI_DESCRIPTOR_PPI) == 0) {
260 return EFI_INVALID_PARAMETER;
261 }
262
263 PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
264
265 //
266 // Find the old PPI instance in the database. If we can not find it,
267 // return the EFI_NOT_FOUND error.
268 //
269 for (Index = 0; Index < PrivateData->PpiData.PpiListEnd; Index++) {
270 if (OldPpi == PrivateData->PpiData.PpiListPtrs[Index].Ppi) {
271 break;
272 }
273 }
274 if (Index == PrivateData->PpiData.PpiListEnd) {
275 return EFI_NOT_FOUND;
276 }
277
278 //
279 // Remove the old PPI from the database, add the new one.
280 //
281 DEBUG((EFI_D_INFO, "Reinstall PPI: %g\n", NewPpi->Guid));
282 ASSERT (Index < (INTN)(FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)));
283 PrivateData->PpiData.PpiListPtrs[Index].Ppi = (EFI_PEI_PPI_DESCRIPTOR *) NewPpi;
284
285 //
286 // Dispatch any callback level notifies for the newly installed PPI.
287 //
288 DispatchNotify (
289 PrivateData,
290 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK,
291 Index,
292 Index+1,
293 PrivateData->PpiData.DispatchListEnd,
294 PrivateData->PpiData.NotifyListEnd
295 );
296
297
298 return EFI_SUCCESS;
299 }
300
301 /**
302
303 Locate a given named PPI.
304
305
306 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
307 @param Guid Pointer to GUID of the PPI.
308 @param Instance Instance Number to discover.
309 @param PpiDescriptor Pointer to reference the found descriptor. If not NULL,
310 returns a pointer to the descriptor (includes flags, etc)
311 @param Ppi Pointer to reference the found PPI
312
313 @retval EFI_SUCCESS if the PPI is in the database
314 @retval EFI_NOT_FOUND if the PPI is not in the database
315
316 **/
317 EFI_STATUS
318 EFIAPI
319 PeiLocatePpi (
320 IN CONST EFI_PEI_SERVICES **PeiServices,
321 IN CONST EFI_GUID *Guid,
322 IN UINTN Instance,
323 IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
324 IN OUT VOID **Ppi
325 )
326 {
327 PEI_CORE_INSTANCE *PrivateData;
328 INTN Index;
329 EFI_GUID *CheckGuid;
330 EFI_PEI_PPI_DESCRIPTOR *TempPtr;
331
332
333 PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
334
335 //
336 // Search the data base for the matching instance of the GUIDed PPI.
337 //
338 for (Index = 0; Index < PrivateData->PpiData.PpiListEnd; Index++) {
339 TempPtr = PrivateData->PpiData.PpiListPtrs[Index].Ppi;
340 CheckGuid = TempPtr->Guid;
341
342 //
343 // Don't use CompareGuid function here for performance reasons.
344 // Instead we compare the GUID as INT32 at a time and branch
345 // on the first failed comparison.
346 //
347 if ((((INT32 *)Guid)[0] == ((INT32 *)CheckGuid)[0]) &&
348 (((INT32 *)Guid)[1] == ((INT32 *)CheckGuid)[1]) &&
349 (((INT32 *)Guid)[2] == ((INT32 *)CheckGuid)[2]) &&
350 (((INT32 *)Guid)[3] == ((INT32 *)CheckGuid)[3])) {
351 if (Instance == 0) {
352
353 if (PpiDescriptor != NULL) {
354 *PpiDescriptor = TempPtr;
355 }
356
357 if (Ppi != NULL) {
358 *Ppi = TempPtr->Ppi;
359 }
360
361
362 return EFI_SUCCESS;
363 }
364 Instance--;
365 }
366 }
367
368 return EFI_NOT_FOUND;
369 }
370
371 /**
372
373 This function installs a notification service to be called back when a given
374 interface is installed or reinstalled. The purpose of the service is to publish
375 an interface that other parties can use to call additional PPIs that may materialize later.
376
377 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
378 @param NotifyList Pointer to list of Descriptors to notify upon.
379
380 @retval EFI_SUCCESS if successful
381 @retval EFI_OUT_OF_RESOURCES if no space in the database
382 @retval EFI_INVALID_PARAMETER if not a good decriptor
383
384 **/
385 EFI_STATUS
386 EFIAPI
387 PeiNotifyPpi (
388 IN CONST EFI_PEI_SERVICES **PeiServices,
389 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList
390 )
391 {
392 PEI_CORE_INSTANCE *PrivateData;
393 INTN Index;
394 INTN NotifyIndex;
395 INTN LastCallbackNotify;
396 EFI_PEI_NOTIFY_DESCRIPTOR *NotifyPtr;
397 UINTN NotifyDispatchCount;
398
399
400 NotifyDispatchCount = 0;
401
402 if (NotifyList == NULL) {
403 return EFI_INVALID_PARAMETER;
404 }
405
406 PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
407
408 Index = PrivateData->PpiData.NotifyListEnd;
409 LastCallbackNotify = Index;
410
411 //
412 // This is loop installs all Notify descriptors in the NotifyList. It is
413 // terminated by the EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST being set in the last
414 // EFI_PEI_NOTIFY_DESCRIPTOR in the list.
415 //
416
417 for (;;) {
418 //
419 // Since PpiData is used for NotifyList and InstallList, max resource
420 // is reached if the Install reaches the PpiList
421 // PcdPeiCoreMaxPpiSupported can be set to a larger value in DSC to satisfy more Notify PPIs requirement.
422 //
423 if (Index == PrivateData->PpiData.PpiListEnd - 1) {
424 return EFI_OUT_OF_RESOURCES;
425 }
426
427 //
428 // If some of the PPI data is invalid restore original Notify PPI database value
429 //
430 if ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES) == 0) {
431 PrivateData->PpiData.NotifyListEnd = LastCallbackNotify;
432 DEBUG((EFI_D_ERROR, "ERROR -> InstallNotify: %g %p\n", NotifyList->Guid, NotifyList->Notify));
433 return EFI_INVALID_PARAMETER;
434 }
435
436 if ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH) != 0) {
437 NotifyDispatchCount ++;
438 }
439
440 PrivateData->PpiData.PpiListPtrs[Index].Notify = (EFI_PEI_NOTIFY_DESCRIPTOR *) NotifyList;
441
442 PrivateData->PpiData.NotifyListEnd--;
443 DEBUG((EFI_D_INFO, "Register PPI Notify: %g\n", NotifyList->Guid));
444 if ((NotifyList->Flags & EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) ==
445 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST) {
446 break;
447 }
448 //
449 // Go the next descriptor. Remember the NotifyList moves down.
450 //
451 NotifyList++;
452 Index--;
453 }
454
455 //
456 // If there is Dispatch Notify PPI installed put them on the bottom
457 //
458 if (NotifyDispatchCount > 0) {
459 for (NotifyIndex = LastCallbackNotify; NotifyIndex > PrivateData->PpiData.NotifyListEnd; NotifyIndex--) {
460 if ((PrivateData->PpiData.PpiListPtrs[NotifyIndex].Notify->Flags & EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH) != 0) {
461 NotifyPtr = PrivateData->PpiData.PpiListPtrs[NotifyIndex].Notify;
462
463 for (Index = NotifyIndex; Index < PrivateData->PpiData.DispatchListEnd; Index++){
464 PrivateData->PpiData.PpiListPtrs[Index].Notify = PrivateData->PpiData.PpiListPtrs[Index + 1].Notify;
465 }
466 PrivateData->PpiData.PpiListPtrs[Index].Notify = NotifyPtr;
467 PrivateData->PpiData.DispatchListEnd--;
468 }
469 }
470
471 LastCallbackNotify -= NotifyDispatchCount;
472 }
473
474 //
475 // Dispatch any callback level notifies for all previously installed PPIs.
476 //
477 DispatchNotify (
478 PrivateData,
479 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK,
480 0,
481 PrivateData->PpiData.PpiListEnd,
482 LastCallbackNotify,
483 PrivateData->PpiData.NotifyListEnd
484 );
485
486 return EFI_SUCCESS;
487 }
488
489
490 /**
491
492 Process the Notify List at dispatch level.
493
494 @param PrivateData PeiCore's private data structure.
495
496 **/
497 VOID
498 ProcessNotifyList (
499 IN PEI_CORE_INSTANCE *PrivateData
500 )
501 {
502 INTN TempValue;
503
504 while (TRUE) {
505 //
506 // Check if the PEIM that was just dispatched resulted in any
507 // Notifies getting installed. If so, go process any dispatch
508 // level Notifies that match the previouly installed PPIs.
509 // Use "while" instead of "if" since DispatchNotify can modify
510 // DispatchListEnd (with NotifyPpi) so we have to iterate until the same.
511 //
512 while (PrivateData->PpiData.LastDispatchedNotify != PrivateData->PpiData.DispatchListEnd) {
513 TempValue = PrivateData->PpiData.DispatchListEnd;
514 DispatchNotify (
515 PrivateData,
516 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH,
517 0,
518 PrivateData->PpiData.LastDispatchedInstall,
519 PrivateData->PpiData.LastDispatchedNotify,
520 PrivateData->PpiData.DispatchListEnd
521 );
522 PrivateData->PpiData.LastDispatchedNotify = TempValue;
523 }
524
525
526 //
527 // Check if the PEIM that was just dispatched resulted in any
528 // PPIs getting installed. If so, go process any dispatch
529 // level Notifies that match the installed PPIs.
530 // Use "while" instead of "if" since DispatchNotify can modify
531 // PpiListEnd (with InstallPpi) so we have to iterate until the same.
532 //
533 while (PrivateData->PpiData.LastDispatchedInstall != PrivateData->PpiData.PpiListEnd) {
534 TempValue = PrivateData->PpiData.PpiListEnd;
535 DispatchNotify (
536 PrivateData,
537 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH,
538 PrivateData->PpiData.LastDispatchedInstall,
539 PrivateData->PpiData.PpiListEnd,
540 FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1,
541 PrivateData->PpiData.DispatchListEnd
542 );
543 PrivateData->PpiData.LastDispatchedInstall = TempValue;
544 }
545
546 if (PrivateData->PpiData.LastDispatchedNotify == PrivateData->PpiData.DispatchListEnd) {
547 break;
548 }
549 }
550 return;
551 }
552
553 /**
554
555 Dispatch notifications.
556
557 @param PrivateData PeiCore's private data structure
558 @param NotifyType Type of notify to fire.
559 @param InstallStartIndex Install Beginning index.
560 @param InstallStopIndex Install Ending index.
561 @param NotifyStartIndex Notify Beginning index.
562 @param NotifyStopIndex Notify Ending index.
563
564 **/
565 VOID
566 DispatchNotify (
567 IN PEI_CORE_INSTANCE *PrivateData,
568 IN UINTN NotifyType,
569 IN INTN InstallStartIndex,
570 IN INTN InstallStopIndex,
571 IN INTN NotifyStartIndex,
572 IN INTN NotifyStopIndex
573 )
574 {
575 INTN Index1;
576 INTN Index2;
577 EFI_GUID *SearchGuid;
578 EFI_GUID *CheckGuid;
579 EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor;
580
581 //
582 // Remember that Installs moves up and Notifies moves down.
583 //
584 for (Index1 = NotifyStartIndex; Index1 > NotifyStopIndex; Index1--) {
585 NotifyDescriptor = PrivateData->PpiData.PpiListPtrs[Index1].Notify;
586
587 CheckGuid = NotifyDescriptor->Guid;
588
589 for (Index2 = InstallStartIndex; Index2 < InstallStopIndex; Index2++) {
590 SearchGuid = PrivateData->PpiData.PpiListPtrs[Index2].Ppi->Guid;
591 //
592 // Don't use CompareGuid function here for performance reasons.
593 // Instead we compare the GUID as INT32 at a time and branch
594 // on the first failed comparison.
595 //
596 if ((((INT32 *)SearchGuid)[0] == ((INT32 *)CheckGuid)[0]) &&
597 (((INT32 *)SearchGuid)[1] == ((INT32 *)CheckGuid)[1]) &&
598 (((INT32 *)SearchGuid)[2] == ((INT32 *)CheckGuid)[2]) &&
599 (((INT32 *)SearchGuid)[3] == ((INT32 *)CheckGuid)[3])) {
600 DEBUG ((EFI_D_INFO, "Notify: PPI Guid: %g, Peim notify entry point: %p\n",
601 SearchGuid,
602 NotifyDescriptor->Notify
603 ));
604 NotifyDescriptor->Notify (
605 (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),
606 NotifyDescriptor,
607 (PrivateData->PpiData.PpiListPtrs[Index2].Ppi)->Ppi
608 );
609 }
610 }
611 }
612 }
613