TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmRelocation.c
Go to the documentation of this file.
1
9#include <Library/DebugLib.h>
12#include <Ppi/MpServices2.h>
13#include "Platform.h"
14
28EFIAPI
30 IN EFI_PEI_SERVICES **PeiServices,
31 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
32 IN VOID *Ppi
33 )
34{
35 EDKII_PEI_MP_SERVICES2_PPI *MpServices2;
36 EFI_STATUS Status;
37
38 DEBUG ((DEBUG_INFO, "%a: %a\n", gEfiCallerBaseName, __func__));
39
40 MpServices2 = Ppi;
41
42 //
43 // Smm Relocation Initialize.
44 //
45 Status = SmmRelocationInit (MpServices2);
46 if (EFI_ERROR (Status)) {
47 DEBUG ((DEBUG_WARN, "OnMpServices2Available: Not able to execute Smm Relocation Init. Status: %r\n", Status));
48 }
49
50 return EFI_SUCCESS;
51}
52
53//
54// Notification object for registering the callback, for when
55// EDKII_PEI_MP_SERVICES2_PPI becomes available.
56//
57STATIC CONST EFI_PEI_NOTIFY_DESCRIPTOR mMpServices2Notify = {
58 EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | // Flags
59 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
60 &gEdkiiPeiMpServices2PpiGuid, // Guid
62};
63
64VOID
65RelocateSmBase (
66 VOID
67 )
68{
69 EFI_STATUS Status;
70
71 Status = PeiServicesNotifyPpi (&mMpServices2Notify);
72 if (EFI_ERROR (Status)) {
73 DEBUG ((
74 DEBUG_ERROR,
75 "%a: failed to set up MP Services2 callback: %r\n",
76 __func__,
77 Status
78 ));
79 }
80}
EFI_STATUS EFIAPI PeiServicesNotifyPpi(IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList)
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define IN
Definition: Base.h:279
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_STATUS EFIAPI SmmRelocationInit(IN EDKII_PEI_MP_SERVICES2_PPI *MpServices2)
STATIC EFI_STATUS EFIAPI OnMpServices2Available(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
Definition: SmmRelocation.c:29
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112