boot: Update pxe_getfile_func() to support reservation
In some cases we don't have a particular address to read into so would like one reserved. Adjust this function to support that. For now, sysbot_read_file() fails if the address is not provided. This will be resolved in a later patch. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -23,19 +23,20 @@ struct sysboot_info {
|
||||
};
|
||||
|
||||
static int sysboot_read_file(struct pxe_context *ctx, const char *file_path,
|
||||
char *file_addr, enum bootflow_img_t type,
|
||||
ulong *sizep)
|
||||
ulong *addrp, ulong align,
|
||||
enum bootflow_img_t type, ulong *sizep)
|
||||
{
|
||||
struct sysboot_info *info = ctx->userdata;
|
||||
loff_t len_read;
|
||||
ulong addr;
|
||||
int ret;
|
||||
|
||||
addr = simple_strtoul(file_addr, NULL, 16);
|
||||
if (!*addrp)
|
||||
return -ENOTSUPP;
|
||||
|
||||
ret = fs_set_blk_dev(info->ifname, info->dev_part_str, info->fstype);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = fs_legacy_read(file_path, addr, 0, 0, &len_read);
|
||||
ret = fs_legacy_read(file_path, *addrp, 0, 0, &len_read);
|
||||
if (ret)
|
||||
return ret;
|
||||
*sizep = len_read;
|
||||
|
||||
Reference in New Issue
Block a user