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