OpenOCD
|
Go to the source code of this file.
Macros | |
#define | ERROR_FILEIO_ACCESS_NOT_SUPPORTED (-1203) |
#define | ERROR_FILEIO_LOCATION_UNKNOWN (-1200) |
#define | ERROR_FILEIO_NOT_FOUND (-1201) |
#define | ERROR_FILEIO_OPERATION_FAILED (-1202) |
#define | ERROR_FILEIO_OPERATION_NOT_SUPPORTED (-1205) |
#define | ERROR_FILEIO_RESOURCE_TYPE_UNKNOWN (-1204) |
#define | FILEIO_MAX_ERROR_STRING (128) |
Enumerations | |
enum | fileio_access { FILEIO_NONE , FILEIO_READ , FILEIO_WRITE , FILEIO_READWRITE , FILEIO_APPEND , FILEIO_APPENDREAD } |
enum | fileio_type { FILEIO_TEXT , FILEIO_BINARY } |
Functions | |
int | fileio_close (struct fileio *fileio) |
int | fileio_feof (struct fileio *fileio) |
int | fileio_fgets (struct fileio *fileio, size_t size, void *buffer) |
int | fileio_open (struct fileio **fileio, const char *url, enum fileio_access access_type, enum fileio_type type) |
int | fileio_read (struct fileio *fileio, size_t size, void *buffer, size_t *size_read) |
int | fileio_read_u32 (struct fileio *fileio, uint32_t *data) |
int | fileio_seek (struct fileio *fileio, size_t position) |
int | fileio_size (struct fileio *fileio, size_t *size) |
FIX!!!! More... | |
int | fileio_write (struct fileio *fileio, size_t size, const void *buffer, size_t *size_written) |
int | fileio_write_u32 (struct fileio *fileio, uint32_t data) |
#define ERROR_FILEIO_ACCESS_NOT_SUPPORTED (-1203) |
Definition at line 57 of file helper/fileio.h.
#define ERROR_FILEIO_LOCATION_UNKNOWN (-1200) |
Definition at line 54 of file helper/fileio.h.
#define ERROR_FILEIO_NOT_FOUND (-1201) |
Definition at line 55 of file helper/fileio.h.
#define ERROR_FILEIO_OPERATION_FAILED (-1202) |
Definition at line 56 of file helper/fileio.h.
#define ERROR_FILEIO_OPERATION_NOT_SUPPORTED (-1205) |
Definition at line 59 of file helper/fileio.h.
#define ERROR_FILEIO_RESOURCE_TYPE_UNKNOWN (-1204) |
Definition at line 58 of file helper/fileio.h.
#define FILEIO_MAX_ERROR_STRING (128) |
Definition at line 19 of file helper/fileio.h.
enum fileio_access |
Enumerator | |
---|---|
FILEIO_NONE | |
FILEIO_READ | |
FILEIO_WRITE | |
FILEIO_READWRITE | |
FILEIO_APPEND | |
FILEIO_APPENDREAD |
Definition at line 26 of file helper/fileio.h.
enum fileio_type |
Enumerator | |
---|---|
FILEIO_TEXT | |
FILEIO_BINARY |
Definition at line 21 of file helper/fileio.h.
int fileio_close | ( | struct fileio * | fileio | ) |
Definition at line 134 of file helper/fileio.c.
References fileio_close_local(), and fileio::url.
Referenced by autodetect_image_type(), COMMAND_HANDLER(), esirisc_trace_dump(), image_close(), image_open(), and nand_fileio_cleanup().
int fileio_feof | ( | struct fileio * | fileio | ) |
Definition at line 146 of file helper/fileio.c.
References fileio::file.
Referenced by image_ihex_buffer_complete_inner(), and image_mot_buffer_complete_inner().
int fileio_fgets | ( | struct fileio * | fileio, |
size_t | size, | ||
void * | buffer | ||
) |
Definition at line 206 of file helper/fileio.c.
References buffer, fileio_local_fgets(), and size.
Referenced by image_ihex_buffer_complete_inner(), and image_mot_buffer_complete_inner().
int fileio_open | ( | struct fileio ** | fileio, |
const char * | url, | ||
enum fileio_access | access_type, | ||
enum fileio_type | type | ||
) |
Definition at line 109 of file helper/fileio.c.
References fileio::access, ERROR_OK, fileio_open_local(), fileio::type, type, and fileio::url.
Referenced by autodetect_image_type(), COMMAND_HANDLER(), esirisc_trace_dump(), image_open(), and nand_fileio_start().
int fileio_read | ( | struct fileio * | fileio, |
size_t | size, | ||
void * | buffer, | ||
size_t * | size_read | ||
) |
Definition at line 176 of file helper/fileio.c.
References buffer, fileio_local_read(), and size.
Referenced by autodetect_image_type(), COMMAND_HANDLER(), image_elf32_read_headers(), image_elf32_read_section(), image_elf64_read_headers(), image_elf64_read_section(), image_elf_read_headers(), image_read_section(), and nand_fileio_read().
int fileio_read_u32 | ( | struct fileio * | fileio, |
uint32_t * | data | ||
) |
Definition at line 182 of file helper/fileio.c.
References be_to_h_u32(), ERROR_OK, and fileio_local_read().
Referenced by COMMAND_HANDLER().
int fileio_seek | ( | struct fileio * | fileio, |
size_t | position | ||
) |
Definition at line 151 of file helper/fileio.c.
References ERROR_FILEIO_OPERATION_FAILED, ERROR_OK, fileio::file, LOG_ERROR, and fileio::url.
Referenced by image_elf32_read_headers(), image_elf32_read_section(), image_elf64_read_headers(), image_elf64_read_section(), and image_read_section().
int fileio_size | ( | struct fileio * | fileio, |
size_t * | size | ||
) |
FIX!!!!
For now this can not fail, but that's because a seek was executed on startup.
Avoiding the seek on startup opens up for using streams.
Definition at line 259 of file helper/fileio.c.
References ERROR_OK, fileio::size, and size.
Referenced by COMMAND_HANDLER(), COMMAND_HELPER(), image_ihex_buffer_complete_inner(), image_mot_buffer_complete_inner(), and image_open().
int fileio_write | ( | struct fileio * | fileio, |
size_t | size, | ||
const void * | buffer, | ||
size_t * | size_written | ||
) |
Definition at line 222 of file helper/fileio.c.
References buffer, ERROR_OK, fileio_local_write(), fileio::size, and size.
Referenced by COMMAND_HANDLER(), esirisc_trace_dump(), and fileio_write_u32().
int fileio_write_u32 | ( | struct fileio * | fileio, |
uint32_t | data | ||
) |
Definition at line 235 of file helper/fileio.c.
References ERROR_OK, fileio_write(), and h_u32_to_be().
Referenced by COMMAND_HANDLER().