From patchwork Fri Jul 18 13:08:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 33839 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C828E208CF for ; Fri, 18 Jul 2014 13:10:26 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id w10sf17853452pde.3 for ; Fri, 18 Jul 2014 06:10:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=5a03a8g6j8jCMyBXyzjrGToVCYXEUpYxvMA118DS3sI=; b=Gy1ZfB9g34L5wePbSJoSC7mKn7HLVJym72wdXfvoQ5M07qcdfJUwMqt7r+jsd0yd4V 4Ovk+51m+pyN6lkit79DllcUveWyhSq4JjyqHLC3MnZzedcoecFp9FwR1iNdY+b5sZhu DVw35//xC3fMMgqxXTDi4M/N3GmVEq2rkP2QDbBpsYROa0rPmWhbyNk5n47x1pqVsN4S zTUYOY3UNZOWuB/BTerl9bR/gzUslsaLNC3s/unI3lUR2e4Od8bW5ta7QXGdFUNfs+u9 UUZDGFEzov6Ti+qFMThg8nEfRhDkwiGx1IhhwulrL4GJNEdCeSKOsRnwiNF4VIg6+2Wm sSNg== X-Gm-Message-State: ALoCoQkvta1rZHO1Ipi87wMchKgYPwXzobyem5tU3NZ/gs7DBGgwhbvQq+lDtgl7y+r8LtjTGEZr X-Received: by 10.66.102.70 with SMTP id fm6mr2360216pab.42.1405689026102; Fri, 18 Jul 2014 06:10:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.243 with SMTP id p106ls962867qgd.54.gmail; Fri, 18 Jul 2014 06:10:26 -0700 (PDT) X-Received: by 10.52.118.99 with SMTP id kl3mr4924897vdb.18.1405689025973; Fri, 18 Jul 2014 06:10:25 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id s2si4836703vcs.29.2014.07.18.06.10.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jul 2014 06:10:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hy4so7249423vcb.41 for ; Fri, 18 Jul 2014 06:10:25 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr5718611vcb.48.1405689025806; Fri, 18 Jul 2014 06:10:25 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp9786vcb; Fri, 18 Jul 2014 06:10:25 -0700 (PDT) X-Received: by 10.66.180.34 with SMTP id dl2mr4946327pac.124.1405689024609; Fri, 18 Jul 2014 06:10:24 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id xq7si5578620veb.103.2014.07.18.06.10.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 18 Jul 2014 06:10:24 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X87tm-0005UT-Bm; Fri, 18 Jul 2014 13:08:30 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X87tl-0005TZ-Jp for xen-devel@lists.xen.org; Fri, 18 Jul 2014 13:08:29 +0000 Received: from [85.158.139.211:19297] by server-7.bemta-5.messagelabs.com id 41/CF-30824-C4C19C35; Fri, 18 Jul 2014 13:08:28 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-16.tower-206.messagelabs.com!1405688906!13360668!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20265 invoked from network); 18 Jul 2014 13:08:27 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-16.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 18 Jul 2014 13:08:27 -0000 X-IronPort-AV: E=Sophos;i="5.01,685,1400025600"; d="scan'208";a="153665161" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 18 Jul 2014 13:08:26 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Fri, 18 Jul 2014 09:08:25 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=localhost.localdomain) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1X87tg-0001RF-4Y; Fri, 18 Jul 2014 14:08:25 +0100 Received: by localhost.localdomain (sSMTP sendmail emulation); Fri, 18 Jul 2014 14:08:24 +0100 From: Ian Campbell To: Date: Fri, 18 Jul 2014 14:08:14 +0100 Message-ID: <1405688900-11769-4-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1405688876.491.10.camel@kazak.uk.xensource.com> References: <1405688876.491.10.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH v3 04/10] xen: arm: rename early_info structs X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: There isn't really anything Device Tree specific about the early_info, we just happen to get it from device tree (but in the future it might come e.g. from UEFI or ACPI or something else). Move the relevant structs out of device_tree.h and into asm/setup.h and rename to be more neutral. For now the code to parse the DT into the now arch specific structs remains in common code. Signed-off-by: Ian Campbell Acked-by: Julien Grall Acked-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 13 ++++++----- xen/arch/arm/kernel.c | 6 ++--- xen/arch/arm/kernel.h | 3 ++- xen/arch/arm/setup.c | 51 ++++++++++++++++++++++------------------- xen/common/device_tree.c | 38 +++++++++++++++--------------- xen/include/asm-arm/setup.h | 40 ++++++++++++++++++++++++++++++++ xen/include/xen/device_tree.h | 39 ------------------------------- 7 files changed, 98 insertions(+), 92 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index c58ad75..a065442 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -404,9 +405,9 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, int res = 0; int had_dom0_bootargs = 0; - if ( early_info.modules.nr_mods >= MOD_KERNEL && - early_info.modules.module[MOD_KERNEL].cmdline[0] ) - bootargs = &early_info.modules.module[MOD_KERNEL].cmdline[0]; + if ( bootinfo.modules.nr_mods >= MOD_KERNEL && + bootinfo.modules.module[MOD_KERNEL].cmdline[0] ) + bootargs = &bootinfo.modules.module[MOD_KERNEL].cmdline[0]; dt_for_each_property_node (node, prop) { @@ -465,7 +466,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, * If the bootloader provides an initrd, we must create a placeholder * for the initrd properties. The values will be replaced later. */ - if ( early_info.modules.module[MOD_INITRD].size ) + if ( bootinfo.modules.module[MOD_INITRD].size ) { u64 a = 0; res = fdt_property(kinfo->fdt, "linux,initrd-start", &a, sizeof(a)); @@ -1221,8 +1222,8 @@ static void dtb_load(struct kernel_info *kinfo) static void initrd_load(struct kernel_info *kinfo) { paddr_t load_addr = kinfo->initrd_paddr; - paddr_t paddr = early_info.modules.module[MOD_INITRD].start; - paddr_t len = early_info.modules.module[MOD_INITRD].size; + paddr_t paddr = bootinfo.modules.module[MOD_INITRD].start; + paddr_t len = bootinfo.modules.module[MOD_INITRD].size; unsigned long offs; int node; int res; diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 69182ec..ce5b95a 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -69,7 +69,7 @@ static void place_modules(struct kernel_info *info, { /* Align DTB and initrd size to 2Mb. Linux only requires 4 byte alignment */ const paddr_t initrd_len = - ROUNDUP(early_info.modules.module[MOD_INITRD].size, MB(2)); + ROUNDUP(bootinfo.modules.module[MOD_INITRD].size, MB(2)); const paddr_t dtb_len = ROUNDUP(fdt_totalsize(info->fdt), MB(2)); const paddr_t modsize = initrd_len + dtb_len; @@ -376,8 +376,8 @@ int kernel_probe(struct kernel_info *info) paddr_t start, size; - start = early_info.modules.module[MOD_KERNEL].start; - size = early_info.modules.module[MOD_KERNEL].size; + start = bootinfo.modules.module[MOD_KERNEL].start; + size = bootinfo.modules.module[MOD_KERNEL].size; if ( !size ) { diff --git a/xen/arch/arm/kernel.h b/xen/arch/arm/kernel.h index fd2f61d..7c7f624 100644 --- a/xen/arch/arm/kernel.h +++ b/xen/arch/arm/kernel.h @@ -8,6 +8,7 @@ #include #include +#include struct kernel_info { #ifdef CONFIG_ARM_64 @@ -16,7 +17,7 @@ struct kernel_info { void *fdt; /* flat device tree */ paddr_t unassigned_mem; /* RAM not (yet) assigned to a bank */ - struct dt_mem_info mem; + struct meminfo mem; /* kernel entry point */ paddr_t entry; diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 78dc7f5..b1aa9c3 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -43,8 +43,11 @@ #include #include #include +#include #include +struct bootinfo __initdata bootinfo; + struct cpuinfo_arm __read_mostly boot_cpu_data; static __used void init_done(void) @@ -182,7 +185,7 @@ static void dt_unreserved_regions(paddr_t s, paddr_t e, void __init discard_initial_modules(void) { - struct dt_module_info *mi = &early_info.modules; + struct bootmodules *mi = &bootinfo.modules; int i; for ( i = MOD_DISCARD_FIRST; i <= mi->nr_mods; i++ ) @@ -210,7 +213,7 @@ static paddr_t __init consider_modules(paddr_t s, paddr_t e, uint32_t size, paddr_t align, int first_mod) { - const struct dt_module_info *mi = &early_info.modules; + const struct bootmodules *mi = &bootinfo.modules; int i; int nr_rsvd; @@ -275,7 +278,7 @@ static paddr_t __init consider_modules(paddr_t s, paddr_t e, */ static paddr_t __init next_module(paddr_t s, paddr_t *end) { - struct dt_module_info *mi = &early_info.modules; + struct bootmodules *mi = &bootinfo.modules; paddr_t lowest = ~(paddr_t)0; int i; @@ -308,7 +311,7 @@ static paddr_t __init next_module(paddr_t s, paddr_t *end) */ static paddr_t __init get_xen_paddr(void) { - struct dt_mem_info *mi = &early_info.mem; + struct meminfo *mi = &bootinfo.mem; paddr_t min_size; paddr_t paddr = 0, last_end; int i; @@ -357,8 +360,8 @@ static paddr_t __init get_xen_paddr(void) printk("Placing Xen at 0x%"PRIpaddr"-0x%"PRIpaddr"\n", paddr, paddr + min_size); - early_info.modules.module[MOD_XEN].start = paddr; - early_info.modules.module[MOD_XEN].size = min_size; + bootinfo.modules.module[MOD_XEN].start = paddr; + bootinfo.modules.module[MOD_XEN].size = min_size; return paddr; } @@ -376,7 +379,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) int i; void *fdt; - if ( !early_info.mem.nr_banks ) + if ( !bootinfo.mem.nr_banks ) panic("No memory bank"); /* @@ -393,15 +396,15 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) * We also track the number of actual RAM pages (i.e. not counting * the holes). */ - ram_size = early_info.mem.bank[0].size; + ram_size = bootinfo.mem.bank[0].size; - contig_start = ram_start = early_info.mem.bank[0].start; + contig_start = ram_start = bootinfo.mem.bank[0].start; contig_end = ram_end = ram_start + ram_size; - for ( i = 1; i < early_info.mem.nr_banks; i++ ) + for ( i = 1; i < bootinfo.mem.nr_banks; i++ ) { - paddr_t bank_start = early_info.mem.bank[i].start; - paddr_t bank_size = early_info.mem.bank[i].size; + paddr_t bank_start = bootinfo.mem.bank[i].start; + paddr_t bank_size = bootinfo.mem.bank[i].size; paddr_t bank_end = bank_start + bank_size; paddr_t new_ram_size = ram_size + bank_size; @@ -434,11 +437,11 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) ram_end = new_ram_end; } - if ( i != early_info.mem.nr_banks ) + if ( i != bootinfo.mem.nr_banks ) { printk("WARNING: only using %d out of %d memory banks\n", - i, early_info.mem.nr_banks); - early_info.mem.nr_banks = i; + i, bootinfo.mem.nr_banks); + bootinfo.mem.nr_banks = i; } total_pages = ram_pages = ram_size >> PAGE_SHIFT; @@ -497,10 +500,10 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) device_tree_flattened = fdt; /* Add non-xenheap memory */ - for ( i = 0; i < early_info.mem.nr_banks; i++ ) + for ( i = 0; i < bootinfo.mem.nr_banks; i++ ) { - paddr_t bank_start = early_info.mem.bank[i].start; - paddr_t bank_end = bank_start + early_info.mem.bank[i].size; + paddr_t bank_start = bootinfo.mem.bank[i].start; + paddr_t bank_end = bank_start + bootinfo.mem.bank[i].size; s = bank_start; while ( s < bank_end ) @@ -557,10 +560,10 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) void *fdt; total_pages = 0; - for ( bank = 0 ; bank < early_info.mem.nr_banks; bank++ ) + for ( bank = 0 ; bank < bootinfo.mem.nr_banks; bank++ ) { - paddr_t bank_start = early_info.mem.bank[bank].start; - paddr_t bank_size = early_info.mem.bank[bank].size; + paddr_t bank_start = bootinfo.mem.bank[bank].start; + paddr_t bank_size = bootinfo.mem.bank[bank].size; paddr_t bank_end = bank_start + bank_size; paddr_t s, e; @@ -609,11 +612,11 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) } } - if ( bank != early_info.mem.nr_banks ) + if ( bank != bootinfo.mem.nr_banks ) { printk("WARNING: only using %d out of %d memory banks\n", - bank, early_info.mem.nr_banks); - early_info.mem.nr_banks = bank; + bank, bootinfo.mem.nr_banks); + bootinfo.mem.nr_banks = bank; } total_pages += ram_size >> PAGE_SHIFT; diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index dba2fba..c0b2b95 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -23,8 +23,8 @@ #include #include #include +#include -struct dt_early_info __initdata early_info; const void *device_tree_flattened; dt_irq_xlate_func dt_irq_xlate; /* Host device tree */ @@ -238,10 +238,10 @@ const char *device_tree_bootargs(const void *fdt) prop = fdt_get_property(fdt, node, "xen,xen-bootargs", NULL); if ( prop == NULL ) { - struct dt_mb_module *dom0_mod = NULL; + struct bootmodule *dom0_mod = NULL; - if ( early_info.modules.nr_mods >= MOD_KERNEL ) - dom0_mod = &early_info.modules.module[MOD_KERNEL]; + if ( bootinfo.modules.nr_mods >= MOD_KERNEL ) + dom0_mod = &bootinfo.modules.module[MOD_KERNEL]; if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL) || ( dom0_mod && dom0_mod->cmdline[0] ) ) @@ -319,14 +319,14 @@ static void __init process_memory_node(const void *fdt, int node, cell = (const __be32 *)prop->data; banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof (u32)); - for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ ) + for ( i = 0; i < banks && bootinfo.mem.nr_banks < NR_MEM_BANKS; i++ ) { device_tree_get_reg(&cell, address_cells, size_cells, &start, &size); if ( !size ) continue; - early_info.mem.bank[early_info.mem.nr_banks].start = start; - early_info.mem.bank[early_info.mem.nr_banks].size = size; - early_info.mem.nr_banks++; + bootinfo.mem.bank[bootinfo.mem.nr_banks].start = start; + bootinfo.mem.bank[bootinfo.mem.nr_banks].size = size; + bootinfo.mem.nr_banks++; } } @@ -337,7 +337,7 @@ static void __init process_multiboot_node(const void *fdt, int node, const struct fdt_property *prop; const __be32 *cell; int nr; - struct dt_mb_module *mod; + struct bootmodule *mod; int len; if ( fdt_node_check_compatible(fdt, node, "xen,linux-zimage") == 0 || @@ -351,7 +351,7 @@ static void __init process_multiboot_node(const void *fdt, int node, else panic("%s not a known xen multiboot type\n", name); - mod = &early_info.modules.module[nr]; + mod = &bootinfo.modules.module[nr]; prop = fdt_get_property(fdt, node, "reg", &len); if ( !prop ) @@ -376,8 +376,8 @@ static void __init process_multiboot_node(const void *fdt, int node, else mod->cmdline[0] = 0; - if ( nr > early_info.modules.nr_mods ) - early_info.modules.nr_mods = nr; + if ( nr > bootinfo.modules.nr_mods ) + bootinfo.modules.nr_mods = nr; } static void __init process_chosen_node(const void *fdt, int node, @@ -385,7 +385,7 @@ static void __init process_chosen_node(const void *fdt, int node, u32 address_cells, u32 size_cells) { const struct fdt_property *prop; - struct dt_mb_module *mod = &early_info.modules.module[MOD_INITRD]; + struct bootmodule *mod = &bootinfo.modules.module[MOD_INITRD]; paddr_t start, end; int len; @@ -427,7 +427,7 @@ static void __init process_chosen_node(const void *fdt, int node, mod->start = start; mod->size = end - start; - early_info.modules.nr_mods = max(MOD_INITRD, early_info.modules.nr_mods); + bootinfo.modules.nr_mods = max(MOD_INITRD, bootinfo.modules.nr_mods); } static int __init early_scan_node(const void *fdt, @@ -448,8 +448,8 @@ static int __init early_scan_node(const void *fdt, static void __init early_print_info(void) { - struct dt_mem_info *mi = &early_info.mem; - struct dt_module_info *mods = &early_info.modules; + struct meminfo *mi = &bootinfo.mem; + struct bootmodules *mods = &bootinfo.modules; int i, nr_rsvd; for ( i = 0; i < mi->nr_banks; i++ ) @@ -485,18 +485,18 @@ static void __init early_print_info(void) */ size_t __init device_tree_early_init(const void *fdt, paddr_t paddr) { - struct dt_mb_module *mod; + struct bootmodule *mod; int ret; ret = fdt_check_header(fdt); if ( ret < 0 ) panic("No valid device tree\n"); - mod = &early_info.modules.module[MOD_FDT]; + mod = &bootinfo.modules.module[MOD_FDT]; mod->start = paddr; mod->size = fdt_totalsize(fdt); - early_info.modules.nr_mods = max(MOD_FDT, early_info.modules.nr_mods); + bootinfo.modules.nr_mods = max(MOD_FDT, bootinfo.modules.nr_mods); device_tree_for_each_node((void *)fdt, early_scan_node, NULL); early_print_info(); diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h index b09f688..ea0dc46 100644 --- a/xen/include/asm-arm/setup.h +++ b/xen/include/asm-arm/setup.h @@ -3,6 +3,46 @@ #include +#define NR_MEM_BANKS 8 + +#define MOD_XEN 0 +#define MOD_FDT 1 +#define MOD_KERNEL 2 +#define MOD_INITRD 3 +#define MOD_XSM 4 +#define NR_MODULES 5 + +#define MOD_DISCARD_FIRST MOD_FDT + +struct membank { + paddr_t start; + paddr_t size; +}; + +struct meminfo { + int nr_banks; + struct membank bank[NR_MEM_BANKS]; +}; + +struct bootmodule { + paddr_t start; + paddr_t size; + char cmdline[1024]; +}; + +struct bootmodules { + int nr_mods; + /* Module 0 is Xen itself, followed by the provided modules-proper */ + struct bootmodule module[NR_MODULES]; +}; + +struct bootinfo { + struct meminfo mem; + struct bootmodules modules; +}; + +extern struct bootinfo bootinfo; + void arch_init_memory(void); void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len); diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 865e1ef..717ef55 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -20,44 +20,6 @@ #define DEVICE_TREE_MAX_DEPTH 16 -#define NR_MEM_BANKS 8 - -#define MOD_XEN 0 -#define MOD_FDT 1 -#define MOD_KERNEL 2 -#define MOD_INITRD 3 -#define MOD_XSM 4 -#define NR_MODULES 5 - -#define MOD_DISCARD_FIRST MOD_FDT - -struct membank { - paddr_t start; - paddr_t size; -}; - -struct dt_mem_info { - int nr_banks; - struct membank bank[NR_MEM_BANKS]; -}; - -struct dt_mb_module { - paddr_t start; - paddr_t size; - char cmdline[1024]; -}; - -struct dt_module_info { - int nr_mods; - /* Module 0 is Xen itself, followed by the provided modules-proper */ - struct dt_mb_module module[NR_MODULES]; -}; - -struct dt_early_info { - struct dt_mem_info mem; - struct dt_module_info modules; -}; - /* * Struct used for matching a device */ @@ -195,7 +157,6 @@ typedef int (*device_tree_node_func)(const void *fdt, u32 address_cells, u32 size_cells, void *data); -extern struct dt_early_info early_info; extern const void *device_tree_flattened; size_t __init device_tree_early_init(const void *fdt, paddr_t paddr);