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