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