]> git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Sockets/WebServer/DxeServicesTable.c
Merged socket development branch:
[mirror_edk2.git] / AppPkg / Applications / Sockets / WebServer / DxeServicesTable.c
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 DXE services table
23
24 **/
25
26 #include <WebServer.h>
27 #include <Guid/DxeServices.h>
28 #include <pi/PiDxeCis.h>
29
30 /**
31 Respond with the DXE services table
32
33 @param [in] SocketFD The socket's file descriptor to add to the list.
34 @param [in] pPort The WSDT_PORT structure address
35 @param [out] pbDone Address to receive the request completion status
36
37 @retval EFI_SUCCESS The request was successfully processed
38
39 **/
40 EFI_STATUS
41 DxeServicesTablePage (
42 IN int SocketFD,
43 IN WSDT_PORT * pPort,
44 OUT BOOLEAN * pbDone
45 )
46 {
47 EFI_DXE_SERVICES * pDS;
48 EFI_STATUS Status;
49
50 DBG_ENTER ( );
51
52 //
53 // Send the DXE services page
54 //
55 for ( ; ; ) {
56 //
57 // Get the DXE services table
58 //
59 Status = EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &pDS);
60 if ( EFI_ERROR ( Status )) {
61 break;
62 }
63
64 //
65 // Send the page and table header
66 //
67 Status = TableHeader ( SocketFD, pPort, L"DXE Services Table", pDS );
68 if ( EFI_ERROR ( Status )) {
69 break;
70 }
71
72 ///
73 /// The table header for the DXE Services Table.
74 /// This header contains the DXE_SERVICES_SIGNATURE and DXE_SERVICES_REVISION values.
75 ///
76 Status = EfiTableHeader ( SocketFD,
77 pPort,
78 &pDS->Hdr );
79 if ( EFI_ERROR ( Status )) {
80 break;
81 }
82
83 //
84 // Global Coherency Domain Services
85 //
86 Status = RowPointer ( SocketFD,
87 pPort,
88 "AddMemorySpace",
89 (VOID *)pDS->AddMemorySpace,
90 NULL );
91 if ( EFI_ERROR ( Status )) {
92 break;
93 }
94 Status = RowPointer ( SocketFD,
95 pPort,
96 "AllocateMemorySpace",
97 (VOID *)pDS->AllocateMemorySpace,
98 NULL );
99 if ( EFI_ERROR ( Status )) {
100 break;
101 }
102 Status = RowPointer ( SocketFD,
103 pPort,
104 "FreeMemorySpace",
105 (VOID *)pDS->FreeMemorySpace,
106 NULL );
107 if ( EFI_ERROR ( Status )) {
108 break;
109 }
110 Status = RowPointer ( SocketFD,
111 pPort,
112 "RemoveMemorySpace",
113 (VOID *)pDS->RemoveMemorySpace,
114 NULL );
115 if ( EFI_ERROR ( Status )) {
116 break;
117 }
118 Status = RowPointer ( SocketFD,
119 pPort,
120 "GetMemorySpaceDescriptor",
121 (VOID *)pDS->GetMemorySpaceDescriptor,
122 NULL );
123 if ( EFI_ERROR ( Status )) {
124 break;
125 }
126 Status = RowPointer ( SocketFD,
127 pPort,
128 "SetMemorySpaceAttributes",
129 (VOID *)pDS->SetMemorySpaceAttributes,
130 NULL );
131 if ( EFI_ERROR ( Status )) {
132 break;
133 }
134 Status = RowPointer ( SocketFD,
135 pPort,
136 "GetMemorySpaceMap",
137 (VOID *)pDS->GetMemorySpaceMap,
138 NULL );
139 if ( EFI_ERROR ( Status )) {
140 break;
141 }
142 Status = RowPointer ( SocketFD,
143 pPort,
144 "AddIoSpace",
145 (VOID *)pDS->AddIoSpace,
146 NULL );
147 if ( EFI_ERROR ( Status )) {
148 break;
149 }
150 Status = RowPointer ( SocketFD,
151 pPort,
152 "AllocateIoSpace",
153 (VOID *)pDS->AllocateIoSpace,
154 NULL );
155 if ( EFI_ERROR ( Status )) {
156 break;
157 }
158 Status = RowPointer ( SocketFD,
159 pPort,
160 "FreeIoSpace",
161 (VOID *)pDS->FreeIoSpace,
162 NULL );
163 if ( EFI_ERROR ( Status )) {
164 break;
165 }
166 Status = RowPointer ( SocketFD,
167 pPort,
168 "RemoveIoSpace",
169 (VOID *)pDS->RemoveIoSpace,
170 NULL );
171 if ( EFI_ERROR ( Status )) {
172 break;
173 }
174 Status = RowPointer ( SocketFD,
175 pPort,
176 "GetIoSpaceDescriptor",
177 (VOID *)pDS->GetIoSpaceDescriptor,
178 NULL );
179 if ( EFI_ERROR ( Status )) {
180 break;
181 }
182 Status = RowPointer ( SocketFD,
183 pPort,
184 "GetIoSpaceMap",
185 (VOID *)pDS->GetIoSpaceMap,
186 NULL );
187 if ( EFI_ERROR ( Status )) {
188 break;
189 }
190
191 //
192 // Dispatcher Services
193 //
194 Status = RowPointer ( SocketFD,
195 pPort,
196 "Dispatch",
197 (VOID *)pDS->Dispatch,
198 NULL );
199 if ( EFI_ERROR ( Status )) {
200 break;
201 }
202 Status = RowPointer ( SocketFD,
203 pPort,
204 "Schedule",
205 (VOID *)pDS->Schedule,
206 NULL );
207 if ( EFI_ERROR ( Status )) {
208 break;
209 }
210 Status = RowPointer ( SocketFD,
211 pPort,
212 "Trust",
213 (VOID *)pDS->Trust,
214 NULL );
215 if ( EFI_ERROR ( Status )) {
216 break;
217 }
218
219 //
220 // Service to process a single firmware volume found in a capsule
221 //
222 Status = RowPointer ( SocketFD,
223 pPort,
224 "ProcessFirmwareVolume",
225 (VOID *)pDS->ProcessFirmwareVolume,
226 NULL );
227 if ( EFI_ERROR ( Status )) {
228 break;
229 }
230
231 //
232 // Build the table trailer
233 //
234 Status = TableTrailer ( SocketFD,
235 pPort,
236 pbDone );
237 break;
238 }
239
240 //
241 // Return the operation status
242 //
243 DBG_EXIT_STATUS ( Status );
244 return Status;
245 }