]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Runtime.h
Formalize comments for Protocols and PPIs.
[mirror_edk2.git] / MdePkg / Include / Protocol / Runtime.h
1 /** @file
2 Runtime Architectural Protocol as defined in PI Specification VOLUME 2 DXE
3
4 This code is used to produce the UEFI 2.0 runtime virtual switch over
5
6 This driver must add SetVirtualAddressMap () and ConvertPointer () to
7 the EFI system table. This driver is not responcible for CRCing the
8 EFI system table.
9
10 This driver will add EFI_RUNTIME_ARCH_PROTOCOL_GUID protocol with a
11 pointer to the Runtime Arch Protocol instance structure. The protocol
12 member functions are used by the DXE core to export information need
13 by this driver to produce the runtime transition to virtual mode
14 calling.
15
16 Copyright (c) 2006 - 2008, Intel Corporation
17 All rights reserved. This program and the accompanying materials
18 are licensed and made available under the terms and conditions of the BSD License
19 which accompanies this distribution. The full text of the license may be found at
20 http://opensource.org/licenses/bsd-license.php
21
22 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
23 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
24
25 **/
26
27 #ifndef __ARCH_PROTOCOL_RUNTIME_H__
28 #define __ARCH_PROTOCOL_RUNTIME_H__
29
30 ///
31 /// Global ID for the Runtime Architectural Protocol
32 ///
33 #define EFI_RUNTIME_ARCH_PROTOCOL_GUID \
34 { 0xb7dfb4e1, 0x52f, 0x449f, {0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33 } }
35
36 typedef struct _EFI_RUNTIME_ARCH_PROTOCOL EFI_RUNTIME_ARCH_PROTOCOL;
37
38 ///
39 /// LIST_ENTRY from BaseType
40 ///
41 typedef LIST_ENTRY EFI_LIST_ENTRY;
42
43 typedef struct _EFI_RUNTIME_IMAGE_ENTRY EFI_RUNTIME_IMAGE_ENTRY;
44
45 struct _EFI_RUNTIME_IMAGE_ENTRY {
46 VOID *ImageBase;
47 UINT64 ImageSize;
48 VOID *RelocationData;
49 EFI_HANDLE Handle;
50 EFI_LIST_ENTRY Link;
51 };
52
53 typedef struct _EFI_RUNTIME_EVENT_ENTRY EFI_RUNTIME_EVENT_ENTRY;
54
55 struct _EFI_RUNTIME_EVENT_ENTRY {
56 UINT32 Type;
57 EFI_TPL NotifyTpl;
58 EFI_EVENT_NOTIFY NotifyFunction;
59 VOID *NotifyContext;
60 EFI_EVENT *Event;
61 EFI_LIST_ENTRY Link;
62 };
63
64 ///
65 /// Allows the runtime functionality of the DXE Foundation to be contained in a
66 /// separate driver. It also provides hooks for the DXE Foundation to export
67 /// information that is needed at runtime. As such, this protocol allows the DXE
68 /// Foundation to manage runtime drivers and events. This protocol also implies
69 /// that the runtime services required to transition to virtual mode,
70 /// SetVirtualAddressMap() and ConvertPointer(), have been registered into the
71 /// EFI Runtime Table in the EFI System Partition. This protocol must be produced
72 /// by a runtime DXE driver and may only be consumed by the DXE Foundation.
73 ///
74 struct _EFI_RUNTIME_ARCH_PROTOCOL {
75 ///
76 /// A list of type EFI_RUNTIME_IMAGE_ENTRY.
77 ///
78 EFI_LIST_ENTRY ImageHead;
79
80 ///
81 /// A list of type EFI_RUNTIME_EVENT_ENTRY.
82 ///
83 EFI_LIST_ENTRY EventHead;
84
85 ///
86 /// Size of a memory descriptor that is return by GetMemoryMap().
87 ///
88 UINTN MemoryDescriptorSize;
89
90 ///
91 /// Version of a memory descriptor that is return by GetMemoryMap().
92 ///
93 UINT32 MemoryDesciptorVersion;
94
95 ///
96 /// Size of the memory map in bytes contained in MemoryMapPhysical and MemoryMapVirtual.
97 ///
98 UINTN MemoryMapSize;
99
100 ///
101 /// Pointer to a runtime buffer that contains a copy of
102 /// the memory map returned via GetMemoryMap().
103 ///
104 EFI_MEMORY_DESCRIPTOR *MemoryMapPhysical;
105
106 ///
107 /// Pointer to MemoryMapPhysical that is updated to virtual mode after SetVirtualAddressMap().
108 ///
109 EFI_MEMORY_DESCRIPTOR *MemoryMapVirtual;
110
111 ///
112 /// Boolean that is TRUE if SetVirtualAddressMap() has been called.
113 ///
114 BOOLEAN VirtualMode;
115
116 ///
117 /// Boolean that is TRUE if ExitBootServices () has been called.
118 ///
119 BOOLEAN AtRuntime;
120 };
121
122 extern EFI_GUID gEfiRuntimeArchProtocolGuid;
123
124 #endif