[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen: arm: refactor struct kernel_info



commit 315b7a0c8fa5ba2e8cd0c78893f9cdb37070171f
Author:     Ian Campbell <ian.campbell@xxxxxxxxxx>
AuthorDate: Fri Apr 4 13:56:57 2014 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Wed Apr 16 16:20:16 2014 +0100

    xen: arm: refactor struct kernel_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@xxxxxxxxxx>
    Acked-by: Julien Grall <julien.grall@xxxxxxxxxx>
---
 xen/arch/arm/kernel.c |   14 +++++++-------
 xen/arch/arm/kernel.h |   14 ++++++++------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 1102392..7554479 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -297,7 +297,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,
@@ -307,14 +307,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);
@@ -353,7 +353,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;
 }
 
diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h
index ad2956b..2c27c64 100644
--- a/xen/arch/arm/kernel.h
+++ b/xen/arch/arm/kernel.h
@@ -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);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.