2 Flush the cache is required for most architectures while do capsule
3 update. It is not support at Runtime.
5 Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>
6 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include "CapsuleService.h"
14 #include <Library/CacheMaintenanceLib.h>
17 Writes Back a range of data cache lines covering a set of capsules in memory.
19 Writes Back the data cache lines specified by ScatterGatherList.
21 @param ScatterGatherList Physical address of the data structure that
22 describes a set of capsules in memory
26 CapsuleCacheWriteBack (
27 IN EFI_PHYSICAL_ADDRESS ScatterGatherList
30 EFI_CAPSULE_BLOCK_DESCRIPTOR
*Desc
;
32 if (!EfiAtRuntime ()) {
33 Desc
= (EFI_CAPSULE_BLOCK_DESCRIPTOR
*)(UINTN
)ScatterGatherList
;
35 WriteBackDataCacheRange (
40 if (Desc
->Length
> 0) {
41 WriteBackDataCacheRange (
42 (VOID
*)(UINTN
)Desc
->Union
.DataBlock
,
46 } else if (Desc
->Union
.ContinuationPointer
> 0) {
47 Desc
= (EFI_CAPSULE_BLOCK_DESCRIPTOR
*)(UINTN
)Desc
->Union
.ContinuationPointer
;
49 } while (Desc
->Length
> 0 || Desc
->Union
.ContinuationPointer
> 0);
51 WriteBackDataCacheRange (