]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Dxe/ArchProtocol/Runtime.h
Sync this file with MiscSubClass spec and add some struture alias to use them more...
[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
0647c9ad
LG
53 @param This The EFI_RUNTIME_ARCH_PROTOCOL instance.\r
54 @param ImageBase Start of image that has been loaded in memory. It is either\r
55 a pointer to the DOS or PE header of the image.\r
56 @param ImageSize Size of the image in bytes.\r
57 @param RelocationData Information about the fixups that were performed on ImageBase\r
58 when it was loaded into memory. This information is needed\r
59 when the virtual mode fix-ups are reapplied so that data that\r
60 has been programmatically updated will not be fixed up. If\r
61 code updates a global variable the code is responsible for\r
62 fixing up the variable for virtual mode.\r
63\r
64 @retval EFI_SUCCESS The ImageBase has been registered.\r
65 @retval EFI_OUT_OF_RESOURCES There are not enough resources to register ImageBase.\r
878ddf1f 66\r
67**/\r
68typedef\r
69EFI_STATUS\r
70(EFIAPI *EFI_RUNTIME_REGISTER_IMAGE) (\r
71 IN EFI_RUNTIME_ARCH_PROTOCOL *This,\r
72 IN EFI_PHYSICAL_ADDRESS ImageBase, \r
73 IN UINTN ImageSize, \r
74 IN VOID *RelocationData \r
75 );\r
76\r
77\r
78/**\r
79 This function is used to support the required runtime events. Currently only \r
80 runtime events of type EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE needs to be \r
81 registered with this service. All the runtime events that exist in the DXE \r
82 Core should be registered with this service when ExitBootServices() is called. \r
83 All the events that are registered with this service must have been created \r
84 with the Boot Service CreateEvent(). As a result, no parameter checking needs \r
85 to be performed.\r
86\r
0647c9ad
LG
87 @param This The EFI_RUNTIME_ARCH_PROTOCOL instance.\r
88 @param Type The same as Type passed into CreateEvent().\r
89 @param NotifyTpl The same as NotifyTpl passed into CreateEvent().\r
90 @param NotifyFunction The same as NotifyFunction passed into CreateEvent().\r
91 @param NotifyContext The same as NotifyContext passed into CreateEvent().\r
92 @param Event The EFI_EVENT returned by CreateEvent(). Event must be in\r
93 runtime memory.\r
94\r
95 @retval EFI_SUCCESS The Event has been registered.\r
96 @retval EFI_OUT_OF_RESOURCES There are not enough resources to register Event.\r
878ddf1f 97\r
98**/\r
99typedef\r
100EFI_STATUS\r
101(EFIAPI *EFI_RUNTIME_REGISTER_EVENT) (\r
102 IN EFI_RUNTIME_ARCH_PROTOCOL *This,\r
103 IN UINT32 Type,\r
104 IN EFI_TPL NotifyTpl,\r
105 IN EFI_EVENT_NOTIFY NotifyFunction,\r
106 IN VOID *NotifyContext,\r
107 IN EFI_EVENT *Event\r
108 );\r
109\r
110//\r
111// Interface stucture for the Runtime Architectural Protocol\r
112//\r
113/**\r
114 @par Protocol Description:\r
115 The DXE driver that produces this protocol must be a runtime driver. This \r
116 driver is responsible for initializing the SetVirtualAddressMap() and \r
117 ConvertPointer() fields of the EFI Runtime Services Table and the \r
118 CalculateCrc32() field of the EFI Boot Services Table. See the Runtime \r
119 Services chapter and the Boot Services chapter for details on these services.\r
120 After the two fields of the EFI Runtime Services Table and the one field of \r
121 the EFI Boot Services Table have been initialized, the driver must install \r
122 the EFI_RUNTIME_ARCH_PROTOCOL_GUID on a new handle with an EFI_RUNTIME_ARCH_ \r
123 PROTOCOL interface pointer. The installation of this protocol informs the \r
124 DXE core that the virtual memory services and the 32-bit CRC services are \r
125 now available, and the DXE core must update the 32-bit CRC of the EFI Runtime \r
126 Services Table and the 32-bit CRC of the EFI Boot Services Table.\r
127\r
128 All runtime core services are provided by the EFI_RUNTIME_ARCH_PROTOCOL. \r
129 This includes the support for registering runtime images that must be \r
130 re-fixed up when a transition is made from physical mode to virtual mode. \r
131 This protocol also supports all events that are defined to fire at runtime. \r
132 This protocol also contains a CRC-32 function that will be used by the DXE \r
133 core as a boot service. The EFI_RUNTIME_ARCH_PROTOCOL needs the CRC-32 \r
134 function when a transition is made from physical mode to virtual mode and \r
135 the EFI System Table and EFI Runtime Table are fixed up with virtual pointers.\r
136\r
137 @param RegisterRuntimeImage\r
138 Register a runtime image so it can be converted to virtual mode if the EFI Runtime Services \r
139 SetVirtualAddressMap() is called.\r
140\r
141 @param RegisterRuntimeEvent\r
142 Register an event than needs to be notified at runtime. \r
143\r
144**/\r
145struct _EFI_RUNTIME_ARCH_PROTOCOL {\r
146 EFI_RUNTIME_REGISTER_IMAGE RegisterImage;\r
147 EFI_RUNTIME_REGISTER_EVENT RegisterEvent;\r
148};\r
149\r
150extern EFI_GUID gEfiRuntimeArchProtocolGuid;\r
151\r
152#endif\r