]>
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 | |
17c62eb6 | 20 | #include <PiDxe.h>\r |
f2abdc91 | 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 | |
f2abdc91 | 27 | #include <Library/UefiRuntimeServicesTableLib.h>\r |
28 | #include <Library/UefiBootServicesTableLib.h>\r | |
857c8410 | 29 | #include <Library/UefiLib.h>\r |
f2abdc91 | 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 | |
ed66e1bc | 56 | );\r |
f2abdc91 | 57 | \r |
9fc78752 | 58 | /**\r |
9fc78752 | 59 | Determines the new virtual address that is to be used on subsequent memory accesses.\r |
f2abdc91 | 60 | \r |
f2abdc91 | 61 | \r |
9fc78752 | 62 | @param DebugDisposition Supplies type information for the pointer being converted.\r |
63 | @param ConvertAddress A pointer to a pointer that is to be fixed to be the value needed\r | |
64 | for the new virtual address mappings being applied.\r | |
f2abdc91 | 65 | \r |
9fc78752 | 66 | @retval EFI_SUCCESS The pointer pointed to by Address was modified.\r |
67 | @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part\r | |
68 | of the current memory map. This is normally fatal.\r | |
69 | @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r | |
f2abdc91 | 70 | \r |
9fc78752 | 71 | **/\r |
f2abdc91 | 72 | EFI_STATUS\r |
73 | EFIAPI\r | |
74 | RuntimeDriverConvertPointer (\r | |
75 | IN UINTN DebugDisposition,\r | |
76 | IN OUT VOID **ConvertAddress\r | |
ed66e1bc | 77 | );\r |
f2abdc91 | 78 | \r |
9fc78752 | 79 | /**\r |
9fc78752 | 80 | Changes the runtime addressing mode of EFI firmware from physical to virtual.\r |
f2abdc91 | 81 | \r |
9920ae74 | 82 | @param MemoryMapSize The size in bytes of VirtualMap.\r |
83 | @param DescriptorSize The size in bytes of an entry in the VirtualMap.\r | |
84 | @param DescriptorVersion The version of the structure entries in VirtualMap.\r | |
85 | @param VirtualMap An array of memory descriptors which contain new virtual\r | |
9fc78752 | 86 | address mapping information for all runtime ranges.\r |
f2abdc91 | 87 | \r |
9fc78752 | 88 | @retval EFI_SUCCESS The virtual address map has been applied.\r |
89 | @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in\r | |
90 | virtual address mapped mode.\r | |
91 | @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.\r | |
92 | @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory\r | |
93 | map that requires a mapping.\r | |
94 | @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found\r | |
95 | in the memory map.\r | |
f2abdc91 | 96 | \r |
9fc78752 | 97 | **/\r |
f2abdc91 | 98 | EFI_STATUS\r |
99 | EFIAPI\r | |
100 | RuntimeDriverSetVirtualAddressMap (\r | |
101 | IN UINTN MemoryMapSize,\r | |
102 | IN UINTN DescriptorSize,\r | |
103 | IN UINT32 DescriptorVersion,\r | |
104 | IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r | |
ed66e1bc | 105 | );\r |
f2abdc91 | 106 | \r |
9fc78752 | 107 | /**\r |
9fc78752 | 108 | Initialize CRC32 table.\r |
f2abdc91 | 109 | \r |
9fc78752 | 110 | **/\r |
f2abdc91 | 111 | VOID\r |
112 | RuntimeDriverInitializeCrc32Table (\r | |
113 | VOID\r | |
ed66e1bc | 114 | );\r |
f2abdc91 | 115 | \r |
9fc78752 | 116 | /**\r |
9fc78752 | 117 | Install Runtime AP. This code includes the EfiRuntimeLib, but it only\r |
118 | functions at RT in physical mode.\r | |
f2abdc91 | 119 | \r |
9920ae74 | 120 | @param ImageHandle Image handle of this driver.\r |
121 | @param SystemTable Pointer to the EFI System Table.\r | |
f2abdc91 | 122 | \r |
9920ae74 | 123 | @retval EFI_SUCEESS Runtime Driver Architectural Protocol Installed\r |
124 | @return Other value if gBS->InstallMultipleProtocolInterfaces fails. Check\r | |
9fc78752 | 125 | gBS->InstallMultipleProtocolInterfaces for details.\r |
f2abdc91 | 126 | \r |
9fc78752 | 127 | **/\r |
f2abdc91 | 128 | EFI_STATUS\r |
129 | EFIAPI\r | |
130 | RuntimeDriverInitialize (\r | |
131 | IN EFI_HANDLE ImageHandle,\r | |
132 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
ed66e1bc | 133 | );\r |
f2abdc91 | 134 | \r |
135 | #endif\r |