PXENV_FILE_READ
[PXE FILE API]

FILE READ. More...


Data Structures

struct  s_PXENV_FILE_READ
 Parameter block for pxenv_file_read(). More...

Defines

#define PXENV_FILE_READ   0x00e3
 PXE API function code for pxenv_file_read().

Typedefs

typedef struct s_PXENV_FILE_READ PXENV_FILE_READ_t

Functions

PXENV_EXIT_t pxenv_file_read (struct s_PXENV_FILE_READ *file_read)
 FILE READ.


Detailed Description

FILE READ.

Define Documentation

#define PXENV_FILE_READ   0x00e3

PXE API function code for pxenv_file_read().

Definition at line 1693 of file pxe_api.h.

Referenced by pxe_api_call().


Typedef Documentation

Definition at line 1703 of file pxe_api.h.


Function Documentation

PXENV_EXIT_t pxenv_file_read ( struct s_PXENV_FILE_READ file_read  ) 

FILE READ.

Parameters:
file_read Pointer to a struct s_PXENV_FILE_READ
s_PXENV_FILE_READ::FileHandle File handle
s_PXENV_FILE_READ::BufferSize Size of data buffer
s_PXENV_FILE_READ::Buffer Data buffer
Return values:
PXENV_EXIT_SUCCESS Data has been read from file
PXENV_EXIT_FAILURE Data has not been read from file
s_PXENV_FILE_READ::Status PXE status code
s_PXENV_FILE_READ::Ready Indication of readiness
s_PXENV_FILE_READ::BufferSize Length of data read

Definition at line 146 of file pxe_file.c.

References s_PXENV_FILE_READ::Buffer, s_PXENV_FILE_READ::BufferSize, DBG, s_PXENV_FILE_READ::FileHandle, s_SEGOFF16::offset, PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, PXENV_STATUS_SUCCESS, read_user(), real_to_user(), s_SEGOFF16::segment, and s_PXENV_FILE_READ::Status.

Referenced by pxe_api_call().

00146                                                                      {
00147         userptr_t buffer;
00148         ssize_t len;
00149 
00150         DBG ( "PXENV_FILE_READ %d to %04x:%04x+%04x", file_read->FileHandle,
00151               file_read->Buffer.segment, file_read->Buffer.offset,
00152               file_read->BufferSize );
00153 
00154         buffer = real_to_user ( file_read->Buffer.segment,
00155                                 file_read->Buffer.offset );
00156         if ( ( len = read_user ( file_read->FileHandle, buffer, 0,
00157                                 file_read->BufferSize ) ) < 0 ) {
00158                 file_read->Status = PXENV_STATUS ( len );
00159                 return PXENV_EXIT_FAILURE;
00160         }
00161 
00162         DBG ( " read %04zx", ( ( size_t ) len ) );
00163 
00164         file_read->BufferSize = len;
00165         file_read->Status = PXENV_STATUS_SUCCESS;
00166         return PXENV_EXIT_SUCCESS;
00167 }


Generated on Tue Apr 6 20:01:59 2010 for gPXE by  doxygen 1.5.7.1