|
@@ -227,3 +227,38 @@ PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec ) {
|
227
|
227
|
file_exec->Status = PXENV_STATUS_SUCCESS;
|
228
|
228
|
return PXENV_EXIT_SUCCESS;
|
229
|
229
|
}
|
|
230
|
+
|
|
231
|
+/**
|
|
232
|
+ * FILE API CHECK
|
|
233
|
+ *
|
|
234
|
+ * @v file_exec Pointer to a struct s_PXENV_FILE_API_CHECK
|
|
235
|
+ * @v s_PXENV_FILE_API_CHECK::Magic Inbound magic number (0x91d447b2)
|
|
236
|
+ * @ret #PXENV_EXIT_SUCCESS Command was executed successfully
|
|
237
|
+ * @ret #PXENV_EXIT_FAILURE Command was not executed successfully
|
|
238
|
+ * @ret s_PXENV_FILE_API_CHECK::Status PXE status code
|
|
239
|
+ * @ret s_PXENV_FILE_API_CHECK::Magic Outbound magic number (0xe9c17b20)
|
|
240
|
+ * @ret s_PXENV_FILE_API_CHECK::Provider "gPXE" (0x45585067)
|
|
241
|
+ * @ret s_PXENV_FILE_API_CHECK::APIMask API function bitmask
|
|
242
|
+ * @ret s_PXENV_FILE_API_CHECK::Flags Reserved
|
|
243
|
+ *
|
|
244
|
+ */
|
|
245
|
+PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check ) {
|
|
246
|
+ DBG ( "PXENV_FILE_API_CHECK" );
|
|
247
|
+
|
|
248
|
+ if ( file_api_check->Magic != 0x91d447b2 ) {
|
|
249
|
+ file_api_check->Status = PXENV_STATUS_BAD_FUNC;
|
|
250
|
+ return PXENV_EXIT_FAILURE;
|
|
251
|
+ } else if ( file_api_check->Size <
|
|
252
|
+ sizeof(struct s_PXENV_FILE_API_CHECK) ) {
|
|
253
|
+ file_api_check->Status = PXENV_STATUS_OUT_OF_RESOURCES;
|
|
254
|
+ return PXENV_EXIT_FAILURE;
|
|
255
|
+ } else {
|
|
256
|
+ file_api_check->Status = PXENV_STATUS_SUCCESS;
|
|
257
|
+ file_api_check->Size = sizeof(struct s_PXENV_FILE_API_CHECK);
|
|
258
|
+ file_api_check->Magic = 0xe9c17b20;
|
|
259
|
+ file_api_check->Provider = 0x45585067; /* "gPXE" */
|
|
260
|
+ file_api_check->APIMask = 0x0000007f; /* Functions e0-e6 */
|
|
261
|
+ file_api_check->Flags = 0; /* None defined */
|
|
262
|
+ return PXENV_EXIT_SUCCESS;
|
|
263
|
+ }
|
|
264
|
+}
|