]>
Commit | Line | Data |
---|---|---|
0c18794e | 1 | /** @file\r |
2 | The internal header file includes the common header files, defines\r | |
3 | internal structure and functions used by DeferImageLoadLib.\r | |
4 | \r | |
5ec61d41 | 5 | Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r |
0c18794e | 6 | This program and the accompanying materials \r |
7 | are licensed and made available under the terms and conditions of the BSD License \r | |
8 | which accompanies this distribution. The full text of the license may be found at \r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __DEFER_IMAGE_LOAD_LIB_H__\r | |
17 | #define __DEFER_IMAGE_LOAD_LIB_H__\r | |
18 | \r | |
19 | #include <PiDxe.h>\r | |
20 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
21 | #include <Library/UefiBootServicesTableLib.h>\r | |
22 | #include <Library/SecurityManagementLib.h>\r | |
23 | #include <Library/MemoryAllocationLib.h>\r | |
24 | #include <Library/DevicePathLib.h>\r | |
25 | #include <Library/BaseMemoryLib.h>\r | |
26 | #include <Library/PrintLib.h>\r | |
27 | #include <Library/DebugLib.h>\r | |
28 | #include <Library/UefiLib.h>\r | |
29 | #include <Library/PcdLib.h>\r | |
30 | \r | |
31 | #include <Protocol/FirmwareVolume2.h>\r | |
32 | #include <Protocol/BlockIo.h>\r | |
33 | #include <Protocol/SimpleFileSystem.h>\r | |
34 | #include <Protocol/DeferredImageLoad.h>\r | |
35 | #include <Protocol/UserCredential.h>\r | |
36 | #include <Protocol/UserManager.h>\r | |
0c18794e | 37 | \r |
38 | #include <Guid/GlobalVariable.h>\r | |
39 | \r | |
40 | //\r | |
41 | // Image type definitions.\r | |
42 | //\r | |
43 | #define IMAGE_UNKNOWN 0x00000001\r | |
44 | #define IMAGE_FROM_FV 0x00000002\r | |
45 | #define IMAGE_FROM_OPTION_ROM 0x00000004\r | |
46 | #define IMAGE_FROM_REMOVABLE_MEDIA 0x00000008\r | |
47 | #define IMAGE_FROM_FIXED_MEDIA 0x00000010\r | |
48 | \r | |
49 | //\r | |
50 | // The struct to save the deferred image information.\r | |
51 | //\r | |
52 | typedef struct {\r | |
53 | EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;\r | |
54 | VOID *Image;\r | |
55 | UINTN ImageSize;\r | |
56 | BOOLEAN BootOption;\r | |
57 | } DEFERRED_IMAGE_INFO;\r | |
58 | \r | |
59 | //\r | |
60 | // The table to save the deferred image item.\r | |
61 | //\r | |
62 | typedef struct {\r | |
63 | UINTN Count; ///< deferred image count\r | |
64 | DEFERRED_IMAGE_INFO *ImageInfo; ///< deferred image item\r | |
65 | } DEFERRED_IMAGE_TABLE;\r | |
66 | \r | |
67 | /**\r | |
68 | Returns information about a deferred image.\r | |
69 | \r | |
70 | This function returns information about a single deferred image. The deferred images are \r | |
71 | numbered consecutively, starting with 0. If there is no image which corresponds to \r | |
72 | ImageIndex, then EFI_NOT_FOUND is returned. All deferred images may be returned by \r | |
73 | iteratively calling this function until EFI_NOT_FOUND is returned.\r | |
74 | Image may be NULL and ImageSize set to 0 if the decision to defer execution was made \r | |
75 | because of the location of the executable image, rather than its actual contents. \r | |
76 | \r | |
77 | @param[in] This Points to this instance of the EFI_DEFERRED_IMAGE_LOAD_PROTOCOL.\r | |
78 | @param[in] ImageIndex Zero-based index of the deferred index.\r | |
79 | @param[out] ImageDevicePath On return, points to a pointer to the device path of the image. \r | |
80 | The device path should not be freed by the caller. \r | |
81 | @param[out] Image On return, points to the first byte of the image or NULL if the \r | |
82 | image is not available. The image should not be freed by the caller\r | |
83 | unless LoadImage() has been called successfully. \r | |
84 | @param[out] ImageSize On return, the size of the image, or 0 if the image is not available.\r | |
85 | @param[out] BootOption On return, points to TRUE if the image was intended as a boot option \r | |
86 | or FALSE if it was not intended as a boot option. \r | |
87 | \r | |
88 | @retval EFI_SUCCESS Image information returned successfully.\r | |
89 | @retval EFI_NOT_FOUND ImageIndex does not refer to a valid image.\r | |
90 | @retval EFI_INVALID_PARAMETER ImageDevicePath is NULL or Image is NULL or ImageSize is NULL or \r | |
91 | BootOption is NULL.\r | |
92 | \r | |
93 | **/\r | |
94 | EFI_STATUS\r | |
95 | EFIAPI\r | |
96 | GetDefferedImageInfo (\r | |
97 | IN EFI_DEFERRED_IMAGE_LOAD_PROTOCOL *This,\r | |
98 | IN UINTN ImageIndex,\r | |
99 | OUT EFI_DEVICE_PATH_PROTOCOL **ImageDevicePath,\r | |
100 | OUT VOID **Image,\r | |
101 | OUT UINTN *ImageSize,\r | |
102 | OUT BOOLEAN *BootOption\r | |
103 | );\r | |
104 | \r | |
105 | #endif\r |