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