]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c
Add doxygen style comments for functions in DxeIpl.
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / Ipf / ImageRead.c
1 /** @file
2 This module loads an image to memory for IPF Cpu architecture.
3
4 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "DxeIpl.h"
16
17
18
19 /**
20 Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file
21
22 @param FileHandle The handle to the PE/COFF file
23 @param FileOffset The offset, in bytes, into the file to read
24 @param ReadSize The number of bytes to read from the file starting at
25 FileOffset
26 @param Buffer A pointer to the buffer to read the data into.
27
28 @retval EFI_SUCCESS ReadSize bytes of data were read into Buffer from the
29 PE/COFF file starting at FileOffset
30
31 **/
32 EFI_STATUS
33 PeiImageRead (
34 IN VOID *FileHandle,
35 IN UINTN FileOffset,
36 IN OUT UINTN *ReadSize,
37 OUT VOID *Buffer
38 )
39 {
40 CHAR8 *Destination8;
41 CHAR8 *Source8;
42 volatile UINTN Length;
43
44 Destination8 = Buffer;
45 Source8 = (CHAR8 *) ((UINTN) FileHandle + FileOffset);
46 Length = *ReadSize;
47 CopyMem (Destination8, Source8, Length);
48
49 return EFI_SUCCESS;
50 }
51
52
53 /**
54 This function simply retrieves the function pointer of ImageRead in
55 ImageContext structure.
56
57 @param ImageContext A pointer to the structure of
58 PE_COFF_LOADER_IMAGE_CONTEXT
59
60 @retval EFI_SUCCESS This function always return EFI_SUCCESS.
61
62 **/
63 EFI_STATUS
64 GetImageReadFunction (
65 IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
66 )
67 {
68 ImageContext->ImageRead = PeiImageRead;
69 return EFI_SUCCESS;
70 }