• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2 
3   This library class defines a set of interfaces for how to process capsule image updates.
4 
5 Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10 
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 
14 **/
15 
16 #ifndef __CAPSULE_LIB_H__
17 #define __CAPSULE_LIB_H__
18 
19 /**
20   The firmware checks whether the capsule image is supported
21   by the CapsuleGuid in CapsuleHeader or if there is other specific information in
22   the capsule image.
23 
24   Caution: This function may receive untrusted input.
25 
26   @param  CapsuleHeader    Pointer to the UEFI capsule image to be checked.
27 
28   @retval EFI_SUCESS       Input capsule is supported by firmware.
29   @retval EFI_UNSUPPORTED  Input capsule is not supported by the firmware.
30 **/
31 EFI_STATUS
32 EFIAPI
33 SupportCapsuleImage (
34   IN EFI_CAPSULE_HEADER *CapsuleHeader
35   );
36 
37 /**
38   The firmware-specific implementation processes the capsule image
39   if it recognized the format of this capsule image.
40 
41   Caution: This function may receive untrusted input.
42 
43   @param  CapsuleHeader    Pointer to the UEFI capsule image to be processed.
44 
45   @retval EFI_SUCESS       Capsule Image processed successfully.
46   @retval EFI_UNSUPPORTED  Capsule image is not supported by the firmware.
47 **/
48 EFI_STATUS
49 EFIAPI
50 ProcessCapsuleImage (
51   IN EFI_CAPSULE_HEADER *CapsuleHeader
52   );
53 
54 /**
55 
56   This routine is called to process capsules.
57 
58   Caution: This function may receive untrusted input.
59 
60   The capsules reported in EFI_HOB_UEFI_CAPSULE are processed.
61   If there is no EFI_HOB_UEFI_CAPSULE, this routine does nothing.
62 
63   This routine should be called twice in BDS.
64   1) The first call must be before EndOfDxe. The system capsules is processed.
65      If device capsule FMP protocols are exposted at this time and device FMP
66      capsule has zero EmbeddedDriverCount, the device capsules are processed.
67      Each individual capsule result is recorded in capsule record variable.
68      System may reset in this function, if reset is required by capsule and
69      all capsules are processed.
70      If not all capsules are processed, reset will be defered to second call.
71 
72   2) The second call must be after EndOfDxe and after ConnectAll, so that all
73      device capsule FMP protocols are exposed.
74      The system capsules are skipped. If the device capsules are NOT processed
75      in first call, they are processed here.
76      Each individual capsule result is recorded in capsule record variable.
77      System may reset in this function, if reset is required by capsule
78      processed in first call and second call.
79 
80   @retval EFI_SUCCESS             There is no error when processing capsules.
81   @retval EFI_OUT_OF_RESOURCES    No enough resource to process capsules.
82 
83 **/
84 EFI_STATUS
85 EFIAPI
86 ProcessCapsules (
87   VOID
88   );
89 
90 #endif
91