58 DBG (
"PXENV_FILE_OPEN" );
63 DBG (
" %s", filename );
64 fd =
open ( filename );
69 DBG (
" as file %d", fd );
115 if ( ( ready =
select ( &fdset, 0 ) ) < 0 ) {
143 DBG (
"PXENV_FILE_READ %d to %04x:%04x+%04x", file_read->
FileHandle,
148 file_read->
Buffer.offset );
155 DBG (
" read %04zx", ( (
size_t )
len ) );
179 if ( filesize < 0 ) {
184 DBG (
" is %zd", ( (
size_t ) filesize ) );
205 DBG (
"PXENV_FILE_EXEC" );
237 DBG (
"PXENV_FILE_CMDLINE to %04x:%04x+%04x \"%s\"\n",
238 file_cmdline->
Buffer.segment, file_cmdline->
Buffer.offset,
242 file_cmdline->
Buffer.offset );
272 unsigned int mask = 0;
275 DBG (
"PXENV_FILE_API_CHECK" );
278 if ( file_api_check->
Magic != 0x91d447b2 ) {
284 if ( file_api_check->
Size < sizeof ( *file_api_check ) ) {
297 file_api_check->
Size =
sizeof ( *file_api_check );
298 file_api_check->
Magic = 0xe9c17b20;
299 file_api_check->
Provider = 0x45585067;
300 file_api_check->
APIMask = mask;
301 file_api_check->
Flags = 0;
#define PXENV_FILE_CMDLINE
PXE API function code for pxenv_file_cmdline()
#define PXENV_STATUS_OUT_OF_RESOURCES
UINT16_t FileHandle
File handle.
struct option_descriptor read[1]
#define PXENV_FILE_SELECT
PXE API function code for pxenv_file_select()
struct arbelprm_rc_send_wqe rc
#define RDY_READ
File is ready for reading.
#define PXENV_EXIT_FAILURE
An error occurred.
UINT32_t Provider
Implementation identifier.
SEGOFF16_t Buffer
Data buffer.
UINT16_t BufferSize
Data buffer size.
UINT16_t FileHandle
File handle.
#define DHCP_EB_FEATURE_PXE_EXT
PXE API extensions.
#define PXENV_FILE_READ
PXE API function code for pxenv_file_read()
static PXENV_EXIT_t pxenv_file_api_check(struct s_PXENV_FILE_API_CHECK *file_api_check)
FILE API CHECK.
static PXENV_EXIT_t pxenv_file_open(struct s_PXENV_FILE_OPEN *file_open)
FILE OPEN.
static PXENV_EXIT_t pxenv_file_select(struct s_PXENV_FILE_SELECT *file_select)
FILE SELECT.
#define PXENV_FILE_CLOSE
PXE API function code for pxenv_file_close()
Parameter block for pxenv_file_close()
#define PXENV_GET_FILE_SIZE
PXE API function code for pxenv_get_file_size()
#define PXENV_STATUS_BAD_FUNC
PXENV_STATUS_t Status
PXE status code.
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
#define PXENV_FILE_API_CHECK
PXE API function code for pxenv_file_api_check()
PXENV_STATUS_t Status
PXE status code.
UINT16_t FileHandle
File handle.
PXENV_STATUS_t Status
PXE status code.
static __always_inline void * real_to_virt(unsigned int segment, unsigned int offset)
Convert segment:offset address to virtual address.
#define PXE_API_CALL(_opcode, _entry, _params_type)
Define a PXE API call.
Parameter block for pxenv_file_api_check()
static PXENV_EXIT_t pxenv_file_close(struct s_PXENV_FILE_CLOSE *file_close)
FILE CLOSE.
ssize_t fsize(int fd)
Determine file size.
Parameter block for pxenv_file_select()
UINT16_t PXENV_EXIT_t
A PXE exit code.
UINT32_t Flags
Reserved for the future.
#define PXENV_FILE_EXEC
PXE API function code for pxenv_file_exec()
#define PXE_API_CALLS
PXE API call table.
struct pxe_api_call pxe_file_api [] __pxe_api_call
PXE file API.
const char * pxe_cmdline
PXE command line.
Parameter block for pxenv_get_file_size()
UINT16_t Ready
Indication of readiness.
Parameter block for pxenv_file_exec()
SEGOFF16_t FileName
File URL.
UINT16_t FileHandle
File handle.
UINT32_t Magic
Magic number.
PXENV_STATUS_t Status
PXE status code.
uint32_t fd_set
File descriptor set as used for select()
#define FEATURE_MISC
Miscellaneous.
SEGOFF16_t Command
Command to execute.
FEATURE(FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 2)
static PXENV_EXIT_t pxenv_file_exec(struct s_PXENV_FILE_EXEC *file_exec)
FILE EXEC.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
int select(fd_set *readfds, int wait)
Check file descriptors for readiness.
Parameter block for pxenv_file_cmdline()
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define PXENV_EXIT_SUCCESS
No error occurred.
UINT32_t APIMask
Supported API functions.
static PXENV_EXIT_t pxenv_file_read(struct s_PXENV_FILE_READ *file_read)
FILE READ.
SEGOFF16_t Buffer
Data buffer.
Parameter block for pxenv_file_open()
UINT16_t FileHandle
File handle.
UINT16_t Size
Size of structure.
#define PXENV_FILE_MAX
Minimum possible opcode used within PXE FILE API.
PXENV_STATUS_t Status
PXE status code.
#define PXENV_FILE_OPEN
PXE API function code for pxenv_file_open()
UINT32_t FileSize
File size.
#define PXENV_FILE_MIN
Minimum possible opcode used within PXE FILE API.
int open(const char *uri_string)
Open file.
PXENV_STATUS_t Status
PXE status code.
PXENV_STATUS_t Status
PXE status code.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Parameter block for pxenv_file_read()
static struct evtchn_close * close
uint16_t offset
Offset to command line.
PXENV_STATUS_t Status
PXE status code.
#define PXENV_STATUS_SUCCESS
#define DBG(...)
Print a debugging message.
static PXENV_EXIT_t pxenv_get_file_size(struct s_PXENV_GET_FILE_SIZE *get_file_size)
GET FILE SIZE.
#define PXENV_STATUS(rc)
Derive PXENV_STATUS code from iPXE error number.
uint8_t system[ETH_ALEN]
System identifier.
static PXENV_EXIT_t pxenv_file_cmdline(struct s_PXENV_FILE_CMDLINE *file_cmdline)
FILE CMDLINE.
UINT16_t BufferSize
Data buffer size.