From patchwork Mon Jun 16 11:44:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 31952 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 25AD3206A0 for ; Mon, 16 Jun 2014 11:46:43 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id eb12sf32129879oac.11 for ; Mon, 16 Jun 2014 04:46:42 -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=/eSuNQgKxNdApriHS2vJeR34ChGVUDFCXiopiDZMZpw=; b=a2eke4jgTpIHl8ENM2i9R4M+P2RaQqoeO3NOEIg+57bh09dV04zRdIp39G/lus7ihq Ztt+Uh3uVQy8JeExs9SmQLLHmemHcVzDT3Liw8hG1gXJE9NEp5fNozaZo8JN5q+4U1tF 765Bgm9lwBq7BqHLUVy4D3TbwkQeLZVpN7PB4agsDKDM8Pf7DSUQNL90at0Fz0lRGEEV IMr+7a9c34XBZqx+EuH1+zIOdq9U+lMLd43G5Rxyo35wiCQxmlw0KC1MRZzqiIJqGsQR qxakaOkQEwlEXlMheZjO9UeXnex2Tm431htZVvSxxdfGB+6Ka/bFbDD/dmK0/tiVj57w xlTA== X-Gm-Message-State: ALoCoQnshzVnmJVPL/tdmGc8bjNSA/zn/2AxmtUubXCXdcvwW32LO9abW3FUiIYOuV1prbqodfNz X-Received: by 10.182.115.133 with SMTP id jo5mr3005360obb.38.1402919202730; Mon, 16 Jun 2014 04:46:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.145 with SMTP id f17ls4171364qgd.95.gmail; Mon, 16 Jun 2014 04:46:42 -0700 (PDT) X-Received: by 10.52.72.39 with SMTP id a7mr13257360vdv.13.1402919202610; Mon, 16 Jun 2014 04:46:42 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id m4si4007251vev.44.2014.06.16.04.46.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 04:46:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id hy10so4850495vcb.29 for ; Mon, 16 Jun 2014 04:46:42 -0700 (PDT) X-Received: by 10.52.5.129 with SMTP id s1mr3845710vds.31.1402919202474; Mon, 16 Jun 2014 04:46:42 -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.54.6 with SMTP id vs6csp128500vcb; Mon, 16 Jun 2014 04:46:42 -0700 (PDT) X-Received: by 10.224.79.198 with SMTP id q6mr3226607qak.99.1402919201963; Mon, 16 Jun 2014 04:46:41 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id y46si9870121qgy.90.2014.06.16.04.46.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Jun 2014 04:46:41 -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 1WwVLq-0003XF-RB; Mon, 16 Jun 2014 11:45:26 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwVLb-0003My-3F for xen-devel@lists.xen.org; Mon, 16 Jun 2014 11:45:11 +0000 Received: from [193.109.254.147:9895] by server-13.bemta-14.messagelabs.com id D2/F6-23211-6C8DE935; Mon, 16 Jun 2014 11:45:10 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1402919107!11436650!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16539 invoked from network); 16 Jun 2014 11:45:09 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-3.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 16 Jun 2014 11:45:09 -0000 X-IronPort-AV: E=Sophos;i="5.01,486,1400025600"; d="scan'208";a="143697248" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 16 Jun 2014 11:45:04 +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; Mon, 16 Jun 2014 07:45:04 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=marilith-n13.uk.xensource.com.) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WwVLT-000152-U0; Mon, 16 Jun 2014 12:45:03 +0100 From: Ian Campbell To: Date: Mon, 16 Jun 2014 12:44:57 +0100 Message-ID: <1402919103-29642-4-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1402919079.14907.22.camel@kazak.uk.xensource.com> References: <1402919079.14907.22.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Campbell , stefano.stabellini@eu.citrix.com, Naresh Bhat , julien.grall@linaro.org, tim@xen.org, Roy Franz , Fu Wei Subject: [Xen-devel] [PATCH 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.170 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 9d9cba9..5eef8a3 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 @@ -160,9 +161,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) { @@ -221,7 +222,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)); @@ -976,8 +977,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 b9ce7a9..63f6b8e 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 03d495a..a1896d3 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,12 +319,12 @@ 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); - 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++; } } @@ -335,7 +335,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 || @@ -349,7 +349,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 ) @@ -374,8 +374,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, @@ -383,7 +383,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; @@ -425,7 +425,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, @@ -446,8 +446,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++ ) @@ -483,18 +483,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 25db076..74e98f5 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 */ @@ -193,7 +155,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);