]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/CapsuleLib.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Library / CapsuleLib.h
1 /** @file
2
3 This library class defines a set of interfaces for how to process capsule image updates.
4
5 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef __CAPSULE_LIB_H__
11 #define __CAPSULE_LIB_H__
12
13 /**
14 The firmware checks whether the capsule image is supported
15 by the CapsuleGuid in CapsuleHeader or if there is other specific information in
16 the capsule image.
17
18 Caution: This function may receive untrusted input.
19
20 @param CapsuleHeader Pointer to the UEFI capsule image to be checked.
21
22 @retval EFI_SUCESS Input capsule is supported by firmware.
23 @retval EFI_UNSUPPORTED Input capsule is not supported by the firmware.
24 **/
25 EFI_STATUS
26 EFIAPI
27 SupportCapsuleImage (
28 IN EFI_CAPSULE_HEADER *CapsuleHeader
29 );
30
31 /**
32 The firmware-specific implementation processes the capsule image
33 if it recognized the format of this capsule image.
34
35 Caution: This function may receive untrusted input.
36
37 @param CapsuleHeader Pointer to the UEFI capsule image to be processed.
38
39 @retval EFI_SUCESS Capsule Image processed successfully.
40 @retval EFI_UNSUPPORTED Capsule image is not supported by the firmware.
41 **/
42 EFI_STATUS
43 EFIAPI
44 ProcessCapsuleImage (
45 IN EFI_CAPSULE_HEADER *CapsuleHeader
46 );
47
48 /**
49
50 This routine is called to process capsules.
51
52 Caution: This function may receive untrusted input.
53
54 The capsules reported in EFI_HOB_UEFI_CAPSULE are processed.
55 If there is no EFI_HOB_UEFI_CAPSULE, this routine does nothing.
56
57 This routine should be called twice in BDS.
58 1) The first call must be before EndOfDxe. The system capsules is processed.
59 If device capsule FMP protocols are exposted at this time and device FMP
60 capsule has zero EmbeddedDriverCount, the device capsules are processed.
61 Each individual capsule result is recorded in capsule record variable.
62 System may reset in this function, if reset is required by capsule and
63 all capsules are processed.
64 If not all capsules are processed, reset will be defered to second call.
65
66 2) The second call must be after EndOfDxe and after ConnectAll, so that all
67 device capsule FMP protocols are exposed.
68 The system capsules are skipped. If the device capsules are NOT processed
69 in first call, they are processed here.
70 Each individual capsule result is recorded in capsule record variable.
71 System may reset in this function, if reset is required by capsule
72 processed in first call and second call.
73
74 @retval EFI_SUCCESS There is no error when processing capsules.
75 @retval EFI_OUT_OF_RESOURCES No enough resource to process capsules.
76
77 **/
78 EFI_STATUS
79 EFIAPI
80 ProcessCapsules (
81 VOID
82 );
83
84 #endif