]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Runtime Architectural Protocol as defined in the DXE CIS.\r | |
3 | \r | |
4 | This code is used to produce the EFI runtime architectural protocol.\r | |
5 | \r | |
6 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
7 | 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 | |
11 | \r | |
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 | |
14 | \r | |
15 | **/\r | |
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 | |
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/UefiRuntimeServicesTableLib.h>\r | |
28 | #include <Library/UefiBootServicesTableLib.h>\r | |
29 | #include <Library/UefiLib.h>\r | |
30 | #include <Library/CacheMaintenanceLib.h>\r | |
31 | #include <Library/PeCoffLib.h>\r | |
32 | \r | |
33 | \r | |
34 | //\r | |
35 | // Function Prototypes\r | |
36 | //\r | |
37 | /**\r | |
38 | Calculate CRC32 for target data.\r | |
39 | \r | |
40 | @param Data The target data.\r | |
41 | @param DataSize The target data size.\r | |
42 | @param CrcOut The CRC32 for target data.\r | |
43 | \r | |
44 | @retval EFI_SUCCESS The CRC32 for target data is calculated successfully.\r | |
45 | @retval EFI_INVALID_PARAMETER Some parameter is not valid, so the CRC32 is not\r | |
46 | calculated.\r | |
47 | \r | |
48 | **/\r | |
49 | EFI_STATUS\r | |
50 | EFIAPI\r | |
51 | RuntimeDriverCalculateCrc32 (\r | |
52 | IN VOID *Data,\r | |
53 | IN UINTN DataSize,\r | |
54 | OUT UINT32 *CrcOut\r | |
55 | );\r | |
56 | \r | |
57 | /**\r | |
58 | Determines the new virtual address that is to be used on subsequent memory accesses.\r | |
59 | \r | |
60 | \r | |
61 | @param DebugDisposition Supplies type information for the pointer being converted.\r | |
62 | @param ConvertAddress A pointer to a pointer that is to be fixed to be the value needed\r | |
63 | for the new virtual address mappings being applied.\r | |
64 | \r | |
65 | @retval EFI_SUCCESS The pointer pointed to by Address was modified.\r | |
66 | @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part\r | |
67 | of the current memory map. This is normally fatal.\r | |
68 | @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r | |
69 | \r | |
70 | **/\r | |
71 | EFI_STATUS\r | |
72 | EFIAPI\r | |
73 | RuntimeDriverConvertPointer (\r | |
74 | IN UINTN DebugDisposition,\r | |
75 | IN OUT VOID **ConvertAddress\r | |
76 | );\r | |
77 | \r | |
78 | /**\r | |
79 | Changes the runtime addressing mode of EFI firmware from physical to virtual.\r | |
80 | \r | |
81 | @param MemoryMapSize The size in bytes of VirtualMap.\r | |
82 | @param DescriptorSize The size in bytes of an entry in the VirtualMap.\r | |
83 | @param DescriptorVersion The version of the structure entries in VirtualMap.\r | |
84 | @param VirtualMap An array of memory descriptors which contain new virtual\r | |
85 | address mapping information for all runtime ranges.\r | |
86 | \r | |
87 | @retval EFI_SUCCESS The virtual address map has been applied.\r | |
88 | @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in\r | |
89 | virtual address mapped mode.\r | |
90 | @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.\r | |
91 | @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory\r | |
92 | map that requires a mapping.\r | |
93 | @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found\r | |
94 | in the memory map.\r | |
95 | \r | |
96 | **/\r | |
97 | EFI_STATUS\r | |
98 | EFIAPI\r | |
99 | RuntimeDriverSetVirtualAddressMap (\r | |
100 | IN UINTN MemoryMapSize,\r | |
101 | IN UINTN DescriptorSize,\r | |
102 | IN UINT32 DescriptorVersion,\r | |
103 | IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r | |
104 | );\r | |
105 | \r | |
106 | /**\r | |
107 | Initialize CRC32 table.\r | |
108 | \r | |
109 | **/\r | |
110 | VOID\r | |
111 | RuntimeDriverInitializeCrc32Table (\r | |
112 | VOID\r | |
113 | );\r | |
114 | \r | |
115 | /**\r | |
116 | Install Runtime AP. This code includes the EfiRuntimeLib, but it only\r | |
117 | functions at RT in physical mode.\r | |
118 | \r | |
119 | @param ImageHandle Image handle of this driver.\r | |
120 | @param SystemTable Pointer to the EFI System Table.\r | |
121 | \r | |
122 | @retval EFI_SUCEESS Runtime Driver Architectural Protocol Installed\r | |
123 | @return Other value if gBS->InstallMultipleProtocolInterfaces fails. Check\r | |
124 | gBS->InstallMultipleProtocolInterfaces for details.\r | |
125 | \r | |
126 | **/\r | |
127 | EFI_STATUS\r | |
128 | EFIAPI\r | |
129 | RuntimeDriverInitialize (\r | |
130 | IN EFI_HANDLE ImageHandle,\r | |
131 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
132 | );\r | |
133 | \r | |
134 | #endif\r |