]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/RuntimeDxe/Runtime.h
f41b375506d31bc2c7d73fa9796e692804f95add
[mirror_edk2.git] / MdeModulePkg / Core / RuntimeDxe / Runtime.h
1 /** @file
2 Runtime Architectural Protocol as defined in the DXE CIS.
3
4 This code is used to produce the EFI runtime architectural protocol.
5
6 Copyright (c) 2006, Intel Corporation. <BR>
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef _RUNTIME_H_
18 #define _RUNTIME_H_
19
20 #include <Uefi.h>
21 #include <Protocol/LoadedImage.h>
22 #include <Protocol/Runtime.h>
23 #include <Library/BaseLib.h>
24 #include <Library/UefiDriverEntryPoint.h>
25 #include <Library/DebugLib.h>
26 #include <Library/ReportStatusCodeLib.h>
27 #include <Library/BaseMemoryLib.h>
28 #include <Library/UefiRuntimeServicesTableLib.h>
29 #include <Library/UefiBootServicesTableLib.h>
30 #include <Library/CacheMaintenanceLib.h>
31 #include <Library/PeCoffLib.h>
32 #include <Library/PcdLib.h>
33
34
35 //
36 // Function Prototypes
37 //
38 /**
39 Calculate CRC32 for target data.
40
41 @param Data The target data.
42 @param DataSize The target data size.
43 @param CrcOut The CRC32 for target data.
44
45 @retval EFI_SUCCESS The CRC32 for target data is calculated successfully.
46 @retval EFI_INVALID_PARAMETER Some parameter is not valid, so the CRC32 is not
47 calculated.
48
49 **/
50 EFI_STATUS
51 EFIAPI
52 RuntimeDriverCalculateCrc32 (
53 IN VOID *Data,
54 IN UINTN DataSize,
55 OUT UINT32 *CrcOut
56 )
57 ;
58
59 /**
60 Determines the new virtual address that is to be used on subsequent memory accesses.
61
62
63 @param DebugDisposition Supplies type information for the pointer being converted.
64 @param ConvertAddress A pointer to a pointer that is to be fixed to be the value needed
65 for the new virtual address mappings being applied.
66
67 @retval EFI_SUCCESS The pointer pointed to by Address was modified.
68 @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part
69 of the current memory map. This is normally fatal.
70 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
71
72 **/
73 EFI_STATUS
74 EFIAPI
75 RuntimeDriverConvertPointer (
76 IN UINTN DebugDisposition,
77 IN OUT VOID **ConvertAddress
78 )
79 ;
80
81 /**
82 Changes the runtime addressing mode of EFI firmware from physical to virtual.
83
84 @param MemoryMapSize The size in bytes of VirtualMap.
85 @param DescriptorSize The size in bytes of an entry in the VirtualMap.
86 @param DescriptorVersion The version of the structure entries in VirtualMap.
87 @param VirtualMap An array of memory descriptors which contain new virtual
88 address mapping information for all runtime ranges.
89
90 @retval EFI_SUCCESS The virtual address map has been applied.
91 @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
92 virtual address mapped mode.
93 @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.
94 @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
95 map that requires a mapping.
96 @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
97 in the memory map.
98
99 **/
100 EFI_STATUS
101 EFIAPI
102 RuntimeDriverSetVirtualAddressMap (
103 IN UINTN MemoryMapSize,
104 IN UINTN DescriptorSize,
105 IN UINT32 DescriptorVersion,
106 IN EFI_MEMORY_DESCRIPTOR *VirtualMap
107 )
108 ;
109
110 /**
111 Initialize CRC32 table.
112
113 **/
114 VOID
115 RuntimeDriverInitializeCrc32Table (
116 VOID
117 )
118 ;
119
120 /**
121 Install Runtime AP. This code includes the EfiRuntimeLib, but it only
122 functions at RT in physical mode.
123
124 @param ImageHandle Image handle of this driver.
125 @param SystemTable Pointer to the EFI System Table.
126
127 @retval EFI_SUCEESS Runtime Driver Architectural Protocol Installed
128 @return Other value if gBS->InstallMultipleProtocolInterfaces fails. Check
129 gBS->InstallMultipleProtocolInterfaces for details.
130
131 **/
132 EFI_STATUS
133 EFIAPI
134 RuntimeDriverInitialize (
135 IN EFI_HANDLE ImageHandle,
136 IN EFI_SYSTEM_TABLE *SystemTable
137 )
138 ;
139
140 #endif