@@ -295,7 +295,7 @@ static void kernel_elf_load(struct kernel_info *info)
elf_load_binary(&info->elf.elf);
printk("Free temporary kernel buffer\n");
- free_xenheap_pages(info->kernel_img, info->kernel_order);
+ free_xenheap_pages(info->elf.kernel_img, info->elf.kernel_order);
}
static int kernel_try_elf_prepare(struct kernel_info *info,
@@ -305,14 +305,14 @@ static int kernel_try_elf_prepare(struct kernel_info *info,
memset(&info->elf.elf, 0, sizeof(info->elf.elf));
- info->kernel_order = get_order_from_bytes(size);
- info->kernel_img = alloc_xenheap_pages(info->kernel_order, 0);
- if ( info->kernel_img == NULL )
+ info->elf.kernel_order = get_order_from_bytes(size);
+ info->elf.kernel_img = alloc_xenheap_pages(info->elf.kernel_order, 0);
+ if ( info->elf.kernel_img == NULL )
panic("Cannot allocate temporary buffer for kernel");
- copy_from_paddr(info->kernel_img, addr, size);
+ copy_from_paddr(info->elf.kernel_img, addr, size);
- if ( (rc = elf_init(&info->elf.elf, info->kernel_img, size )) != 0 )
+ if ( (rc = elf_init(&info->elf.elf, info->elf.kernel_img, size )) != 0 )
goto err;
#ifdef VERBOSE
elf_set_verbose(&info->elf.elf);
@@ -351,7 +351,7 @@ err:
printk("Xen: ELF kernel broken: %s\n",
elf_check_broken(&info->elf.elf));
- free_xenheap_pages(info->kernel_img, info->kernel_order);
+ free_xenheap_pages(info->elf.kernel_img, info->elf.kernel_order);
return rc;
}
@@ -18,14 +18,16 @@ struct kernel_info {
paddr_t unassigned_mem; /* RAM not (yet) assigned to a bank */
struct dt_mem_info mem;
- paddr_t dtb_paddr;
+ /* kernel entry point */
paddr_t entry;
+ /* boot blob load addresses */
+ paddr_t dtb_paddr;
paddr_t initrd_paddr;
- void *kernel_img;
- unsigned kernel_order;
-
+ /* loader to use for this kernel */
+ void (*load)(struct kernel_info *info);
+ /* loader specific state */
union {
struct {
paddr_t kernel_addr;
@@ -36,10 +38,10 @@ struct kernel_info {
struct {
struct elf_binary elf;
struct elf_dom_parms parms;
+ unsigned kernel_order;
+ void *kernel_img;
} elf;
};
-
- void (*load)(struct kernel_info *info);
};
int kernel_prepare(struct kernel_info *info);
The kernel_order and kernel_image fields are ELF specific. Also add a few comments about what things are. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> --- xen/arch/arm/kernel.c | 14 +++++++------- xen/arch/arm/kernel.h | 14 ++++++++------ 2 files changed, 15 insertions(+), 13 deletions(-)