]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/RuntimeDxe/Runtime.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Core / RuntimeDxe / Runtime.h
CommitLineData
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
cd5ebaa0 6Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
9d510e61 7SPDX-License-Identifier: BSD-2-Clause-Patent\r
f2abdc91 8\r
fb0b259e 9**/\r
f2abdc91 10\r
11#ifndef _RUNTIME_H_\r
12#define _RUNTIME_H_\r
13\r
17c62eb6 14#include <PiDxe.h>\r
f2abdc91 15#include <Protocol/LoadedImage.h>\r
16#include <Protocol/Runtime.h>\r
f2abdc91 17#include <Library/BaseLib.h>\r
18#include <Library/UefiDriverEntryPoint.h>\r
19#include <Library/DebugLib.h>\r
20#include <Library/ReportStatusCodeLib.h>\r
f2abdc91 21#include <Library/UefiRuntimeServicesTableLib.h>\r
22#include <Library/UefiBootServicesTableLib.h>\r
857c8410 23#include <Library/UefiLib.h>\r
f2abdc91 24#include <Library/CacheMaintenanceLib.h>\r
25#include <Library/PeCoffLib.h>\r
f2abdc91 26\r
27\r
28//\r
29// Function Prototypes\r
30//\r
9fc78752 31/**\r
9920ae74 32 Calculate CRC32 for target data.\r
9fc78752 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
f2abdc91 43EFI_STATUS\r
44EFIAPI\r
45RuntimeDriverCalculateCrc32 (\r
46 IN VOID *Data,\r
47 IN UINTN DataSize,\r
48 OUT UINT32 *CrcOut\r
ed66e1bc 49 );\r
f2abdc91 50\r
9fc78752 51/**\r
9fc78752 52 Determines the new virtual address that is to be used on subsequent memory accesses.\r
f2abdc91 53\r
f2abdc91 54\r
9fc78752 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
f2abdc91 58\r
9fc78752 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
f2abdc91 63\r
9fc78752 64**/\r
f2abdc91 65EFI_STATUS\r
66EFIAPI\r
67RuntimeDriverConvertPointer (\r
68 IN UINTN DebugDisposition,\r
69 IN OUT VOID **ConvertAddress\r
ed66e1bc 70 );\r
f2abdc91 71\r
9fc78752 72/**\r
9fc78752 73 Changes the runtime addressing mode of EFI firmware from physical to virtual.\r
f2abdc91 74\r
9920ae74 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
9fc78752 79 address mapping information for all runtime ranges.\r
f2abdc91 80\r
9fc78752 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
f2abdc91 89\r
9fc78752 90**/\r
f2abdc91 91EFI_STATUS\r
92EFIAPI\r
93RuntimeDriverSetVirtualAddressMap (\r
94 IN UINTN MemoryMapSize,\r
95 IN UINTN DescriptorSize,\r
96 IN UINT32 DescriptorVersion,\r
97 IN EFI_MEMORY_DESCRIPTOR *VirtualMap\r
ed66e1bc 98 );\r
f2abdc91 99\r
9fc78752 100/**\r
9fc78752 101 Install Runtime AP. This code includes the EfiRuntimeLib, but it only\r
102 functions at RT in physical mode.\r
f2abdc91 103\r
9920ae74 104 @param ImageHandle Image handle of this driver.\r
105 @param SystemTable Pointer to the EFI System Table.\r
f2abdc91 106\r
9920ae74 107 @retval EFI_SUCEESS Runtime Driver Architectural Protocol Installed\r
108 @return Other value if gBS->InstallMultipleProtocolInterfaces fails. Check\r
9fc78752 109 gBS->InstallMultipleProtocolInterfaces for details.\r
f2abdc91 110\r
9fc78752 111**/\r
f2abdc91 112EFI_STATUS\r
113EFIAPI\r
114RuntimeDriverInitialize (\r
115 IN EFI_HANDLE ImageHandle,\r
116 IN EFI_SYSTEM_TABLE *SystemTable\r
ed66e1bc 117 );\r
f2abdc91 118\r
119#endif\r