]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/Runtime.h
355fa83fee976640be27134b82a5fbd426c3ac49
[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 // Interface stucture for the Runtime Architectural Protocol
66 //
67 /**
68 @par Protocol Description:
69 Allows the runtime functionality of the DXE Foundation to be contained in a
70 separate driver. It also provides hooks for the DXE Foundation to export
71 information that is needed at runtime. As such, this protocol allows the DXE
72 Foundation to manage runtime drivers and events. This protocol also implies
73 that the runtime services required to transition to virtual mode,
74 SetVirtualAddressMap() and ConvertPointer(), have been registered into the
75 EFI Runtime Table in the EFI System Partition. This protocol must be produced
76 by a runtime DXE driver and may only be consumed by the DXE Foundation.
77 **/
78 struct _EFI_RUNTIME_ARCH_PROTOCOL {
79 ///
80 /// A list of type EFI_RUNTIME_IMAGE_ENTRY.
81 ///
82 EFI_LIST_ENTRY ImageHead;
83
84 ///
85 /// A list of type EFI_RUNTIME_EVENT_ENTRY.
86 ///
87 EFI_LIST_ENTRY EventHead;
88
89 ///
90 /// Size of a memory descriptor that is return by GetMemoryMap().
91 ///
92 UINTN MemoryDescriptorSize;
93
94 ///
95 /// Version of a memory descriptor that is return by GetMemoryMap().
96 ///
97 UINT32 MemoryDesciptorVersion;
98
99 ///
100 /// Size of the memory map in bytes contained in MemoryMapPhysical and MemoryMapVirtual.
101 ///
102 UINTN MemoryMapSize;
103
104 ///
105 /// Pointer to a runtime buffer that contains a copy of
106 /// the memory map returned via GetMemoryMap().
107 ///
108 EFI_MEMORY_DESCRIPTOR *MemoryMapPhysical;
109
110 ///
111 /// Pointer to MemoryMapPhysical that is updated to virtual mode after SetVirtualAddressMap().
112 ///
113 EFI_MEMORY_DESCRIPTOR *MemoryMapVirtual;
114
115 ///
116 /// Boolean that is TRUE if SetVirtualAddressMap() has been called.
117 ///
118 BOOLEAN VirtualMode;
119
120 ///
121 /// Boolean that is TRUE if ExitBootServices () has been called.
122 ///
123 BOOLEAN AtRuntime;
124 };
125
126 extern EFI_GUID gEfiRuntimeArchProtocolGuid;
127
128 #endif