]>
Commit | Line | Data |
---|---|---|
4684b66f | 1 | /*++ |
2 | This file contains an 'Intel UEFI Application' and is | |
3 | licensed for Intel CPUs and chipsets under the terms of your | |
4 | license agreement with Intel or your vendor. This file may | |
5 | be modified by the user, subject to additional terms of the | |
6 | license agreement | |
7 | --*/ | |
8 | /*++ | |
9 | ||
10 | Copyright (c) 2011 Intel Corporation. All rights reserved | |
11 | This software and associated documentation (if any) is furnished | |
12 | under a license and may only be used or copied in accordance | |
13 | with the terms of the license. Except as permitted by such | |
14 | license, no part of this software or documentation may be | |
15 | reproduced, stored in a retrieval system, or transmitted in any | |
16 | form or by any means without the express written consent of | |
17 | Intel Corporation. | |
18 | ||
19 | --*/ | |
20 | ||
21 | /** @file | |
22 | Display the runtime services table | |
23 | ||
24 | **/ | |
25 | ||
26 | #include <WebServer.h> | |
27 | #include <Library/UefiRuntimeServicesTableLib.h> | |
28 | ||
29 | /** | |
30 | Respond with the runtime services table | |
31 | ||
32 | @param [in] SocketFD The socket's file descriptor to add to the list. | |
33 | @param [in] pPort The WSDT_PORT structure address | |
34 | @param [out] pbDone Address to receive the request completion status | |
35 | ||
36 | @retval EFI_SUCCESS The request was successfully processed | |
37 | ||
38 | **/ | |
39 | EFI_STATUS | |
40 | RuntimeSservicesTablePage ( | |
41 | IN int SocketFD, | |
42 | IN WSDT_PORT * pPort, | |
43 | OUT BOOLEAN * pbDone | |
44 | ) | |
45 | { | |
46 | EFI_STATUS Status; | |
47 | ||
48 | DBG_ENTER ( ); | |
49 | ||
50 | // | |
51 | // Send the runtime services page | |
52 | // | |
53 | for ( ; ; ) { | |
54 | // | |
55 | // Send the page and table header | |
56 | // | |
57 | Status = TableHeader ( SocketFD, pPort, L"Runtime Services Table", gRT ); | |
58 | if ( EFI_ERROR ( Status )) { | |
59 | break; | |
60 | } | |
61 | ||
62 | /// | |
63 | /// The table header for the EFI Runtime Services Table. | |
64 | /// | |
65 | Status = EfiTableHeader ( SocketFD, | |
66 | pPort, | |
67 | &gRT->Hdr ); | |
68 | if ( EFI_ERROR ( Status )) { | |
69 | break; | |
70 | } | |
71 | ||
72 | // | |
73 | // Time Services | |
74 | // | |
75 | Status = RowPointer ( SocketFD, | |
76 | pPort, | |
77 | "GetTime", | |
78 | (VOID *)gRT->GetTime, | |
79 | NULL ); | |
80 | if ( EFI_ERROR ( Status )) { | |
81 | break; | |
82 | } | |
83 | Status = RowPointer ( SocketFD, | |
84 | pPort, | |
85 | "SetTime", | |
86 | (VOID *)gRT->SetTime, | |
87 | NULL ); | |
88 | if ( EFI_ERROR ( Status )) { | |
89 | break; | |
90 | } | |
91 | Status = RowPointer ( SocketFD, | |
92 | pPort, | |
93 | "GetWakeupTime", | |
94 | (VOID *)gRT->GetWakeupTime, | |
95 | NULL ); | |
96 | if ( EFI_ERROR ( Status )) { | |
97 | break; | |
98 | } | |
99 | Status = RowPointer ( SocketFD, | |
100 | pPort, | |
101 | "SetWakeupTime", | |
102 | (VOID *)gRT->SetWakeupTime, | |
103 | NULL ); | |
104 | if ( EFI_ERROR ( Status )) { | |
105 | break; | |
106 | } | |
107 | ||
108 | // | |
109 | // Virtual Memory Services | |
110 | // | |
111 | Status = RowPointer ( SocketFD, | |
112 | pPort, | |
113 | "SetVirtualAddressMap", | |
114 | (VOID *)gRT->SetVirtualAddressMap, | |
115 | NULL ); | |
116 | if ( EFI_ERROR ( Status )) { | |
117 | break; | |
118 | } | |
119 | Status = RowPointer ( SocketFD, | |
120 | pPort, | |
121 | "ConvertPointer", | |
122 | (VOID *)gRT->ConvertPointer, | |
123 | NULL ); | |
124 | if ( EFI_ERROR ( Status )) { | |
125 | break; | |
126 | } | |
127 | ||
128 | // | |
129 | // Variable Services | |
130 | // | |
131 | Status = RowPointer ( SocketFD, | |
132 | pPort, | |
133 | "GetVariable", | |
134 | (VOID *)gRT->GetVariable, | |
135 | NULL ); | |
136 | if ( EFI_ERROR ( Status )) { | |
137 | break; | |
138 | } | |
139 | Status = RowPointer ( SocketFD, | |
140 | pPort, | |
141 | "GetNextVariableName", | |
142 | (VOID *)gRT->GetNextVariableName, | |
143 | NULL ); | |
144 | if ( EFI_ERROR ( Status )) { | |
145 | break; | |
146 | } | |
147 | Status = RowPointer ( SocketFD, | |
148 | pPort, | |
149 | "SetVariable", | |
150 | (VOID *)gRT->SetVariable, | |
151 | NULL ); | |
152 | if ( EFI_ERROR ( Status )) { | |
153 | break; | |
154 | } | |
155 | ||
156 | // | |
157 | // Miscellaneous Services | |
158 | // | |
159 | Status = RowPointer ( SocketFD, | |
160 | pPort, | |
161 | "GetNextHighNonotonicCount", | |
162 | (VOID *)gRT->GetNextHighMonotonicCount, | |
163 | NULL ); | |
164 | if ( EFI_ERROR ( Status )) { | |
165 | break; | |
166 | } | |
167 | Status = RowPointer ( SocketFD, | |
168 | pPort, | |
169 | "ResetSystem", | |
170 | (VOID *)gRT->ResetSystem, | |
171 | NULL ); | |
172 | if ( EFI_ERROR ( Status )) { | |
173 | break; | |
174 | } | |
175 | ||
176 | // | |
177 | // Determine if the structures supports 2.0 services | |
178 | // | |
179 | if ( 2 <= ( gRT->Hdr.Revision >> 16 )) { | |
180 | // | |
181 | // UEFI 2.0 Capsule Services | |
182 | // | |
183 | Status = RowPointer ( SocketFD, | |
184 | pPort, | |
185 | "UpdateCapsule", | |
186 | (VOID *)gRT->UpdateCapsule, | |
187 | NULL ); | |
188 | if ( EFI_ERROR ( Status )) { | |
189 | break; | |
190 | } | |
191 | Status = RowPointer ( SocketFD, | |
192 | pPort, | |
193 | "QueryCapsuleCapabilities", | |
194 | (VOID *)gRT->QueryCapsuleCapabilities, | |
195 | NULL ); | |
196 | if ( EFI_ERROR ( Status )) { | |
197 | break; | |
198 | } | |
199 | ||
200 | // | |
201 | // Miscellaneous UEFI 2.0 Service | |
202 | // | |
203 | Status = RowPointer ( SocketFD, | |
204 | pPort, | |
205 | "QueryVariableInfo", | |
206 | (VOID *)gRT->QueryVariableInfo, | |
207 | NULL ); | |
208 | if ( EFI_ERROR ( Status )) { | |
209 | break; | |
210 | } | |
211 | } | |
212 | ||
213 | // | |
214 | // Build the table trailer | |
215 | // | |
216 | Status = TableTrailer ( SocketFD, | |
217 | pPort, | |
218 | pbDone ); | |
219 | break; | |
220 | } | |
221 | ||
222 | // | |
223 | // Return the operation status | |
224 | // | |
225 | DBG_EXIT_STATUS ( Status ); | |
226 | return Status; | |
227 | } |