changeset: 22041:818340c7eda92c4b51f6e107ee1f0d24e4a47b96
tag: tip
user: jimix@xxxxxxxxxxxxxxxxxxxxx
date: Thu Mar 30 18:46:46 2006 -0500
files: arch/powerpc/kernel/prom_init.c arch/powerpc/platforms/xen/setup.c
description:
[ppc] simplify shared page code now that they are in RMA
diff -r fd2a4320924fc8379188fea738c73458cc4e9973 -r
818340c7eda92c4b51f6e107ee1f0d24e4a47b96 arch/powerpc/kernel/prom_init.c
--- a/arch/powerpc/kernel/prom_init.c Fri Mar 24 17:57:30 2006 -0500
+++ b/arch/powerpc/kernel/prom_init.c Thu Mar 30 18:46:46 2006 -0500
@@ -2141,19 +2141,20 @@ unsigned long __init prom_init(unsigned
xen = call_prom("finddevice", 1, 1, ADDR("/xen"));
if (PHANDLE_VALID(xen)) {
- u32 xsi = 0;
+ u32 res[2];
+ int l;
ulong base;
- prom_getprop(xen, "start-info", &xsi, sizeof (xsi));
- if (xsi == 0) {
- prom_panic("Xen start info prop not exist\n");
+ l = prom_getprop(xen, "reserved", res, sizeof (res));
+ if (l != sizeof(res)) {
+ prom_panic("Xen reserved prop not exist\n");
}
- base = alloc_down(PAGE_SIZE, PAGE_SIZE, 0);
- if (base != xsi) {
+ base = alloc_down(res[1], PAGE_SIZE, 0);
+ if (base != res[0]) {
prom_panic("XSI != alloc_down()\n");
}
- reserve_mem(xsi, PAGE_SIZE);
+ reserve_mem(res[0], res[1]);
}
}
diff -r fd2a4320924fc8379188fea738c73458cc4e9973 -r
818340c7eda92c4b51f6e107ee1f0d24e4a47b96 arch/powerpc/platforms/xen/setup.c
--- a/arch/powerpc/platforms/xen/setup.c Fri Mar 24 17:57:30 2006 -0500
+++ b/arch/powerpc/platforms/xen/setup.c Thu Mar 30 18:46:46 2006 -0500
@@ -118,29 +118,6 @@ int direct_remap_pfn_range(struct vm_are
return rc;
}
-static void __iomem *xen_map_shared(struct device_node *xen, ulong *pbase)
-{
- struct device_node *np = NULL;
- ulong *reg;
- int len;
- ulong pa;
- ulong size;
- ulong mode = _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX;
-
- np = of_find_node_by_type(np, "xen-shared");
- if (np == NULL) {
- udbg_printf("no xen shared area\n");
- for (;;);
- }
- reg = (ulong *)get_property(np, "reg", &len);
- pa = reg[0];
- size = reg[1];
-
- *pbase = pa;
-
- return __ioremap(pa, size, mode);
-}
-
static void __init fw_feature_init(void)
{
DBG(" -> %s\n", __func__);
@@ -175,9 +152,6 @@ static void __init xen_init_early(void)
{
struct device_node *xen;
u32 *si;
- ulong hsi;
- void __iomem *vbase;
- ulong pbase;
DBG(" -> %s\n", __func__);
@@ -189,17 +163,21 @@ static void __init xen_init_early(void)
si = (u32 *)get_property(xen, "start-info", NULL);
xen_start_info = (start_info_t *)__va(*si);
+ HYPERVISOR_shared_info = __va(xen_start_info->shared_info);
+
+ is_dom0 = !!(xen_start_info->flags & SIF_INITDOMAIN);
+ xen_init_udbg(is_dom0);
+
DBG("xen_start_info at %lx\n", xen_start_info);
DBG(" magic %s\n", xen_start_info->magic);
DBG(" flags %x\n", xen_start_info->flags);
- DBG(" shared_info %lx\n", xen_start_info->shared_info);
+ DBG(" shared_info %lx, %p\n",
+ xen_start_info->shared_info, HYPERVISOR_shared_info);
DBG(" store_mfn %lx\n", xen_start_info->store_mfn);
DBG(" store_evtchn %x\n", xen_start_info->store_evtchn);
DBG(" console_mfn %lx\n", xen_start_info->console_mfn);
DBG(" console_evtchn %x\n", xen_start_info->store_evtchn);
- is_dom0 = !!(xen_start_info->flags & SIF_INITDOMAIN);
- xen_init_udbg(is_dom0);
if (is_dom0) {
ppc_md.pcibios_fixup = maple_md.pcibios_fixup;
ppc_md.pci_get_legacy_ide_irq =
maple_md.pci_get_legacy_ide_irq;
@@ -210,15 +188,6 @@ static void __init xen_init_early(void)
ppc_md.set_rtc_time = maple_md.set_rtc_time;
ppc_md.get_rtc_time = maple_md.get_rtc_time;
}
-
- hsi = xen_start_info->shared_info;
- vbase = xen_map_shared(xen, &pbase);
- DBG("%s: shared region (0x%lx) is mapped at: %p\n",
- __func__, pbase, vbase);
-
- hsi = (ulong)vbase + (hsi - pbase);
-
- HYPERVISOR_shared_info = (shared_info_t *)hsi;
DBG("Hello World I'm Maple Xen-LPAR!\n");
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|