diff options
Diffstat (limited to 'include/pxe_utils.h')
-rw-r--r-- | include/pxe_utils.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/pxe_utils.h b/include/pxe_utils.h index 8b50f2e6861..194a5ed8cc7 100644 --- a/include/pxe_utils.h +++ b/include/pxe_utils.h @@ -77,7 +77,7 @@ struct pxe_menu { struct pxe_context; typedef int (*pxe_getfile_func)(struct pxe_context *ctx, const char *file_path, - char *file_addr); + char *file_addr, ulong *filesizep); /** * struct pxe_context - context information for PXE parsing @@ -88,6 +88,7 @@ typedef int (*pxe_getfile_func)(struct pxe_context *ctx, const char *file_path, * @allow_abs_path: true to allow absolute paths * @bootdir: Directory that files are loaded from ("" if no directory). This is * allocated + * @pxe_file_size: Size of the PXE file */ struct pxe_context { struct cmd_tbl *cmdtp; @@ -98,6 +99,7 @@ struct pxe_context { * @file_path: Path to the file * @file_addr: String containing the hex address to put the file in * memory + * @filesizep: Returns the file size in bytes * Return 0 if OK, -ve on error */ pxe_getfile_func getfile; @@ -105,6 +107,7 @@ struct pxe_context { void *userdata; bool allow_abs_path; char *bootdir; + ulong pxe_file_size; }; /** @@ -225,4 +228,12 @@ void pxe_destroy_ctx(struct pxe_context *ctx); */ int pxe_process(struct pxe_context *ctx, ulong pxefile_addr_r, bool prompt); +/** + * pxe_get_file_size() - Read the value of the 'filesize' environment variable + * + * @sizep: Place to put the value + * @return 0 if OK, -ENOENT if no such variable, -EINVAL if format is invalid + */ +int pxe_get_file_size(ulong *sizep); + #endif /* __PXE_UTILS_H */ |