From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 12/12] xen: strip /chosen/module@/* from dom0 device tree Date: Tue, 13 Nov 2012 16:23:24 +0000 Message-ID: <1352823804-28482-12-git-send-email-ian.campbell@citrix.com> References: <1352823779.7491.94.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1352823779.7491.94.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Ian Campbell , Ian Campbell List-Id: xen-devel@lists.xenproject.org These nodes are used by Xen to find the initial modules. Only drop the "xen,multiboot-module" compatible nodes in case someone else has a similar idea. Signed-off-by: Ian Campbell --- xen/arch/arm/domain_build.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 7a964f7..d2158d8 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -179,6 +179,7 @@ static int write_nodes(struct domain *d, struct kernel_info *kinfo, int depth = 0, last_depth = -1; u32 address_cells[DEVICE_TREE_MAX_DEPTH]; u32 size_cells[DEVICE_TREE_MAX_DEPTH]; + int parents[DEVICE_TREE_MAX_DEPTH]; int ret; for ( node = 0, depth = 0; @@ -196,10 +197,25 @@ static int write_nodes(struct domain *d, struct kernel_info *kinfo, } while ( last_depth-- >= depth ) + { + parents[last_depth+1] = -1; fdt_end_node(kinfo->fdt); + } address_cells[depth] = device_tree_get_u32(fdt, node, "#address-cells"); size_cells[depth] = device_tree_get_u32(fdt, node, "#size-cells"); + parents[depth] = node; + + /* Skip /chosen/module@/ nodes */ + if ( depth == 2 && + device_tree_node_matches(fdt, parents[1], "chosen") && + device_tree_node_matches(fdt, node, "module") && + fdt_node_check_compatible(fdt, node, + "xen,multiboot-module" ) == 0 ) + { + last_depth = depth - 1; + continue; + } fdt_begin_node(kinfo->fdt, name); -- 1.7.9.1