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