TianoCore EDK2
master
Loading...
Searching...
No Matches
ClearCache.c
Go to the documentation of this file.
1
14
#include <
Library/CacheMaintenanceLib.h
>
15
#include <
Library/DebugLib.h
>
16
#include <
Library/PeiServicesLib.h
>
17
#include <
Ppi/MpServices.h
>
18
19
#include "
Platform.h
"
20
29
STATIC
30
VOID
31
EFIAPI
32
ClearCache
(
33
IN
OUT
VOID *WorkSpace
34
)
35
{
36
WriteBackInvalidateDataCache
();
37
InvalidateInstructionCache
();
38
}
39
51
STATIC
52
EFI_STATUS
53
EFIAPI
54
ClearCacheOnMpServicesAvailable
(
55
IN
EFI_PEI_SERVICES
**PeiServices,
56
IN
EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor,
57
IN
VOID *Ppi
58
)
59
{
60
EFI_PEI_MP_SERVICES_PPI
*MpServices;
61
EFI_STATUS
Status;
62
63
DEBUG
((DEBUG_INFO,
"%a: %a\n"
, gEfiCallerBaseName, __func__));
64
65
//
66
// Clear cache on all the APs in parallel.
67
//
68
MpServices = Ppi;
69
Status = MpServices->StartupAllAPs (
70
(
CONST
EFI_PEI_SERVICES
**)PeiServices,
71
MpServices,
72
ClearCache
,
// Procedure
73
FALSE
,
// SingleThread
74
0,
// TimeoutInMicroSeconds: inf.
75
NULL
// ProcedureArgument
76
);
77
if
(EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {
78
DEBUG
((DEBUG_ERROR,
"%a: StartupAllAps(): %r\n"
, __func__, Status));
79
return
Status;
80
}
81
82
//
83
// Now clear cache on the BSP too.
84
//
85
ClearCache
(
NULL
);
86
return
EFI_SUCCESS
;
87
}
88
89
//
90
// Notification object for registering the callback, for when
91
// EFI_PEI_MP_SERVICES_PPI becomes available.
92
//
93
STATIC
CONST
EFI_PEI_NOTIFY_DESCRIPTOR
mMpServicesNotify = {
94
EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK |
// Flags
95
EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
96
&gEfiPeiMpServicesPpiGuid,
// Guid
97
ClearCacheOnMpServicesAvailable
// Notify
98
};
99
100
VOID
101
InstallClearCacheCallback (
102
VOID
103
)
104
{
105
EFI_STATUS
Status;
106
107
Status =
PeiServicesNotifyPpi
(&mMpServicesNotify);
108
if
(EFI_ERROR (Status)) {
109
DEBUG
((
110
DEBUG_ERROR,
111
"%a: failed to set up MP Services callback: %r\n"
,
112
__func__,
113
Status
114
));
115
}
116
}
InvalidateInstructionCache
VOID EFIAPI InvalidateInstructionCache(VOID)
Definition:
ArmCacheMaintenanceLib.c:43
WriteBackInvalidateDataCache
VOID EFIAPI WriteBackInvalidateDataCache(VOID)
Definition:
ArmCacheMaintenanceLib.c:86
ClearCacheOnMpServicesAvailable
STATIC EFI_STATUS EFIAPI ClearCacheOnMpServicesAvailable(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
Definition:
ClearCache.c:53
ClearCache
STATIC VOID EFIAPI ClearCache(IN OUT VOID *WorkSpace)
Definition:
ClearCache.c:31
CacheMaintenanceLib.h
PeiServicesNotifyPpi
EFI_STATUS EFIAPI PeiServicesNotifyPpi(IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList)
Definition:
PeiServicesLib.c:146
NULL
#define NULL
Definition:
Base.h:319
CONST
#define CONST
Definition:
Base.h:259
STATIC
#define STATIC
Definition:
Base.h:264
FALSE
#define FALSE
Definition:
Base.h:307
IN
#define IN
Definition:
Base.h:279
OUT
#define OUT
Definition:
Base.h:284
DebugLib.h
DEBUG
#define DEBUG(Expression)
Definition:
DebugLib.h:434
MpServices.h
Platform.h
PeiServicesLib.h
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_SUCCESS
#define EFI_SUCCESS
Definition:
UefiBaseType.h:112
_EFI_PEI_MP_SERVICES_PPI
Definition:
MpServices.h:265
_EFI_PEI_NOTIFY_DESCRIPTOR
Definition:
PiPeiCis.h:110
_EFI_PEI_SERVICES
Definition:
PiPeiCis.h:877
OvmfPkg
XenPlatformPei
ClearCache.c
Generated on Fri Nov 15 2024 18:01:22 for TianoCore EDK2 by
1.9.6