From: Simon Glass <simon.glass@canonical.com> Add a struct to hold information about files that need to be loaded for PXE boot. This allows the caller to load files without using callbacks, similar to how include files are handled. The new struct pxe_file contains: - path: file path to load - type: file type (kernel, initrd, fdt, fdtoverlay) - addr: address where file was loaded (filled by caller) - size: size of loaded file (filled by caller) Also add a files alist to pxe_label to hold the list of files needed for booting that label. For now this is unused. Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- include/pxe_utils.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/pxe_utils.h b/include/pxe_utils.h index f6ee0417a9b..2f194b91683 100644 --- a/include/pxe_utils.h +++ b/include/pxe_utils.h @@ -51,6 +51,7 @@ struct pxe_fdtoverlay { * @fdt: path to FDT to use * @fdtdir: path to FDT directory to use * @fdtoverlays: list of FDT overlays to apply (alist of struct pxe_fdtoverlay) + * @files: list of files to load (alist of struct pxe_file) * @say: message to print when this label is selected for booting * @ipappend: flags for appending IP address (0x1) and MAC address (0x3) * @attempted: 0 if we haven't tried to boot this label, 1 if we have @@ -71,6 +72,7 @@ struct pxe_label { char *fdt; char *fdtdir; struct alist fdtoverlays; + struct alist files; char *say; int ipappend; int attempted; @@ -93,6 +95,36 @@ struct pxe_include { int nest_level; }; +/** + * enum pxe_file_type_t - type of file to load for PXE boot + * + * @PFT_KERNEL: Kernel image + * @PFT_INITRD: Initial ramdisk + * @PFT_FDT: Flattened device tree + * @PFT_FDTOVERLAY: Device tree overlay + */ +enum pxe_file_type_t { + PFT_KERNEL, + PFT_INITRD, + PFT_FDT, + PFT_FDTOVERLAY, +}; + +/** + * struct pxe_file - a file that needs to be loaded + * + * @path: Path to the file + * @type: Type of file (kernel, initrd, etc.) + * @addr: Address where file was loaded (filled by caller) + * @size: Size of loaded file (filled by caller) + */ +struct pxe_file { + char *path; + enum pxe_file_type_t type; + ulong addr; + ulong size; +}; + /* * Describes a pxe menu as given via pxe files. * -- 2.43.0