]>
Commit | Line | Data |
---|---|---|
ced216f8 HL |
1 | /** @file\r |
2 | *\r | |
3 | * Copyright (c) 2014, ARM Ltd. All rights reserved.\r | |
4 | *\r | |
5 | * This program and the accompanying materials are licensed and made available\r | |
6 | * under the terms and conditions of the BSD License which accompanies this\r | |
7 | * 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, WITHOUT\r | |
11 | * WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | *\r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef __BOOTMONFS_LOADER_H__\r | |
16 | #define __BOOTMONFS_LOADER_H__\r | |
17 | \r | |
18 | /**\r | |
19 | Check that loading the file is supported.\r | |
20 | \r | |
21 | Not all information is checked, only the properties that matters to us in\r | |
22 | our simplified loader.\r | |
23 | \r | |
24 | BootMonFS file properties is not in a file header but in the file-system\r | |
25 | metadata, so we need to pass a handle to the file to allow access to the\r | |
26 | information.\r | |
27 | \r | |
28 | @param[in] FileHandle Handle of the file to check.\r | |
29 | \r | |
30 | @retval EFI_SUCCESS on success.\r | |
31 | @retval EFI_INVALID_PARAMETER if the header is invalid.\r | |
32 | @retval EFI_UNSUPPORTED if the file type/platform is not supported.\r | |
33 | **/\r | |
34 | EFI_STATUS\r | |
35 | BootMonFsCheckFile (\r | |
36 | IN CONST EFI_FILE_HANDLE FileHandle\r | |
37 | );\r | |
38 | \r | |
39 | /**\r | |
40 | Load a binary file from BootMonFS.\r | |
41 | \r | |
42 | @param[in] FileHandle Handle of the file to load.\r | |
43 | \r | |
44 | @param[in] FileData Address of the file data in memory.\r | |
45 | \r | |
46 | @param[out] EntryPoint Will be filled with the ELF entry point address.\r | |
47 | \r | |
48 | @param[out] ImageSize Will be filled with the file size in memory. This\r | |
49 | will effectively be equal to the sum of the load\r | |
50 | region sizes.\r | |
51 | \r | |
52 | This function assumes the file is valid and supported as checked with\r | |
53 | BootMonFsCheckFile().\r | |
54 | \r | |
55 | @retval EFI_SUCCESS on success.\r | |
56 | @retval EFI_INVALID_PARAMETER if the file is invalid.\r | |
57 | **/\r | |
58 | EFI_STATUS\r | |
59 | BootMonFsLoadFile (\r | |
60 | IN CONST EFI_FILE_HANDLE FileHandle,\r | |
61 | IN CONST VOID *FileData,\r | |
62 | OUT VOID **EntryPoint,\r | |
63 | OUT LIST_ENTRY *LoadList\r | |
64 | );\r | |
65 | \r | |
66 | #endif // __BOOTMONFS_LOADER_H__\r |