]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Dxe/ArchProtocol/Runtime.h
Initial import.
[mirror_edk2.git] / MdePkg / Include / Dxe / ArchProtocol / Runtime.h
CommitLineData
878ddf1f 1/** @file\r
2 Runtime Architectural Protocol as defined in DXE CIS\r
3\r
4 This code is used to produce the EFI 1.0 runtime virtual switch over\r
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
16 Copyright (c) 2006, Intel Corporation \r
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
25 Module Name: Runtime.h\r
26\r
27 @par Revision Reference:\r
28 Version 0.90.\r
29\r
30**/\r
31\r
32#ifndef __ARCH_PROTOCOL_RUNTIME_H__\r
33#define __ARCH_PROTOCOL_RUNTIME_H__\r
34\r
35//\r
36// Global ID for the Runtime Architectural Protocol\r
37//\r
38#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \\r
39 { 0x96d08253, 0x8483, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
40\r
41typedef struct _EFI_RUNTIME_ARCH_PROTOCOL EFI_RUNTIME_ARCH_PROTOCOL;\r
42\r
43/**\r
44 When a SetVirtualAddressMap() is performed all the runtime images loaded by \r
45 DXE must be fixed up with the new virtual address map. To facilitate this the \r
46 Runtime Architectural Protocol needs to be informed of every runtime driver \r
47 that is registered. All the runtime images loaded by DXE should be registered \r
48 with this service by the DXE Core when ExitBootServices() is called. The \r
49 images that are registered with this service must have successfully been \r
50 loaded into memory with the Boot Service LoadImage(). As a result, no \r
51 parameter checking needs to be performed.\r
52\r
53 @param This The EFI_RUNTIME_ARCH_PROTOCOL instance.\r
54 \r
55 @param ImageBase Start of image that has been loaded in memory. It is either\r
56 a pointer to the DOS or PE header of the image.\r
57 \r
58 @param ImageSize Size of the image in bytes.\r
59 \r
60 @param RelocationData Information about the fixups that were performed on ImageBase\r
61 when it was loaded into memory. This information is needed\r
62 when the virtual mode fix-ups are reapplied so that data that\r
63 has been programmatically updated will not be fixed up. If\r
64 code updates a global variable the code is responsible for\r
65 fixing up the variable for virtual mode.\r
66\r
67 @retval EFI_SUCCESS The ImageBase has been registered.\r
68 \r
69 @retval EFI_OUT_OF_RESOURCES There are not enough resources to register ImageBase.\r
70\r
71**/\r
72typedef\r
73EFI_STATUS\r
74(EFIAPI *EFI_RUNTIME_REGISTER_IMAGE) (\r
75 IN EFI_RUNTIME_ARCH_PROTOCOL *This,\r
76 IN EFI_PHYSICAL_ADDRESS ImageBase, \r
77 IN UINTN ImageSize, \r
78 IN VOID *RelocationData \r
79 );\r
80\r
81\r
82/**\r
83 This function is used to support the required runtime events. Currently only \r
84 runtime events of type EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE needs to be \r
85 registered with this service. All the runtime events that exist in the DXE \r
86 Core should be registered with this service when ExitBootServices() is called. \r
87 All the events that are registered with this service must have been created \r
88 with the Boot Service CreateEvent(). As a result, no parameter checking needs \r
89 to be performed.\r
90\r
91 @param This The EFI_RUNTIME_ARCH_PROTOCOL instance.\r
92 \r
93 @param Type The same as Type passed into CreateEvent().\r
94 \r
95 @param NotifyTpl The same as NotifyTpl passed into CreateEvent().\r
96 \r
97 @param NotifyFunction The same as NotifyFunction passed into CreateEvent().\r
98 \r
99 @param NotifyContext The same as NotifyContext passed into CreateEvent().\r
100 \r
101 @param Event The EFI_EVENT returned by CreateEvent(). Event must be in\r
102 runtime memory.\r
103\r
104 @retval EFI_SUCCESS The Event has been registered.\r
105 \r
106 @retval EFI_OUT_OF_RESOURCES There are not enough resources to register Event.\r
107\r
108**/\r
109typedef\r
110EFI_STATUS\r
111(EFIAPI *EFI_RUNTIME_REGISTER_EVENT) (\r
112 IN EFI_RUNTIME_ARCH_PROTOCOL *This,\r
113 IN UINT32 Type,\r
114 IN EFI_TPL NotifyTpl,\r
115 IN EFI_EVENT_NOTIFY NotifyFunction,\r
116 IN VOID *NotifyContext,\r
117 IN EFI_EVENT *Event\r
118 );\r
119\r
120//\r
121// Interface stucture for the Runtime Architectural Protocol\r
122//\r
123/**\r
124 @par Protocol Description:\r
125 The DXE driver that produces this protocol must be a runtime driver. This \r
126 driver is responsible for initializing the SetVirtualAddressMap() and \r
127 ConvertPointer() fields of the EFI Runtime Services Table and the \r
128 CalculateCrc32() field of the EFI Boot Services Table. See the Runtime \r
129 Services chapter and the Boot Services chapter for details on these services.\r
130 After the two fields of the EFI Runtime Services Table and the one field of \r
131 the EFI Boot Services Table have been initialized, the driver must install \r
132 the EFI_RUNTIME_ARCH_PROTOCOL_GUID on a new handle with an EFI_RUNTIME_ARCH_ \r
133 PROTOCOL interface pointer. The installation of this protocol informs the \r
134 DXE core that the virtual memory services and the 32-bit CRC services are \r
135 now available, and the DXE core must update the 32-bit CRC of the EFI Runtime \r
136 Services Table and the 32-bit CRC of the EFI Boot Services Table.\r
137\r
138 All runtime core services are provided by the EFI_RUNTIME_ARCH_PROTOCOL. \r
139 This includes the support for registering runtime images that must be \r
140 re-fixed up when a transition is made from physical mode to virtual mode. \r
141 This protocol also supports all events that are defined to fire at runtime. \r
142 This protocol also contains a CRC-32 function that will be used by the DXE \r
143 core as a boot service. The EFI_RUNTIME_ARCH_PROTOCOL needs the CRC-32 \r
144 function when a transition is made from physical mode to virtual mode and \r
145 the EFI System Table and EFI Runtime Table are fixed up with virtual pointers.\r
146\r
147 @param RegisterRuntimeImage\r
148 Register a runtime image so it can be converted to virtual mode if the EFI Runtime Services \r
149 SetVirtualAddressMap() is called.\r
150\r
151 @param RegisterRuntimeEvent\r
152 Register an event than needs to be notified at runtime. \r
153\r
154**/\r
155struct _EFI_RUNTIME_ARCH_PROTOCOL {\r
156 EFI_RUNTIME_REGISTER_IMAGE RegisterImage;\r
157 EFI_RUNTIME_REGISTER_EVENT RegisterEvent;\r
158};\r
159\r
160extern EFI_GUID gEfiRuntimeArchProtocolGuid;\r
161\r
162#endif\r