hc
2024-03-25 edb30157bad0c0001c32b854271ace01d3b9a16a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/** @file
*
*  Copyright (c) 2014, ARM Ltd. All rights reserved.
*
*  SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/
 
#ifndef __BOOTMONFS_LOADER_H__
#define __BOOTMONFS_LOADER_H__
 
/**
  Check that loading the file is supported.
 
  Not all information is checked, only the properties that matters to us in
  our simplified loader.
 
  BootMonFS file properties is not in a file header but in the file-system
  metadata, so we need to pass a handle to the file to allow access to the
  information.
 
  @param[in] FileHandle  Handle of the file to check.
 
  @retval EFI_SUCCESS on success.
  @retval EFI_INVALID_PARAMETER if the header is invalid.
  @retval EFI_UNSUPPORTED if the file type/platform is not supported.
**/
EFI_STATUS
BootMonFsCheckFile (
  IN  CONST EFI_FILE_HANDLE  FileHandle
  );
 
/**
  Load a binary file from BootMonFS.
 
  @param[in]  FileHandle    Handle of the file to load.
 
  @param[in]  FileData      Address  of the file data in memory.
 
  @param[out] EntryPoint    Will be filled with the ELF entry point address.
 
  @param[out] ImageSize     Will be filled with the file size in memory. This
                            will effectively be equal to the sum of the load
                            region sizes.
 
  This function assumes the file is valid and supported as checked with
  BootMonFsCheckFile().
 
  @retval EFI_SUCCESS on success.
  @retval EFI_INVALID_PARAMETER if the file is invalid.
**/
EFI_STATUS
BootMonFsLoadFile (
  IN  CONST EFI_FILE_HANDLE   FileHandle,
  IN  CONST VOID             *FileData,
  OUT VOID                  **EntryPoint,
  OUT LIST_ENTRY             *LoadList
  );
 
#endif // __BOOTMONFS_LOADER_H__