]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Universal/Runtime/RuntimeDxe/PeHotRelocate.c
Removed cross references from PciCf8Lib and PciExpressLib class to PciLib class.
[mirror_edk2.git] / EdkModulePkg / Universal / Runtime / RuntimeDxe / PeHotRelocate.c
CommitLineData
878ddf1f 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 PeHotRelocate.c\r
15\r
16Abstract:\r
17\r
18\r
19--*/\r
20\r
21#include "Runtime.h"\r
22\r
23STATIC\r
24VOID *\r
25RuntimePeImageAddress (\r
26 IN RUNTIME_IMAGE_RELOCATION_DATA *Image,\r
27 IN UINTN Address\r
28 )\r
29/*++\r
30\r
31Routine Description:\r
32\r
33 Converts an image address to the loaded address\r
34\r
35Arguments:\r
36\r
37 Image - The relocation data of the image being loaded\r
38\r
39 Address - The address to be converted to the loaded address\r
40\r
41Returns:\r
42\r
43 NULL if the address can not be converted, otherwise, the converted address\r
44\r
45--*/\r
46{\r
47 if (Address >= (Image->ImageSize) << EFI_PAGE_SHIFT) {\r
48 return NULL;\r
49 }\r
50\r
51 return (CHAR8 *) ((UINTN) Image->ImageBase + Address);\r
52}\r
53\r