]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Sockets/WebServer/RuntimeServicesTable.c
AppPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / AppPkg / Applications / Sockets / WebServer / RuntimeServicesTable.c
CommitLineData
9f7f5161 1/**
2 @file
3 Display the runtime services table
4684b66f 4
bcb96695
MK
5 Copyright (c) 2011-2012, Intel Corporation. All rights reserved.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
4684b66f 7
8**/
9
10#include <WebServer.h>
11#include <Library/UefiRuntimeServicesTableLib.h>
12
13/**
14 Respond with the runtime services table
15
16 @param [in] SocketFD The socket's file descriptor to add to the list.
17 @param [in] pPort The WSDT_PORT structure address
18 @param [out] pbDone Address to receive the request completion status
19
20 @retval EFI_SUCCESS The request was successfully processed
21
22**/
23EFI_STATUS
24RuntimeSservicesTablePage (
25 IN int SocketFD,
26 IN WSDT_PORT * pPort,
27 OUT BOOLEAN * pbDone
28 )
29{
30 EFI_STATUS Status;
31
32 DBG_ENTER ( );
33
34 //
35 // Send the runtime services page
36 //
37 for ( ; ; ) {
38 //
39 // Send the page and table header
40 //
41 Status = TableHeader ( SocketFD, pPort, L"Runtime Services Table", gRT );
42 if ( EFI_ERROR ( Status )) {
43 break;
44 }
45
46 ///
47 /// The table header for the EFI Runtime Services Table.
48 ///
49 Status = EfiTableHeader ( SocketFD,
50 pPort,
51 &gRT->Hdr );
52 if ( EFI_ERROR ( Status )) {
53 break;
54 }
55
56 //
57 // Time Services
58 //
59 Status = RowPointer ( SocketFD,
60 pPort,
61 "GetTime",
62 (VOID *)gRT->GetTime,
63 NULL );
64 if ( EFI_ERROR ( Status )) {
65 break;
66 }
67 Status = RowPointer ( SocketFD,
68 pPort,
69 "SetTime",
70 (VOID *)gRT->SetTime,
71 NULL );
72 if ( EFI_ERROR ( Status )) {
73 break;
74 }
75 Status = RowPointer ( SocketFD,
76 pPort,
77 "GetWakeupTime",
78 (VOID *)gRT->GetWakeupTime,
79 NULL );
80 if ( EFI_ERROR ( Status )) {
81 break;
82 }
83 Status = RowPointer ( SocketFD,
84 pPort,
85 "SetWakeupTime",
86 (VOID *)gRT->SetWakeupTime,
87 NULL );
88 if ( EFI_ERROR ( Status )) {
89 break;
90 }
91
92 //
93 // Virtual Memory Services
94 //
95 Status = RowPointer ( SocketFD,
96 pPort,
97 "SetVirtualAddressMap",
98 (VOID *)gRT->SetVirtualAddressMap,
99 NULL );
100 if ( EFI_ERROR ( Status )) {
101 break;
102 }
103 Status = RowPointer ( SocketFD,
104 pPort,
105 "ConvertPointer",
106 (VOID *)gRT->ConvertPointer,
107 NULL );
108 if ( EFI_ERROR ( Status )) {
109 break;
110 }
111
112 //
113 // Variable Services
114 //
115 Status = RowPointer ( SocketFD,
116 pPort,
117 "GetVariable",
118 (VOID *)gRT->GetVariable,
119 NULL );
120 if ( EFI_ERROR ( Status )) {
121 break;
122 }
123 Status = RowPointer ( SocketFD,
124 pPort,
125 "GetNextVariableName",
126 (VOID *)gRT->GetNextVariableName,
127 NULL );
128 if ( EFI_ERROR ( Status )) {
129 break;
130 }
131 Status = RowPointer ( SocketFD,
132 pPort,
133 "SetVariable",
134 (VOID *)gRT->SetVariable,
135 NULL );
136 if ( EFI_ERROR ( Status )) {
137 break;
138 }
139
140 //
141 // Miscellaneous Services
142 //
143 Status = RowPointer ( SocketFD,
144 pPort,
145 "GetNextHighNonotonicCount",
146 (VOID *)gRT->GetNextHighMonotonicCount,
147 NULL );
148 if ( EFI_ERROR ( Status )) {
149 break;
150 }
151 Status = RowPointer ( SocketFD,
152 pPort,
153 "ResetSystem",
154 (VOID *)gRT->ResetSystem,
155 NULL );
156 if ( EFI_ERROR ( Status )) {
157 break;
158 }
159
160 //
161 // Determine if the structures supports 2.0 services
162 //
163 if ( 2 <= ( gRT->Hdr.Revision >> 16 )) {
164 //
165 // UEFI 2.0 Capsule Services
166 //
167 Status = RowPointer ( SocketFD,
168 pPort,
169 "UpdateCapsule",
170 (VOID *)gRT->UpdateCapsule,
171 NULL );
172 if ( EFI_ERROR ( Status )) {
173 break;
174 }
175 Status = RowPointer ( SocketFD,
176 pPort,
177 "QueryCapsuleCapabilities",
178 (VOID *)gRT->QueryCapsuleCapabilities,
179 NULL );
180 if ( EFI_ERROR ( Status )) {
181 break;
182 }
183
184 //
185 // Miscellaneous UEFI 2.0 Service
186 //
187 Status = RowPointer ( SocketFD,
188 pPort,
189 "QueryVariableInfo",
190 (VOID *)gRT->QueryVariableInfo,
191 NULL );
192 if ( EFI_ERROR ( Status )) {
193 break;
194 }
195 }
196
197 //
198 // Build the table trailer
199 //
200 Status = TableTrailer ( SocketFD,
201 pPort,
202 pbDone );
203 break;
204 }
205
206 //
207 // Return the operation status
208 //
209 DBG_EXIT_STATUS ( Status );
210 return Status;
211}