]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/Runtime.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[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 - 2008, Intel Corporation. All rights reserved.<BR>\r
14 This program and the accompanying materials \r
15 are licensed and made available under the terms and conditions of the BSD License \r
16 which accompanies this distribution. The full text of the license may be found at \r
17 http://opensource.org/licenses/bsd-license.php \r
18\r
19 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
20 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
21\r
22**/\r
23\r
24#ifndef __ARCH_PROTOCOL_RUNTIME_H__\r
25#define __ARCH_PROTOCOL_RUNTIME_H__\r
26\r
27///\r
28/// Global ID for the Runtime Architectural Protocol\r
29///\r
30#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \\r
31 { 0xb7dfb4e1, 0x52f, 0x449f, {0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33 } }\r
32\r
33typedef struct _EFI_RUNTIME_ARCH_PROTOCOL EFI_RUNTIME_ARCH_PROTOCOL;\r
34\r
35///\r
36/// LIST_ENTRY from BaseType \r
37///\r
38typedef LIST_ENTRY EFI_LIST_ENTRY;\r
39\r
40typedef struct _EFI_RUNTIME_IMAGE_ENTRY EFI_RUNTIME_IMAGE_ENTRY;\r
41\r
42///\r
43/// EFI_RUNTIME_IMAGE_ENTRY\r
44///\r
45struct _EFI_RUNTIME_IMAGE_ENTRY {\r
46 ///\r
47 /// Start of image that has been loaded in memory. It is a pointer \r
48 /// to either the DOS header or PE header of the image.\r
49 ///\r
50 VOID *ImageBase;\r
51 ///\r
52 /// Size in bytes of the image represented by ImageBase.\r
53 ///\r
54 UINT64 ImageSize;\r
55 ///\r
56 /// Information about the fix-ups that were performed on ImageBase when it was\r
57 /// loaded into memory.\r
58 ///\r
59 VOID *RelocationData;\r
60 ///\r
61 /// The ImageHandle passed into ImageBase when it was loaded.\r
62 ///\r
63 EFI_HANDLE Handle;\r
64 ///\r
65 /// Entry for this node in the EFI_RUNTIME_ARCHITECTURE_PROTOCOL.ImageHead list.\r
66 ///\r
67 EFI_LIST_ENTRY Link;\r
68};\r
69\r
70typedef struct _EFI_RUNTIME_EVENT_ENTRY EFI_RUNTIME_EVENT_ENTRY;\r
71\r
72///\r
73/// EFI_RUNTIME_EVENT_ENTRY\r
74///\r
75struct _EFI_RUNTIME_EVENT_ENTRY {\r
76 ///\r
77 /// The same as Type passed into CreateEvent().\r
78 ///\r
79 UINT32 Type;\r
80 ///\r
81 /// The same as NotifyTpl passed into CreateEvent().\r
82 ///\r
83 EFI_TPL NotifyTpl;\r
84 ///\r
85 /// The same as NotifyFunction passed into CreateEvent().\r
86 ///\r
87 EFI_EVENT_NOTIFY NotifyFunction;\r
88 ///\r
89 /// The same as NotifyContext passed into CreateEvent().\r
90 ///\r
91 VOID *NotifyContext;\r
92 ///\r
93 /// The EFI_EVENT returned by CreateEvent(). Event must be in runtime memory.\r
94 ///\r
95 EFI_EVENT *Event;\r
96 ///\r
97 /// Entry for this node in the\r
98 /// EFI_RUNTIME_ARCHITECTURE_PROTOCOL.EventHead list.\r
99 ///\r
100 EFI_LIST_ENTRY Link;\r
101};\r
102\r
103///\r
104/// Allows the runtime functionality of the DXE Foundation to be contained in a \r
105/// separate driver. It also provides hooks for the DXE Foundation to export \r
106/// information that is needed at runtime. As such, this protocol allows the DXE \r
107/// Foundation to manage runtime drivers and events. This protocol also implies \r
108/// that the runtime services required to transition to virtual mode, \r
109/// SetVirtualAddressMap() and ConvertPointer(), have been registered into the \r
110/// EFI Runtime Table in the EFI System Partition. This protocol must be produced \r
111/// by a runtime DXE driver and may only be consumed by the DXE Foundation.\r
112///\r
113struct _EFI_RUNTIME_ARCH_PROTOCOL {\r
114 EFI_LIST_ENTRY ImageHead; ///< A list of type EFI_RUNTIME_IMAGE_ENTRY.\r
115 EFI_LIST_ENTRY EventHead; ///< A list of type EFI_RUNTIME_EVENT_ENTRY.\r
116 UINTN MemoryDescriptorSize; ///< Size of a memory descriptor that is returned by GetMemoryMap().\r
117 UINT32 MemoryDesciptorVersion; ///< Version of a memory descriptor that is returned by GetMemoryMap().\r
118 UINTN MemoryMapSize;///< Size of the memory map in bytes contained in MemoryMapPhysical and MemoryMapVirtual. \r
119 EFI_MEMORY_DESCRIPTOR *MemoryMapPhysical; ///< Pointer to a runtime buffer that contains a copy of \r
120 ///< the memory map returned via GetMemoryMap().\r
121 EFI_MEMORY_DESCRIPTOR *MemoryMapVirtual; ///< Pointer to MemoryMapPhysical that is updated to virtual mode after SetVirtualAddressMap().\r
122 BOOLEAN VirtualMode; ///< Boolean that is TRUE if SetVirtualAddressMap() has been called.\r
123 BOOLEAN AtRuntime; ///< Boolean that is TRUE if ExitBootServices () has been called.\r
124};\r
125\r
126extern EFI_GUID gEfiRuntimeArchProtocolGuid;\r
127\r
128#endif\r