WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [PATCH 2/3] linux: build start_info_t from devtree

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [PATCH 2/3] linux: build start_info_t from devtree
From: Ryan Harper <ryanh@xxxxxxxxxx>
Date: Wed, 24 Jan 2007 11:41:22 -0600
Delivery-date: Wed, 24 Jan 2007 09:41:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
This patch adds support to linux:xen_init_early() to create a
start_info_t structure from properties in /xen/start_info_t if the
device tree does not have a pointer (/xen/start-info) to a previously
constructed start_info_t in memory.  

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
ryanh@xxxxxxxxxx


diffstat output:
 setup.c |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>
---
diff -r ab3b5849331d arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.c        Sun Jan 21 08:36:53 2007 -0500
+++ b/arch/powerpc/platforms/xen/setup.c        Tue Jan 23 15:39:54 2007 -0600
@@ -32,6 +32,7 @@ EXPORT_SYMBOL(HYPERVISOR_shared_info);
 EXPORT_SYMBOL(HYPERVISOR_shared_info);
 
 /* Raw start-of-day parameters from the hypervisor. */
+start_info_t xsi;
 start_info_t *xen_start_info;
 
 extern struct machdep_calls mach_maple_md;
@@ -87,14 +88,32 @@ static void __init xen_init_early(void)
 static void __init xen_init_early(void)
 {
        struct device_node *xen;
-       u64 *si;
+       u64 *start_info;
 
        DBG(" -> %s\n", __func__);
 
        xen = of_find_node_by_path("/xen");
-
-       si = (u64 *)get_property(xen, "start-info", NULL);
-       xen_start_info = (start_info_t *)__va(*si);
+       start_info = (u64 *)get_property(xen, "start-info", NULL);
+
+       /* if we failed to get start-info property, then use start_info_t */
+       if (start_info != NULL ) {
+               xen_start_info = (start_info_t *)__va(*start_info);
+       } else {
+               struct device_node *si;
+               si = of_find_node_by_path("/xen/start_info_t");
+               xen_start_info = &xsi;
+               /* fill out start_info_t from devtree */
+               strcpy(xen_start_info->magic, get_property(si, "magic", NULL));
+               xen_start_info->nr_pages = *((u64 *)get_property(si, 
"nr_pages", NULL));
+               xen_start_info->shared_info = *((u64 *)get_property(si, 
"shared_info", NULL));
+               xen_start_info->store_mfn = *((u64 *)get_property(si, 
"store_mfn", NULL));
+               xen_start_info->store_evtchn = *((u32 *)get_property(si, 
"store_evtchn", NULL));
+               xen_start_info->console.domU.mfn = *((u64 *)get_property(si, 
+                       "console_domU_mfn", NULL));
+               xen_start_info->console.domU.evtchn = *((u32 *)get_property(si,
+                       "console_domU_evtchn", NULL));
+       }
+
        HYPERVISOR_shared_info = __va(xen_start_info->shared_info);
 
        udbg_init_xen();

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>