From 84aee0deae0de620277759e2c3cd3a9cf45390b0 Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Mon, 8 Jul 2013 15:40:01 -0700 Subject: hw/loader: Support ramdisk with u-boot header Introduce 'load_ramdisk()' which can load "normal" ramdisks and ramdisks with a u-boot header. To enable this and leverage synergies 'load_uimage()' is refactored to accomodate this additional use case. Signed-off-by: Soren Brinkmann Reviewed-by: Peter Maydell Message-id: 1373323202-17083-2-git-send-email-soren.brinkmann@xilinx.com Signed-off-by: Peter Maydell --- include/hw/loader.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/hw/loader.h') diff --git a/include/hw/loader.h b/include/hw/loader.h index 15d4cc9..eb9c9a3 100644 --- a/include/hw/loader.h +++ b/include/hw/loader.h @@ -17,6 +17,19 @@ int load_aout(const char *filename, hwaddr addr, int max_sz, int load_uimage(const char *filename, hwaddr *ep, hwaddr *loadaddr, int *is_linux); +/** + * load_ramdisk: + * @filename: Path to the ramdisk image + * @addr: Memory address to load the ramdisk to + * @max_sz: Maximum allowed ramdisk size (for non-u-boot ramdisks) + * + * Load a ramdisk image with U-Boot header to the specified memory + * address. + * + * Returns the size of the loaded image on success, -1 otherwise. + */ +int load_ramdisk(const char *filename, hwaddr addr, uint64_t max_sz); + ssize_t read_targphys(const char *name, int fd, hwaddr dst_addr, size_t nbytes); void pstrcpy_targphys(const char *name, -- cgit v1.1