]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/Runtime.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / Runtime.h
... / ...
CommitLineData
1/** @file\r
2 Runtime Architectural Protocol as defined in PI Specification VOLUME 2 DXE\r
3\r
4 Allows the runtime functionality of the DXE Foundation to be contained\r
5 in a separate driver. It also provides hooks for the DXE Foundation to\r
6 export information that is needed at runtime. As such, this protocol allows\r
7 services to the DXE Foundation to manage runtime drivers and events.\r
8 This protocol also implies that the runtime services required to transition\r
9 to virtual mode, SetVirtualAddressMap() and ConvertPointer(), have been\r
10 registered into the UEFI Runtime Table in the UEFI System Table. This protocol\r
11 must be produced by a runtime DXE driver and may only be consumed by the DXE Foundation.\r
12\r
13 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
14 SPDX-License-Identifier: BSD-2-Clause-Patent\r
15\r
16**/\r
17\r
18#ifndef __ARCH_PROTOCOL_RUNTIME_H__\r
19#define __ARCH_PROTOCOL_RUNTIME_H__\r
20\r
21///\r
22/// Global ID for the Runtime Architectural Protocol\r
23///\r
24#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \\r
25 { 0xb7dfb4e1, 0x52f, 0x449f, {0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33 } }\r
26\r
27typedef struct _EFI_RUNTIME_ARCH_PROTOCOL EFI_RUNTIME_ARCH_PROTOCOL;\r
28\r
29///\r
30/// LIST_ENTRY from BaseType\r
31///\r
32typedef LIST_ENTRY EFI_LIST_ENTRY;\r
33\r
34typedef struct _EFI_RUNTIME_IMAGE_ENTRY EFI_RUNTIME_IMAGE_ENTRY;\r
35\r
36///\r
37/// EFI_RUNTIME_IMAGE_ENTRY\r
38///\r
39struct _EFI_RUNTIME_IMAGE_ENTRY {\r
40 ///\r
41 /// Start of image that has been loaded in memory. It is a pointer\r
42 /// to either the DOS header or PE header of the image.\r
43 ///\r
44 VOID *ImageBase;\r
45 ///\r
46 /// Size in bytes of the image represented by ImageBase.\r
47 ///\r
48 UINT64 ImageSize;\r
49 ///\r
50 /// Information about the fix-ups that were performed on ImageBase when it was\r
51 /// loaded into memory.\r
52 ///\r
53 VOID *RelocationData;\r
54 ///\r
55 /// The ImageHandle passed into ImageBase when it was loaded.\r
56 ///\r
57 EFI_HANDLE Handle;\r
58 ///\r
59 /// Entry for this node in the EFI_RUNTIME_ARCHITECTURE_PROTOCOL.ImageHead list.\r
60 ///\r
61 EFI_LIST_ENTRY Link;\r
62};\r
63\r
64typedef struct _EFI_RUNTIME_EVENT_ENTRY EFI_RUNTIME_EVENT_ENTRY;\r
65\r
66///\r
67/// EFI_RUNTIME_EVENT_ENTRY\r
68///\r
69struct _EFI_RUNTIME_EVENT_ENTRY {\r
70 ///\r
71 /// The same as Type passed into CreateEvent().\r
72 ///\r
73 UINT32 Type;\r
74 ///\r
75 /// The same as NotifyTpl passed into CreateEvent().\r
76 ///\r
77 EFI_TPL NotifyTpl;\r
78 ///\r
79 /// The same as NotifyFunction passed into CreateEvent().\r
80 ///\r
81 EFI_EVENT_NOTIFY NotifyFunction;\r
82 ///\r
83 /// The same as NotifyContext passed into CreateEvent().\r
84 ///\r
85 VOID *NotifyContext;\r
86 ///\r
87 /// The EFI_EVENT returned by CreateEvent(). Event must be in runtime memory.\r
88 ///\r
89 EFI_EVENT *Event;\r
90 ///\r
91 /// Entry for this node in the\r
92 /// EFI_RUNTIME_ARCHITECTURE_PROTOCOL.EventHead list.\r
93 ///\r
94 EFI_LIST_ENTRY Link;\r
95};\r
96\r
97///\r
98/// Allows the runtime functionality of the DXE Foundation to be contained in a\r
99/// separate driver. It also provides hooks for the DXE Foundation to export\r
100/// information that is needed at runtime. As such, this protocol allows the DXE\r
101/// Foundation to manage runtime drivers and events. This protocol also implies\r
102/// that the runtime services required to transition to virtual mode,\r
103/// SetVirtualAddressMap() and ConvertPointer(), have been registered into the\r
104/// EFI Runtime Table in the EFI System Partition. This protocol must be produced\r
105/// by a runtime DXE driver and may only be consumed by the DXE Foundation.\r
106///\r
107struct _EFI_RUNTIME_ARCH_PROTOCOL {\r
108 EFI_LIST_ENTRY ImageHead; ///< A list of type EFI_RUNTIME_IMAGE_ENTRY.\r
109 EFI_LIST_ENTRY EventHead; ///< A list of type EFI_RUNTIME_EVENT_ENTRY.\r
110 UINTN MemoryDescriptorSize; ///< Size of a memory descriptor that is returned by GetMemoryMap().\r
111 UINT32 MemoryDesciptorVersion; ///< Version of a memory descriptor that is returned by GetMemoryMap().\r
112 UINTN MemoryMapSize;///< Size of the memory map in bytes contained in MemoryMapPhysical and MemoryMapVirtual.\r
113 EFI_MEMORY_DESCRIPTOR *MemoryMapPhysical; ///< Pointer to a runtime buffer that contains a copy of\r
114 ///< the memory map returned via GetMemoryMap().\r
115 EFI_MEMORY_DESCRIPTOR *MemoryMapVirtual; ///< Pointer to MemoryMapPhysical that is updated to virtual mode after SetVirtualAddressMap().\r
116 BOOLEAN VirtualMode; ///< Boolean that is TRUE if SetVirtualAddressMap() has been called.\r
117 BOOLEAN AtRuntime; ///< Boolean that is TRUE if ExitBootServices () has been called.\r
118};\r
119\r
120extern EFI_GUID gEfiRuntimeArchProtocolGuid;\r
121\r
122#endif\r