]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Implement defer image load services for user identification in UEFI2.2.\r | |
3 | \r | |
4 | Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _DEFER_3RD_PARTY_IMAGE_LOAD_H_\r | |
16 | #define _DEFER_3RD_PARTY_IMAGE_LOAD_H_\r | |
17 | \r | |
18 | #include <PiDxe.h>\r | |
19 | #include <Guid/EventGroup.h>\r | |
20 | #include <Protocol/DeferredImageLoad.h>\r | |
21 | #include <Protocol/FirmwareVolume2.h>\r | |
22 | #include <Protocol/DxeSmmReadyToLock.h>\r | |
23 | \r | |
24 | #include <Library/UefiBootServicesTableLib.h>\r | |
25 | #include <Library/BaseMemoryLib.h>\r | |
26 | #include <Library/MemoryAllocationLib.h>\r | |
27 | #include <Library/DevicePathLib.h>\r | |
28 | #include <Library/DebugLib.h>\r | |
29 | #include <Library/UefiLib.h>\r | |
30 | #include <Library/ReportStatusCodeLib.h>\r | |
31 | \r | |
32 | /**\r | |
33 | Returns information about a deferred image.\r | |
34 | \r | |
35 | This function returns information about a single deferred image. The deferred images are\r | |
36 | numbered consecutively, starting with 0. If there is no image which corresponds to\r | |
37 | ImageIndex, then EFI_NOT_FOUND is returned. All deferred images may be returned by\r | |
38 | iteratively calling this function until EFI_NOT_FOUND is returned.\r | |
39 | Image may be NULL and ImageSize set to 0 if the decision to defer execution was made\r | |
40 | because of the location of the executable image, rather than its actual contents.\r | |
41 | \r | |
42 | @param[in] This Points to this instance of the EFI_DEFERRED_IMAGE_LOAD_PROTOCOL.\r | |
43 | @param[in] ImageIndex Zero-based index of the deferred index.\r | |
44 | @param[out] ImageDevicePath On return, points to a pointer to the device path of the image.\r | |
45 | The device path should not be freed by the caller.\r | |
46 | @param[out] Image On return, points to the first byte of the image or NULL if the\r | |
47 | image is not available. The image should not be freed by the caller\r | |
48 | unless LoadImage() has been successfully called.\r | |
49 | @param[out] ImageSize On return, the size of the image, or 0 if the image is not available.\r | |
50 | @param[out] BootOption On return, points to TRUE if the image was intended as a boot option\r | |
51 | or FALSE if it was not intended as a boot option.\r | |
52 | \r | |
53 | @retval EFI_SUCCESS Image information returned successfully.\r | |
54 | @retval EFI_NOT_FOUND ImageIndex does not refer to a valid image.\r | |
55 | @retval EFI_INVALID_PARAMETER ImageDevicePath is NULL or Image is NULL or ImageSize is NULL or\r | |
56 | BootOption is NULL.\r | |
57 | \r | |
58 | **/\r | |
59 | EFI_STATUS\r | |
60 | EFIAPI\r | |
61 | GetDefferedImageInfo (\r | |
62 | IN EFI_DEFERRED_IMAGE_LOAD_PROTOCOL *This,\r | |
63 | IN UINTN ImageIndex,\r | |
64 | OUT EFI_DEVICE_PATH_PROTOCOL **ImageDevicePath,\r | |
65 | OUT VOID **Image,\r | |
66 | OUT UINTN *ImageSize,\r | |
67 | OUT BOOLEAN *BootOption\r | |
68 | );\r | |
69 | \r | |
70 | /**\r | |
71 | Defer the 3rd party image load and installs Deferred Image Load Protocol.\r | |
72 | \r | |
73 | @param[in] File This is a pointer to the device path of the file that\r | |
74 | is being dispatched. This will optionally be used for\r | |
75 | logging.\r | |
76 | @param[in] BootPolicy A boot policy that was used to call LoadImage() UEFI service.\r | |
77 | \r | |
78 | @retval EFI_SUCCESS The file is not 3rd party image and can be loaded immediately.\r | |
79 | @retval EFI_ACCESS_DENIED The file is 3rd party image and needs deferred.\r | |
80 | **/\r | |
81 | EFI_STATUS\r | |
82 | Defer3rdPartyImageLoad (\r | |
83 | IN CONST EFI_DEVICE_PATH_PROTOCOL *File,\r | |
84 | IN BOOLEAN BootPolicy\r | |
85 | );\r | |
86 | \r | |
87 | /**\r | |
88 | Installs DeferredImageLoad Protocol and listens EndOfDxe event.\r | |
89 | **/\r | |
90 | VOID\r | |
91 | Defer3rdPartyImageLoadInitialize (\r | |
92 | VOID\r | |
93 | );\r | |
94 | \r | |
95 | #endif\r |