iPXE
Functions | Variables
pxe_file.c File Reference

PXE FILE API. More...

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <byteswap.h>
#include <ipxe/uaccess.h>
#include <ipxe/posix_io.h>
#include <ipxe/features.h>
#include <pxe.h>
#include <realmode.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
 FEATURE (FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 2)
 
static PXENV_EXIT_t pxenv_file_open (struct s_PXENV_FILE_OPEN *file_open)
 FILE OPEN. More...
 
static PXENV_EXIT_t pxenv_file_close (struct s_PXENV_FILE_CLOSE *file_close)
 FILE CLOSE. More...
 
static PXENV_EXIT_t pxenv_file_select (struct s_PXENV_FILE_SELECT *file_select)
 FILE SELECT. More...
 
static PXENV_EXIT_t pxenv_file_read (struct s_PXENV_FILE_READ *file_read)
 FILE READ. More...
 
static PXENV_EXIT_t pxenv_get_file_size (struct s_PXENV_GET_FILE_SIZE *get_file_size)
 GET FILE SIZE. More...
 
static PXENV_EXIT_t pxenv_file_exec (struct s_PXENV_FILE_EXEC *file_exec)
 FILE EXEC. More...
 
static PXENV_EXIT_t pxenv_file_cmdline (struct s_PXENV_FILE_CMDLINE *file_cmdline)
 FILE CMDLINE. More...
 
static PXENV_EXIT_t pxenv_file_api_check (struct s_PXENV_FILE_API_CHECK *file_api_check)
 FILE API CHECK. More...
 

Variables

struct pxe_api_call pxe_file_api [] __pxe_api_call
 PXE file API. More...
 

Detailed Description

PXE FILE API.

Definition in file pxe_file.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ FEATURE()

FEATURE ( FEATURE_MISC  ,
"PXEXT"  ,
DHCP_EB_FEATURE_PXE_EXT  ,
 
)

◆ pxenv_file_open()

static PXENV_EXIT_t pxenv_file_open ( struct s_PXENV_FILE_OPEN file_open)
static

FILE OPEN.

Parameters
file_openPointer to a struct s_PXENV_FILE_OPEN
s_PXENV_FILE_OPEN::FileNameURL of file to open
Return values
PXENV_EXIT_SUCCESSFile was opened
PXENV_EXIT_FAILUREFile was not opened
s_PXENV_FILE_OPEN::StatusPXE status code
s_PXENV_FILE_OPEN::FileHandleHandle of opened file

Definition at line 55 of file pxe_file.c.

55  {
56  userptr_t filename;
57  size_t filename_len;
58  int fd;
59 
60  DBG ( "PXENV_FILE_OPEN" );
61 
62  /* Copy name from external program, and open it */
63  filename = real_to_user ( file_open->FileName.segment,
64  file_open->FileName.offset );
65  filename_len = strlen_user ( filename, 0 );
66  {
67  char uri_string[ filename_len + 1 ];
68 
69  copy_from_user ( uri_string, filename, 0,
70  sizeof ( uri_string ) );
71  DBG ( " %s", uri_string );
72  fd = open ( uri_string );
73  }
74 
75  if ( fd < 0 ) {
76  file_open->Status = PXENV_STATUS ( fd );
77  return PXENV_EXIT_FAILURE;
78  }
79 
80  DBG ( " as file %d", fd );
81 
82  file_open->FileHandle = fd;
84  return PXENV_EXIT_SUCCESS;
85 }
#define PXENV_EXIT_FAILURE
An error occurred.
Definition: pxe_types.h:46
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
Definition: uaccess.h:337
int file_open(const char *filename)
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
size_t strlen_user(userptr_t userptr, off_t offset)
Find length of NUL-terminated string in user buffer.
int open(const char *uri_string)
Open file.
Definition: posix_io.c:176
static __always_inline userptr_t real_to_user(unsigned int segment, unsigned int offset)
Convert segment:offset address to user buffer.
Definition: realmode.h:75
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define PXENV_STATUS(rc)
Derive PXENV_STATUS code from iPXE error number.
Definition: pxe_error.h:121
unsigned long userptr_t
A pointer to a user buffer.
Definition: uaccess.h:33

References copy_from_user(), DBG, file_open(), open(), PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, real_to_user(), and strlen_user().

◆ pxenv_file_close()

static PXENV_EXIT_t pxenv_file_close ( struct s_PXENV_FILE_CLOSE file_close)
static

FILE CLOSE.

Parameters
file_closePointer to a struct s_PXENV_FILE_CLOSE
s_PXENV_FILE_CLOSE::FileHandleFile handle
Return values
PXENV_EXIT_SUCCESSFile was closed
PXENV_EXIT_FAILUREFile was not closed
s_PXENV_FILE_CLOSE::StatusPXE status code

Definition at line 97 of file pxe_file.c.

97  {
98 
99  DBG ( "PXENV_FILE_CLOSE %d", file_close->FileHandle );
100 
101  close ( file_close->FileHandle );
102  file_close->Status = PXENV_STATUS_SUCCESS;
103  return PXENV_EXIT_SUCCESS;
104 }
UINT16_t FileHandle
File handle.
Definition: pxe_api.h:1560
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:1559
static struct evtchn_close * close
Definition: xenevent.h:23
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498

References close, DBG, s_PXENV_FILE_CLOSE::FileHandle, PXENV_EXIT_SUCCESS, PXENV_STATUS_SUCCESS, and s_PXENV_FILE_CLOSE::Status.

◆ pxenv_file_select()

static PXENV_EXIT_t pxenv_file_select ( struct s_PXENV_FILE_SELECT file_select)
static

FILE SELECT.

Parameters
file_selectPointer to a struct s_PXENV_FILE_SELECT
s_PXENV_FILE_SELECT::FileHandleFile handle
Return values
PXENV_EXIT_SUCCESSFile has been checked for readiness
PXENV_EXIT_FAILUREFile has not been checked for readiness
s_PXENV_FILE_SELECT::StatusPXE status code
s_PXENV_FILE_SELECT::ReadyIndication of readiness

Definition at line 118 of file pxe_file.c.

118  {
119  fd_set fdset;
120  int ready;
121 
122  DBG ( "PXENV_FILE_SELECT %d", file_select->FileHandle );
123 
124  FD_ZERO ( &fdset );
125  FD_SET ( file_select->FileHandle, &fdset );
126  if ( ( ready = select ( &fdset, 0 ) ) < 0 ) {
127  file_select->Status = PXENV_STATUS ( ready );
128  return PXENV_EXIT_FAILURE;
129  }
130 
131  file_select->Ready = ( ready ? RDY_READ : 0 );
132  file_select->Status = PXENV_STATUS_SUCCESS;
133  return PXENV_EXIT_SUCCESS;
134 }
#define RDY_READ
File is ready for reading.
Definition: pxe_api.h:1578
#define PXENV_EXIT_FAILURE
An error occurred.
Definition: pxe_types.h:46
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:1582
UINT16_t Ready
Indication of readiness.
Definition: pxe_api.h:1584
UINT16_t FileHandle
File handle.
Definition: pxe_api.h:1583
uint32_t fd_set
File descriptor set as used for select()
Definition: posix_io.h:22
int select(fd_set *readfds, int wait)
Check file descriptors for readiness.
Definition: posix_io.c:229
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define PXENV_STATUS(rc)
Derive PXENV_STATUS code from iPXE error number.
Definition: pxe_error.h:121

References DBG, s_PXENV_FILE_SELECT::FileHandle, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, RDY_READ, s_PXENV_FILE_SELECT::Ready, select(), and s_PXENV_FILE_SELECT::Status.

◆ pxenv_file_read()

static PXENV_EXIT_t pxenv_file_read ( struct s_PXENV_FILE_READ file_read)
static

FILE READ.

Parameters
file_readPointer to a struct s_PXENV_FILE_READ
s_PXENV_FILE_READ::FileHandleFile handle
s_PXENV_FILE_READ::BufferSizeSize of data buffer
s_PXENV_FILE_READ::BufferData buffer
Return values
PXENV_EXIT_SUCCESSData has been read from file
PXENV_EXIT_FAILUREData has not been read from file
s_PXENV_FILE_READ::StatusPXE status code
s_PXENV_FILE_READ::ReadyIndication of readiness
s_PXENV_FILE_READ::BufferSizeLength of data read

Definition at line 150 of file pxe_file.c.

150  {
152  ssize_t len;
153 
154  DBG ( "PXENV_FILE_READ %d to %04x:%04x+%04x", file_read->FileHandle,
155  file_read->Buffer.segment, file_read->Buffer.offset,
156  file_read->BufferSize );
157 
158  buffer = real_to_user ( file_read->Buffer.segment,
159  file_read->Buffer.offset );
160  if ( ( len = read_user ( file_read->FileHandle, buffer, 0,
161  file_read->BufferSize ) ) < 0 ) {
162  file_read->Status = PXENV_STATUS ( len );
163  return PXENV_EXIT_FAILURE;
164  }
165 
166  DBG ( " read %04zx", ( ( size_t ) len ) );
167 
168  file_read->BufferSize = len;
170  return PXENV_EXIT_SUCCESS;
171 }
#define PXENV_EXIT_FAILURE
An error occurred.
Definition: pxe_types.h:46
ssize_t read_user(int fd, userptr_t buffer, off_t offset, size_t max_len)
Read data from file.
Definition: posix_io.c:265
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition: netvsc.h:16
int file_read(void *buf, unsigned long len)
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
uint32_t len
Length.
Definition: ena.h:14
static __always_inline userptr_t real_to_user(unsigned int segment, unsigned int offset)
Convert segment:offset address to user buffer.
Definition: realmode.h:75
signed long ssize_t
Definition: stdint.h:7
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define PXENV_STATUS(rc)
Derive PXENV_STATUS code from iPXE error number.
Definition: pxe_error.h:121
unsigned long userptr_t
A pointer to a user buffer.
Definition: uaccess.h:33

References buffer, DBG, file_read(), len, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, read_user(), and real_to_user().

◆ pxenv_get_file_size()

static PXENV_EXIT_t pxenv_get_file_size ( struct s_PXENV_GET_FILE_SIZE get_file_size)
static

GET FILE SIZE.

Parameters
get_file_sizePointer to a struct s_PXENV_GET_FILE_SIZE
s_PXENV_GET_FILE_SIZE::FileHandleFile handle
Return values
PXENV_EXIT_SUCCESSFile size has been determined
PXENV_EXIT_FAILUREFile size has not been determined
s_PXENV_GET_FILE_SIZE::StatusPXE status code
s_PXENV_GET_FILE_SIZE::FileSizeSize of file

Definition at line 184 of file pxe_file.c.

184  {
185  ssize_t filesize;
186 
187  DBG ( "PXENV_GET_FILE_SIZE %d", get_file_size->FileHandle );
188 
189  filesize = fsize ( get_file_size->FileHandle );
190  if ( filesize < 0 ) {
191  get_file_size->Status = PXENV_STATUS ( filesize );
192  return PXENV_EXIT_FAILURE;
193  }
194 
195  DBG ( " is %zd", ( ( size_t ) filesize ) );
196 
197  get_file_size->FileSize = filesize;
198  get_file_size->Status = PXENV_STATUS_SUCCESS;
199  return PXENV_EXIT_SUCCESS;
200 }
#define PXENV_EXIT_FAILURE
An error occurred.
Definition: pxe_types.h:46
UINT16_t FileHandle
File handle.
Definition: pxe_api.h:1626
ssize_t fsize(int fd)
Determine file size.
Definition: posix_io.c:311
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:1625
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
UINT32_t FileSize
File size.
Definition: pxe_api.h:1627
signed long ssize_t
Definition: stdint.h:7
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define PXENV_STATUS(rc)
Derive PXENV_STATUS code from iPXE error number.
Definition: pxe_error.h:121

References DBG, s_PXENV_GET_FILE_SIZE::FileHandle, s_PXENV_GET_FILE_SIZE::FileSize, fsize(), PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, and s_PXENV_GET_FILE_SIZE::Status.

◆ pxenv_file_exec()

static PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC file_exec)
static

FILE EXEC.

Parameters
file_execPointer to a struct s_PXENV_FILE_EXEC
s_PXENV_FILE_EXEC::CommandCommand to execute
Return values
PXENV_EXIT_SUCCESSCommand was executed successfully
PXENV_EXIT_FAILURECommand was not executed successfully
s_PXENV_FILE_EXEC::StatusPXE status code

Definition at line 212 of file pxe_file.c.

212  {
214  size_t command_len;
215  int rc;
216 
217  DBG ( "PXENV_FILE_EXEC" );
218 
219  /* Copy name from external program, and exec it */
220  command = real_to_user ( file_exec->Command.segment,
221  file_exec->Command.offset );
223  {
224  char command_string[ command_len + 1 ];
225 
226  copy_from_user ( command_string, command, 0,
227  sizeof ( command_string ) );
228  DBG ( " %s", command_string );
229 
230  if ( ( rc = system ( command_string ) ) != 0 ) {
231  file_exec->Status = PXENV_STATUS ( rc );
232  return PXENV_EXIT_FAILURE;
233  }
234  }
235 
236  file_exec->Status = PXENV_STATUS_SUCCESS;
237  return PXENV_EXIT_SUCCESS;
238 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
device command_len
Definition: threewire.h:59
#define PXENV_EXIT_FAILURE
An error occurred.
Definition: pxe_types.h:46
A command-line command.
Definition: command.h:9
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
Definition: uaccess.h:337
SEGOFF16_t Command
Command to execute.
Definition: pxe_api.h:1647
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
size_t strlen_user(userptr_t userptr, off_t offset)
Find length of NUL-terminated string in user buffer.
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:1646
static __always_inline userptr_t real_to_user(unsigned int segment, unsigned int offset)
Convert segment:offset address to user buffer.
Definition: realmode.h:75
uint8_t command
Command.
Definition: intel.h:18
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define PXENV_STATUS(rc)
Derive PXENV_STATUS code from iPXE error number.
Definition: pxe_error.h:121
unsigned long userptr_t
A pointer to a user buffer.
Definition: uaccess.h:33
uint8_t system[ETH_ALEN]
System identifier.
Definition: eth_slow.h:24

References command, s_PXENV_FILE_EXEC::Command, command_len, copy_from_user(), DBG, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, rc, real_to_user(), s_PXENV_FILE_EXEC::Status, strlen_user(), and system.

◆ pxenv_file_cmdline()

static PXENV_EXIT_t pxenv_file_cmdline ( struct s_PXENV_FILE_CMDLINE file_cmdline)
static

FILE CMDLINE.

Parameters
file_cmdlinePointer to a struct s_PXENV_FILE_CMDLINE
s_PXENV_FILE_CMDLINE::BufferBuffer to contain command line
s_PXENV_FILE_CMDLINE::BufferSizeSize of buffer
Return values
PXENV_EXIT_SUCCESSCommand was executed successfully
PXENV_EXIT_FAILURECommand was not executed successfully
s_PXENV_FILE_EXEC::StatusPXE status code
s_PXENV_FILE_EXEC::BufferSizeLength of command line (including NUL)

Definition at line 253 of file pxe_file.c.

253  {
255  size_t max_len;
256  size_t len;
257 
258  DBG ( "PXENV_FILE_CMDLINE to %04x:%04x+%04x \"%s\"\n",
259  file_cmdline->Buffer.segment, file_cmdline->Buffer.offset,
260  file_cmdline->BufferSize, pxe_cmdline );
261 
262  buffer = real_to_user ( file_cmdline->Buffer.segment,
263  file_cmdline->Buffer.offset );
264  len = file_cmdline->BufferSize;
265  max_len = ( pxe_cmdline ?
266  ( strlen ( pxe_cmdline ) + 1 /* NUL */ ) : 0 );
267  if ( len > max_len )
268  len = max_len;
270  file_cmdline->BufferSize = max_len;
271 
272  file_cmdline->Status = PXENV_STATUS_SUCCESS;
273  return PXENV_EXIT_SUCCESS;
274 }
SEGOFF16_t Buffer
Data buffer.
Definition: pxe_api.h:1712
UINT16_t BufferSize
Data buffer size.
Definition: pxe_api.h:1711
static void size_t size_t max_len
Definition: entropy.h:153
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:1710
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition: netvsc.h:16
const char * pxe_cmdline
PXE command line.
Definition: pxe_image.c:48
static __always_inline void copy_to_user(userptr_t dest, off_t dest_off, const void *src, size_t len)
Copy data to user buffer.
Definition: uaccess.h:324
size_t strlen(const char *src)
Get length of string.
Definition: string.c:228
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
uint32_t len
Length.
Definition: ena.h:14
static __always_inline userptr_t real_to_user(unsigned int segment, unsigned int offset)
Convert segment:offset address to user buffer.
Definition: realmode.h:75
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
unsigned long userptr_t
A pointer to a user buffer.
Definition: uaccess.h:33

References buffer, s_PXENV_FILE_CMDLINE::Buffer, s_PXENV_FILE_CMDLINE::BufferSize, copy_to_user(), DBG, len, max_len, pxe_cmdline, PXENV_EXIT_SUCCESS, PXENV_STATUS_SUCCESS, real_to_user(), s_PXENV_FILE_CMDLINE::Status, and strlen().

◆ pxenv_file_api_check()

static PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK file_api_check)
static

FILE API CHECK.

Parameters
file_execPointer to a struct s_PXENV_FILE_API_CHECK
s_PXENV_FILE_API_CHECK::MagicInbound magic number (0x91d447b2)
Return values
PXENV_EXIT_SUCCESSCommand was executed successfully
PXENV_EXIT_FAILURECommand was not executed successfully
s_PXENV_FILE_API_CHECK::StatusPXE status code
s_PXENV_FILE_API_CHECK::MagicOutbound magic number (0xe9c17b20)
s_PXENV_FILE_API_CHECK::Provider"iPXE" (0x45585067)
s_PXENV_FILE_API_CHECK::APIMaskAPI function bitmask
s_PXENV_FILE_API_CHECK::FlagsReserved

Definition at line 291 of file pxe_file.c.

291  {
292  struct pxe_api_call *call;
293  unsigned int mask = 0;
294  unsigned int offset;
295 
296  DBG ( "PXENV_FILE_API_CHECK" );
297 
298  /* Check for magic value */
299  if ( file_api_check->Magic != 0x91d447b2 ) {
300  file_api_check->Status = PXENV_STATUS_BAD_FUNC;
301  return PXENV_EXIT_FAILURE;
302  }
303 
304  /* Check for required parameter size */
305  if ( file_api_check->Size < sizeof ( *file_api_check ) ) {
306  file_api_check->Status = PXENV_STATUS_OUT_OF_RESOURCES;
307  return PXENV_EXIT_FAILURE;
308  }
309 
310  /* Determine supported calls */
312  offset = ( call->opcode - PXENV_FILE_MIN );
313  if ( offset <= ( PXENV_FILE_MAX - PXENV_FILE_MIN ) )
314  mask |= ( 1 << offset );
315  }
316 
317  /* Fill in parameters */
318  file_api_check->Size = sizeof ( *file_api_check );
319  file_api_check->Magic = 0xe9c17b20;
320  file_api_check->Provider = 0x45585067; /* "iPXE" */
321  file_api_check->APIMask = mask;
322  file_api_check->Flags = 0; /* None defined */
323 
324  file_api_check->Status = PXENV_STATUS_SUCCESS;
325  return PXENV_EXIT_SUCCESS;
326 }
#define PXENV_STATUS_OUT_OF_RESOURCES
Definition: pxe_error.h:25
#define PXENV_EXIT_FAILURE
An error occurred.
Definition: pxe_types.h:46
UINT32_t Provider
Implementation identifier.
Definition: pxe_api.h:1669
#define PXENV_STATUS_BAD_FUNC
Definition: pxe_error.h:21
PXENV_STATUS_t Status
PXE status code.
Definition: pxe_api.h:1666
UINT32_t Flags
Reserved for the future.
Definition: pxe_api.h:1671
#define PXE_API_CALLS
PXE API call table.
Definition: pxe.h:95
static userptr_t size_t offset
Offset of the first segment within the content.
Definition: deflate.h:259
UINT32_t Magic
Magic number.
Definition: pxe_api.h:1668
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
Definition: tables.h:358
uint16_t opcode
Opcode.
Definition: pxe.h:91
#define PXENV_EXIT_SUCCESS
No error occurred.
Definition: pxe_types.h:45
UINT32_t APIMask
Supported API functions.
Definition: pxe_api.h:1670
A PXE API call.
Definition: pxe.h:81
UINT16_t Size
Size of structure.
Definition: pxe_api.h:1667
#define PXENV_FILE_MAX
Minimum possible opcode used within PXE FILE API.
Definition: pxe_api.h:1523
#define PXENV_FILE_MIN
Minimum possible opcode used within PXE FILE API.
Definition: pxe_api.h:1520
#define PXENV_STATUS_SUCCESS
Definition: pxe_error.h:19
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498

References s_PXENV_FILE_API_CHECK::APIMask, DBG, s_PXENV_FILE_API_CHECK::Flags, for_each_table_entry, s_PXENV_FILE_API_CHECK::Magic, offset, pxe_api_call::opcode, s_PXENV_FILE_API_CHECK::Provider, PXE_API_CALLS, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_FILE_MAX, PXENV_FILE_MIN, PXENV_STATUS_BAD_FUNC, PXENV_STATUS_OUT_OF_RESOURCES, PXENV_STATUS_SUCCESS, s_PXENV_FILE_API_CHECK::Size, and s_PXENV_FILE_API_CHECK::Status.

Variable Documentation

◆ __pxe_api_call

struct pxe_api_call pxe_file_api [] __pxe_api_call
Initial value:
= {
}
#define PXENV_FILE_CMDLINE
PXE API function code for pxenv_file_cmdline()
Definition: pxe_api.h:1706
#define PXENV_FILE_SELECT
PXE API function code for pxenv_file_select()
Definition: pxe_api.h:1575
#define PXENV_FILE_READ
PXE API function code for pxenv_file_read()
Definition: pxe_api.h:1599
static PXENV_EXIT_t pxenv_file_api_check(struct s_PXENV_FILE_API_CHECK *file_api_check)
FILE API CHECK.
Definition: pxe_file.c:291
static PXENV_EXIT_t pxenv_file_open(struct s_PXENV_FILE_OPEN *file_open)
FILE OPEN.
Definition: pxe_file.c:55
static PXENV_EXIT_t pxenv_file_select(struct s_PXENV_FILE_SELECT *file_select)
FILE SELECT.
Definition: pxe_file.c:118
#define PXENV_FILE_CLOSE
PXE API function code for pxenv_file_close()
Definition: pxe_api.h:1555
Parameter block for pxenv_file_close()
Definition: pxe_api.h:1558
#define PXENV_GET_FILE_SIZE
PXE API function code for pxenv_get_file_size()
Definition: pxe_api.h:1621
#define PXENV_FILE_API_CHECK
PXE API function code for pxenv_file_api_check()
Definition: pxe_api.h:1662
#define PXE_API_CALL(_opcode, _entry, _params_type)
Define a PXE API call.
Definition: pxe.h:108
Parameter block for pxenv_file_api_check()
Definition: pxe_api.h:1665
static PXENV_EXIT_t pxenv_file_close(struct s_PXENV_FILE_CLOSE *file_close)
FILE CLOSE.
Definition: pxe_file.c:97
Parameter block for pxenv_file_select()
Definition: pxe_api.h:1581
#define PXENV_FILE_EXEC
PXE API function code for pxenv_file_exec()
Definition: pxe_api.h:1642
Parameter block for pxenv_get_file_size()
Definition: pxe_api.h:1624
Parameter block for pxenv_file_exec()
Definition: pxe_api.h:1645
static PXENV_EXIT_t pxenv_file_exec(struct s_PXENV_FILE_EXEC *file_exec)
FILE EXEC.
Definition: pxe_file.c:212
Parameter block for pxenv_file_cmdline()
Definition: pxe_api.h:1709
static PXENV_EXIT_t pxenv_file_read(struct s_PXENV_FILE_READ *file_read)
FILE READ.
Definition: pxe_file.c:150
Parameter block for pxenv_file_open()
Definition: pxe_api.h:1536
#define PXENV_FILE_OPEN
PXE API function code for pxenv_file_open()
Definition: pxe_api.h:1533
Parameter block for pxenv_file_read()
Definition: pxe_api.h:1602
static PXENV_EXIT_t pxenv_get_file_size(struct s_PXENV_GET_FILE_SIZE *get_file_size)
GET FILE SIZE.
Definition: pxe_file.c:184
static PXENV_EXIT_t pxenv_file_cmdline(struct s_PXENV_FILE_CMDLINE *file_cmdline)
FILE CMDLINE.
Definition: pxe_file.c:253

PXE file API.

Definition at line 329 of file pxe_file.c.