VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLibInternal.h@ 107675

最後變更 在這個檔案從107675是 99404,由 vboxsync 提交於 2 年 前

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 2.2 KB
 
1/** @file
2 ELF library
3
4 Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#ifndef EFI_LIB_INTERNAL_H_
10#define EFI_LIB_INTERNAL_H_
11
12#include <Library/BaseLib.h>
13#include <Library/DebugLib.h>
14#include <Library/BaseMemoryLib.h>
15#include "ElfLib.h"
16#include "ElfCommon.h"
17#include "Elf32.h"
18#include "Elf64.h"
19
20#define ELF_NEXT_ENTRY(EntryType, Current, EntrySize) \
21 ((EntryType *) ((UINT8 *)Current + EntrySize))
22
23/**
24 Return the section header specified by Index.
25
26 @param ImageBase The image base.
27 @param Index The section index.
28
29 @return Pointer to the section header.
30**/
31Elf32_Shdr *
32GetElf32SectionByIndex (
33 IN UINT8 *ImageBase,
34 IN UINT32 Index
35 );
36
37/**
38 Return the section header specified by Index.
39
40 @param ImageBase The image base.
41 @param Index The section index.
42
43 @return Pointer to the section header.
44**/
45Elf64_Shdr *
46GetElf64SectionByIndex (
47 IN UINT8 *ImageBase,
48 IN UINT32 Index
49 );
50
51/**
52 Return the segment header specified by Index.
53
54 @param ImageBase The image base.
55 @param Index The segment index.
56
57 @return Pointer to the segment header.
58**/
59Elf32_Phdr *
60GetElf32SegmentByIndex (
61 IN UINT8 *ImageBase,
62 IN UINT32 Index
63 );
64
65/**
66 Return the segment header specified by Index.
67
68 @param ImageBase The image base.
69 @param Index The segment index.
70
71 @return Pointer to the segment header.
72**/
73Elf64_Phdr *
74GetElf64SegmentByIndex (
75 IN UINT8 *ImageBase,
76 IN UINT32 Index
77 );
78
79/**
80 Load ELF image which has 32-bit architecture
81
82 @param[in] ElfCt ELF image context pointer.
83
84 @retval EFI_SUCCESS ELF binary is loaded successfully.
85 @retval Others Loading ELF binary fails.
86
87**/
88EFI_STATUS
89LoadElf32Image (
90 IN ELF_IMAGE_CONTEXT *ElfCt
91 );
92
93/**
94 Load ELF image which has 64-bit architecture
95
96 @param[in] ImageBase Memory address of an image.
97 @param[out] EntryPoint The entry point of loaded ELF image.
98
99 @retval EFI_SUCCESS ELF binary is loaded successfully.
100 @retval Others Loading ELF binary fails.
101
102**/
103EFI_STATUS
104LoadElf64Image (
105 IN ELF_IMAGE_CONTEXT *ElfCt
106 );
107
108#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette