]>
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 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
8 | \r | |
9 | **/\r | |
10 | \r | |
11 | #ifndef _RUNTIME_H_\r | |
12 | #define _RUNTIME_H_\r | |
13 | \r | |
14 | #include <PiDxe.h>\r | |
15 | #include <Protocol/LoadedImage.h>\r | |
16 | #include <Protocol/Runtime.h>\r | |
17 | #include <Library/BaseLib.h>\r | |
18 | #include <Library/UefiDriverEntryPoint.h>\r | |
19 | #include <Library/DebugLib.h>\r | |
20 | #include <Library/ReportStatusCodeLib.h>\r | |
21 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
22 | #include <Library/UefiBootServicesTableLib.h>\r | |
23 | #include <Library/UefiLib.h>\r | |
24 | #include <Library/CacheMaintenanceLib.h>\r | |
25 | #include <Library/PeCoffLib.h>\r | |
26 | \r | |
27 | //\r | |
28 | // Function Prototypes\r | |
29 | //\r | |
30 | \r | |
31 | /**\r | |
32 | Calculate CRC32 for target data.\r | |
33 | \r | |
34 | @param Data The target data.\r | |
35 | @param DataSize The target data size.\r | |
36 | @param CrcOut The CRC32 for target data.\r | |
37 | \r | |
38 | @retval EFI_SUCCESS The CRC32 for target data is calculated successfully.\r | |
39 | @retval EFI_INVALID_PARAMETER Some parameter is not valid, so the CRC32 is not\r | |
40 | calculated.\r | |
41 | \r | |
42 | **/\r | |
43 | EFI_STATUS\r | |
44 | EFIAPI\r | |
45 | RuntimeDriverCalculateCrc32 (\r | |
46 | IN VOID *Data,\r | |
47 | IN UINTN DataSize,\r | |
48 | OUT UINT32 *CrcOut\r | |
49 | );\r | |
50 | \r | |
51 | /**\r | |
52 | Determines the new virtual address that is to be used on subsequent memory accesses.\r | |
53 | \r | |
54 | \r | |
55 | @param DebugDisposition Supplies type information for the pointer being converted.\r | |
56 | @param ConvertAddress A pointer to a pointer that is to be fixed to be the value needed\r | |
57 | for the new virtual address mappings being applied.\r | |
58 | \r | |
59 | @retval EFI_SUCCESS The pointer pointed to by Address was modified.\r | |
60 | @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part\r | |
61 | of the current memory map. This is normally fatal.\r | |
62 | @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r | |
63 | \r | |
64 | **/\r | |
65 | EFI_STATUS\r | |
66 | EFIAPI\r | |
67 | RuntimeDriverConvertPointer (\r | |
68 | IN UINTN DebugDisposition,\r | |
69 | IN OUT VOID **ConvertAddress\r | |
70 | );\r | |
71 | \r | |
72 | /**\r | |
73 | Changes the runtime addressing mode of EFI firmware from physical to virtual.\r | |
74 | \r | |
75 | @param MemoryMapSize The size in bytes of VirtualMap.\r | |
76 | @param DescriptorSize The size in bytes of an entry in the VirtualMap.\r | |
77 | @param DescriptorVersion The version of the structure entries in VirtualMap.\r | |
78 | @param VirtualMap An array of memory descriptors which contain new virtual\r | |
79 | address mapping information for all runtime ranges.\r | |
80 | \r | |
81 | @retval EFI_SUCCESS The virtual address map has been applied.\r | |
82 | @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in\r | |
83 | virtual address mapped mode.\r | |
84 | @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.\r | |
85 | @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory\r | |
86 | map that requires a mapping.\r | |
87 | @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found\r | |
88 | in the memory map.\r | |
89 | \r | |
90 | **/\r | |
91 | EFI_STATUS\r | |
92 | EFIAPI\r | |
93 | RuntimeDriverSetVirtualAddressMap (\r | |
94 | IN UINTN MemoryMapSize,\r | |
95 | IN UINTN DescriptorSize,\r | |
96 | IN UINT32 DescriptorVersion,\r | |
97 | IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r | |
98 | );\r | |
99 | \r | |
100 | /**\r | |
101 | Install Runtime AP. This code includes the EfiRuntimeLib, but it only\r | |
102 | functions at RT in physical mode.\r | |
103 | \r | |
104 | @param ImageHandle Image handle of this driver.\r | |
105 | @param SystemTable Pointer to the EFI System Table.\r | |
106 | \r | |
107 | @retval EFI_SUCEESS Runtime Driver Architectural Protocol Installed\r | |
108 | @return Other value if gBS->InstallMultipleProtocolInterfaces fails. Check\r | |
109 | gBS->InstallMultipleProtocolInterfaces for details.\r | |
110 | \r | |
111 | **/\r | |
112 | EFI_STATUS\r | |
113 | EFIAPI\r | |
114 | RuntimeDriverInitialize (\r | |
115 | IN EFI_HANDLE ImageHandle,\r | |
116 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
117 | );\r | |
118 | \r | |
119 | #endif\r |