]>
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 boot services table | |
23 | ||
24 | **/ | |
25 | ||
26 | #include <WebServer.h> | |
27 | ||
28 | /** | |
29 | Respond with the boot services table | |
30 | ||
31 | @param [in] SocketFD The socket's file descriptor to add to the list. | |
32 | @param [in] pPort The WSDT_PORT structure address | |
33 | @param [out] pbDone Address to receive the request completion status | |
34 | ||
35 | @retval EFI_SUCCESS The request was successfully processed | |
36 | ||
37 | **/ | |
38 | EFI_STATUS | |
39 | BootServicesTablePage ( | |
40 | IN int SocketFD, | |
41 | IN WSDT_PORT * pPort, | |
42 | OUT BOOLEAN * pbDone | |
43 | ) | |
44 | { | |
45 | EFI_STATUS Status; | |
46 | ||
47 | DBG_ENTER ( ); | |
48 | ||
49 | // | |
50 | // Send the boot services page | |
51 | // | |
52 | for ( ; ; ) { | |
53 | // | |
54 | // Send the page and table header | |
55 | // | |
56 | Status = TableHeader ( SocketFD, pPort, L"Boot Services Table", gBS ); | |
57 | if ( EFI_ERROR ( Status )) { | |
58 | break; | |
59 | } | |
60 | ||
61 | /// | |
62 | /// The table header for the EFI Boot Services Table. | |
63 | /// | |
64 | Status = EfiTableHeader ( SocketFD, | |
65 | pPort, | |
66 | &gBS->Hdr ); | |
67 | if ( EFI_ERROR ( Status )) { | |
68 | break; | |
69 | } | |
70 | ||
71 | // | |
72 | // Task Priority Services | |
73 | // | |
74 | Status = RowPointer ( SocketFD, | |
75 | pPort, | |
76 | "RaiseTPL", | |
77 | (CONST VOID *)gBS->RaiseTPL, | |
78 | NULL ); | |
79 | if ( EFI_ERROR ( Status )) { | |
80 | break; | |
81 | } | |
82 | Status = RowPointer ( SocketFD, | |
83 | pPort, | |
84 | "RestoreTPL", | |
85 | (CONST VOID *)gBS->RestoreTPL, | |
86 | NULL ); | |
87 | if ( EFI_ERROR ( Status )) { | |
88 | break; | |
89 | } | |
90 | ||
91 | // | |
92 | // Memory Services | |
93 | // | |
94 | Status = RowPointer ( SocketFD, | |
95 | pPort, | |
96 | "AllocatePages", | |
97 | (CONST VOID *)gBS->AllocatePages, | |
98 | NULL ); | |
99 | if ( EFI_ERROR ( Status )) { | |
100 | break; | |
101 | } | |
102 | Status = RowPointer ( SocketFD, | |
103 | pPort, | |
104 | "FreePages", | |
105 | (CONST VOID *)gBS->FreePages, | |
106 | NULL ); | |
107 | if ( EFI_ERROR ( Status )) { | |
108 | break; | |
109 | } | |
110 | Status = RowPointer ( SocketFD, | |
111 | pPort, | |
112 | "GetMemoryMap", | |
113 | (CONST VOID *)gBS->GetMemoryMap, | |
114 | NULL ); | |
115 | if ( EFI_ERROR ( Status )) { | |
116 | break; | |
117 | } | |
118 | Status = RowPointer ( SocketFD, | |
119 | pPort, | |
120 | "AllocatePool", | |
121 | (CONST VOID *)gBS->AllocatePool, | |
122 | NULL ); | |
123 | if ( EFI_ERROR ( Status )) { | |
124 | break; | |
125 | } | |
126 | Status = RowPointer ( SocketFD, | |
127 | pPort, | |
128 | "FreePool", | |
129 | (CONST VOID *)gBS->FreePool, | |
130 | NULL ); | |
131 | if ( EFI_ERROR ( Status )) { | |
132 | break; | |
133 | } | |
134 | ||
135 | // | |
136 | // Event & Timer Services | |
137 | // | |
138 | Status = RowPointer ( SocketFD, | |
139 | pPort, | |
140 | "CreateEvent", | |
141 | (CONST VOID *)gBS->CreateEvent, | |
142 | NULL ); | |
143 | if ( EFI_ERROR ( Status )) { | |
144 | break; | |
145 | } | |
146 | Status = RowPointer ( SocketFD, | |
147 | pPort, | |
148 | "SetTimer", | |
149 | (CONST VOID *)gBS->SetTimer, | |
150 | NULL ); | |
151 | if ( EFI_ERROR ( Status )) { | |
152 | break; | |
153 | } | |
154 | Status = RowPointer ( SocketFD, | |
155 | pPort, | |
156 | "WaitForEvent", | |
157 | (CONST VOID *)gBS->WaitForEvent, | |
158 | NULL ); | |
159 | if ( EFI_ERROR ( Status )) { | |
160 | break; | |
161 | } | |
162 | Status = RowPointer ( SocketFD, | |
163 | pPort, | |
164 | "SignalEvent", | |
165 | (CONST VOID *)gBS->SignalEvent, | |
166 | NULL ); | |
167 | if ( EFI_ERROR ( Status )) { | |
168 | break; | |
169 | } | |
170 | Status = RowPointer ( SocketFD, | |
171 | pPort, | |
172 | "CloseEvent", | |
173 | (CONST VOID *)gBS->CloseEvent, | |
174 | NULL ); | |
175 | if ( EFI_ERROR ( Status )) { | |
176 | break; | |
177 | } | |
178 | Status = RowPointer ( SocketFD, | |
179 | pPort, | |
180 | "CheckEvent", | |
181 | (CONST VOID *)gBS->CheckEvent, | |
182 | NULL ); | |
183 | if ( EFI_ERROR ( Status )) { | |
184 | break; | |
185 | } | |
186 | ||
187 | // | |
188 | // Protocol Handler Services | |
189 | // | |
190 | Status = RowPointer ( SocketFD, | |
191 | pPort, | |
192 | "InstallProtocolInterface", | |
193 | (CONST VOID *)gBS->InstallProtocolInterface, | |
194 | NULL ); | |
195 | if ( EFI_ERROR ( Status )) { | |
196 | break; | |
197 | } | |
198 | Status = RowPointer ( SocketFD, | |
199 | pPort, | |
200 | "ReinstallProtocolInterface", | |
201 | (CONST VOID *)gBS->ReinstallProtocolInterface, | |
202 | NULL ); | |
203 | if ( EFI_ERROR ( Status )) { | |
204 | break; | |
205 | } | |
206 | Status = RowPointer ( SocketFD, | |
207 | pPort, | |
208 | "UninstallProtocolInterface", | |
209 | (CONST VOID *)gBS->UninstallProtocolInterface, | |
210 | NULL ); | |
211 | if ( EFI_ERROR ( Status )) { | |
212 | break; | |
213 | } | |
214 | Status = RowPointer ( SocketFD, | |
215 | pPort, | |
216 | "HandleProtocol", | |
217 | (CONST VOID *)gBS->HandleProtocol, | |
218 | NULL ); | |
219 | if ( EFI_ERROR ( Status )) { | |
220 | break; | |
221 | } | |
222 | Status = RowPointer ( SocketFD, | |
223 | pPort, | |
224 | "Reserved", | |
225 | (CONST VOID *)gBS->Reserved, | |
226 | NULL ); | |
227 | if ( EFI_ERROR ( Status )) { | |
228 | break; | |
229 | } | |
230 | Status = RowPointer ( SocketFD, | |
231 | pPort, | |
232 | "RegisterProtocolNotify", | |
233 | (CONST VOID *)gBS->RegisterProtocolNotify, | |
234 | NULL ); | |
235 | if ( EFI_ERROR ( Status )) { | |
236 | break; | |
237 | } | |
238 | Status = RowPointer ( SocketFD, | |
239 | pPort, | |
240 | "LocateHandle", | |
241 | (CONST VOID *)gBS->LocateHandle, | |
242 | NULL ); | |
243 | if ( EFI_ERROR ( Status )) { | |
244 | break; | |
245 | } | |
246 | Status = RowPointer ( SocketFD, | |
247 | pPort, | |
248 | "LocateDevicePath", | |
249 | (CONST VOID *)gBS->LocateDevicePath, | |
250 | NULL ); | |
251 | if ( EFI_ERROR ( Status )) { | |
252 | break; | |
253 | } | |
254 | Status = RowPointer ( SocketFD, | |
255 | pPort, | |
256 | "InstallConfigurationTable", | |
257 | (CONST VOID *)gBS->InstallConfigurationTable, | |
258 | NULL ); | |
259 | if ( EFI_ERROR ( Status )) { | |
260 | break; | |
261 | } | |
262 | ||
263 | // | |
264 | // Image Services | |
265 | // | |
266 | Status = RowPointer ( SocketFD, | |
267 | pPort, | |
268 | "LoadImage", | |
269 | (CONST VOID *)gBS->LoadImage, | |
270 | NULL ); | |
271 | if ( EFI_ERROR ( Status )) { | |
272 | break; | |
273 | } | |
274 | Status = RowPointer ( SocketFD, | |
275 | pPort, | |
276 | "StartImage", | |
277 | (CONST VOID *)gBS->StartImage, | |
278 | NULL ); | |
279 | if ( EFI_ERROR ( Status )) { | |
280 | break; | |
281 | } | |
282 | Status = RowPointer ( SocketFD, | |
283 | pPort, | |
284 | "Exit", | |
285 | (CONST VOID *)gBS->Exit, | |
286 | NULL ); | |
287 | if ( EFI_ERROR ( Status )) { | |
288 | break; | |
289 | } | |
290 | Status = RowPointer ( SocketFD, | |
291 | pPort, | |
292 | "UnloadImage", | |
293 | (CONST VOID *)gBS->UnloadImage, | |
294 | NULL ); | |
295 | if ( EFI_ERROR ( Status )) { | |
296 | break; | |
297 | } | |
298 | Status = RowPointer ( SocketFD, | |
299 | pPort, | |
300 | "ExitBootServices", | |
301 | (CONST VOID *)gBS->ExitBootServices, | |
302 | NULL ); | |
303 | if ( EFI_ERROR ( Status )) { | |
304 | break; | |
305 | } | |
306 | ||
307 | // | |
308 | // Miscellaneous Services | |
309 | // | |
310 | Status = RowPointer ( SocketFD, | |
311 | pPort, | |
312 | "GetNextMonotonicCount", | |
313 | (CONST VOID *)gBS->GetNextMonotonicCount, | |
314 | NULL ); | |
315 | if ( EFI_ERROR ( Status )) { | |
316 | break; | |
317 | } | |
318 | Status = RowPointer ( SocketFD, | |
319 | pPort, | |
320 | "Stall", | |
321 | (CONST VOID *)gBS->Stall, | |
322 | NULL ); | |
323 | if ( EFI_ERROR ( Status )) { | |
324 | break; | |
325 | } | |
326 | Status = RowPointer ( SocketFD, | |
327 | pPort, | |
328 | "SetWatchdogTimer", | |
329 | (CONST VOID *)gBS->SetWatchdogTimer, | |
330 | NULL ); | |
331 | if ( EFI_ERROR ( Status )) { | |
332 | break; | |
333 | } | |
334 | ||
335 | // | |
336 | // DriverSupport Services | |
337 | // | |
338 | Status = RowPointer ( SocketFD, | |
339 | pPort, | |
340 | "ConnectController", | |
341 | (CONST VOID *)gBS->ConnectController, | |
342 | NULL ); | |
343 | if ( EFI_ERROR ( Status )) { | |
344 | break; | |
345 | } | |
346 | Status = RowPointer ( SocketFD, | |
347 | pPort, | |
348 | "DisconnectController", | |
349 | (CONST VOID *)gBS->DisconnectController, | |
350 | NULL ); | |
351 | if ( EFI_ERROR ( Status )) { | |
352 | break; | |
353 | } | |
354 | ||
355 | // | |
356 | // Open and Close Protocol Services | |
357 | // | |
358 | Status = RowPointer ( SocketFD, | |
359 | pPort, | |
360 | "OpenProtocol", | |
361 | (CONST VOID *)gBS->OpenProtocol, | |
362 | NULL ); | |
363 | if ( EFI_ERROR ( Status )) { | |
364 | break; | |
365 | } | |
366 | Status = RowPointer ( SocketFD, | |
367 | pPort, | |
368 | "CloseProtocol", | |
369 | (CONST VOID *)gBS->CloseProtocol, | |
370 | NULL ); | |
371 | if ( EFI_ERROR ( Status )) { | |
372 | break; | |
373 | } | |
374 | Status = RowPointer ( SocketFD, | |
375 | pPort, | |
376 | "OpenProtocolInformation", | |
377 | (CONST VOID *)gBS->OpenProtocolInformation, | |
378 | NULL ); | |
379 | if ( EFI_ERROR ( Status )) { | |
380 | break; | |
381 | } | |
382 | ||
383 | // | |
384 | // Library Services | |
385 | // | |
386 | Status = RowPointer ( SocketFD, | |
387 | pPort, | |
388 | "ProtocolsPerHandle", | |
389 | (CONST VOID *)gBS->ProtocolsPerHandle, | |
390 | NULL ); | |
391 | if ( EFI_ERROR ( Status )) { | |
392 | break; | |
393 | } | |
394 | Status = RowPointer ( SocketFD, | |
395 | pPort, | |
396 | "LocateHandleBuffer", | |
397 | (CONST VOID *)gBS->LocateHandleBuffer, | |
398 | NULL ); | |
399 | if ( EFI_ERROR ( Status )) { | |
400 | break; | |
401 | } | |
402 | Status = RowPointer ( SocketFD, | |
403 | pPort, | |
404 | "LocateProtocol", | |
405 | (CONST VOID *)gBS->LocateProtocol, | |
406 | NULL ); | |
407 | if ( EFI_ERROR ( Status )) { | |
408 | break; | |
409 | } | |
410 | Status = RowPointer ( SocketFD, | |
411 | pPort, | |
412 | "InstallMultipleProtocolInterfaces", | |
413 | (CONST VOID *)gBS->InstallMultipleProtocolInterfaces, | |
414 | NULL ); | |
415 | if ( EFI_ERROR ( Status )) { | |
416 | break; | |
417 | } | |
418 | Status = RowPointer ( SocketFD, | |
419 | pPort, | |
420 | "UninstallMultipleProtocolInterfaces", | |
421 | (CONST VOID *)gBS->UninstallMultipleProtocolInterfaces, | |
422 | NULL ); | |
423 | if ( EFI_ERROR ( Status )) { | |
424 | break; | |
425 | } | |
426 | ||
427 | // | |
428 | // 32-bit CRC Services | |
429 | // | |
430 | Status = RowPointer ( SocketFD, | |
431 | pPort, | |
432 | "CalculateCrc32", | |
433 | (CONST VOID *)gBS->CalculateCrc32, | |
434 | NULL ); | |
435 | if ( EFI_ERROR ( Status )) { | |
436 | break; | |
437 | } | |
438 | ||
439 | // | |
440 | // Miscellaneous Services | |
441 | // | |
442 | Status = RowPointer ( SocketFD, | |
443 | pPort, | |
444 | "CopyMem", | |
445 | (CONST VOID *)gBS->CopyMem, | |
446 | NULL ); | |
447 | if ( EFI_ERROR ( Status )) { | |
448 | break; | |
449 | } | |
450 | Status = RowPointer ( SocketFD, | |
451 | pPort, | |
452 | "SetMem", | |
453 | (CONST VOID *)gBS->SetMem, | |
454 | NULL ); | |
455 | if ( EFI_ERROR ( Status )) { | |
456 | break; | |
457 | } | |
458 | Status = RowPointer ( SocketFD, | |
459 | pPort, | |
460 | "CreateEventEx", | |
461 | (CONST VOID *)gBS->CreateEventEx, | |
462 | NULL ); | |
463 | if ( EFI_ERROR ( Status )) { | |
464 | break; | |
465 | } | |
466 | ||
467 | // | |
468 | // Build the table trailer | |
469 | // | |
470 | Status = TableTrailer ( SocketFD, | |
471 | pPort, | |
472 | pbDone ); | |
473 | break; | |
474 | } | |
475 | ||
476 | // | |
477 | // Return the operation status | |
478 | // | |
479 | DBG_EXIT_STATUS ( Status ); | |
480 | return Status; | |
481 | } |