From patchwork Fri Nov 16 21:19:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 199741 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B24D12C0085 for ; Sat, 17 Nov 2012 08:30:31 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 64F214A1FF; Fri, 16 Nov 2012 22:30:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HMN9ES76eohu; Fri, 16 Nov 2012 22:30:28 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7E1E94A1CC; Fri, 16 Nov 2012 22:29:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 61E454A179 for ; Fri, 16 Nov 2012 22:28:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5MWxr7mXk9HY for ; Fri, 16 Nov 2012 22:28:56 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-la0-f74.google.com (mail-la0-f74.google.com [209.85.215.74]) by theia.denx.de (Postfix) with ESMTPS id B21C14A191 for ; Fri, 16 Nov 2012 22:28:50 +0100 (CET) Received: by mail-la0-f74.google.com with SMTP id v3so234658lag.3 for ; Fri, 16 Nov 2012 13:28:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=s7s3IJdyiwf6fjMeYnz9YEbQ7+NdPBDuIRueGxrfW9Q=; b=cNVnw7XYtCACBLomXiPR0DJ6Q0SQOeRWFMaOuLP5qC7HZOly0L/9bQvCoqaXXGn9gS EpIf0ykcaiFwf3Rnz4Yg0ylzkoLpCCk2BOlmWBuhkr+Kx5ZE8oBO1P2vb5hWo51m3LLj Nj0dcssEkd9gjRPhDDd4gKpczbgsJs9oaLXqiqilIfBrMxOYRm9LZg/q6tQWxXsTbydJ IwBsmi3IAByk0SsH5B6DIAV5gbUNg7bh1FHWsjek77XxTrRWCNYyP51eh0ijrEn5C6ri rBKyMe78iSLY8iKVMVdBYO27gxg7l/GftdDhrGj4FaiH9l84T3neO0T4IAb19qHbUGX/ BxGQ== Received: by 10.14.215.136 with SMTP id e8mr465031eep.6.1353101329494; Fri, 16 Nov 2012 13:28:49 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id u8si633143een.1.2012.11.16.13.28.49 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 16 Nov 2012 13:28:49 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 2268920005C; Fri, 16 Nov 2012 13:28:49 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 808A7160847; Fri, 16 Nov 2012 13:28:48 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 16 Nov 2012 13:19:58 -0800 Message-Id: <1353100842-20126-14-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1353100842-20126-1-git-send-email-sjg@chromium.org> References: <1353100842-20126-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQktEcLnd3okFeqdf3155B0No6Di1jLNHLZTI3mDABWrOOzu0TUVhxjiW8Qz1Vcl+GNsMtMoKacrSwuOo5ot6cRageCE8xZiyAX77EzOWasBDuOUUJ5bdXEVPhZDVcwgzeEzaaOjBaEB3Vjxgd1qKVLxR6I0uA5imh6j2LmozUXnWpk/13DHwH60pUiWeNVjIZaLijGG Cc: Tom Rini Subject: [U-Boot] [PATCH 13/57] x86: Move new_gd_addr to arch_global_data X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Move this field into arch_global_data and tidy up. This will certainly break x86, so will need Graeme's help to sort out the problem. I would prefer not to put the architecture-specific stuff at the top of global_data since we relying on that seems even more ugly. Signed-off-by: Simon Glass --- arch/x86/cpu/cpu.c | 2 +- arch/x86/include/asm/global_data.h | 12 +++++++++--- arch/x86/lib/init_helpers.c | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index e9bb0d7..c276aa6 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -92,7 +92,7 @@ static void load_gdt(const u64 *boot_gdt, u16 num_entries) void init_gd(gd_t *id, u64 *gdt_addr) { - id->gd_addr = (ulong)id; + id->arch.gd_addr = (ulong)id; setup_gdt(id, gdt_addr); } diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 3df83bb..d2eb00a 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -28,8 +28,16 @@ /* Architecture-specific global data */ struct arch_global_data { - unsigned long gdt_addr; /* Location of GDT */ + /* + * NOTE: gd_addr MUST be first member of struct global_data! + * + * But it now isn't, so this is sure to break x86. Can we change + * x86 to not require this? I don't think we should put the + * arch data first in global_data... + */ unsigned long new_gd_addr; /* New location of Global Data */ + unsigned long gd_addr; /* Location of Global Data */ + unsigned long gdt_addr; /* Location of GDT */ }; /* @@ -41,8 +49,6 @@ struct arch_global_data { */ typedef struct global_data { - /* NOTE: gd_addr MUST be first member of struct global_data! */ - unsigned long gd_addr; /* Location of Global Data */ bd_t *bd; unsigned long flags; unsigned int baudrate; diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index 05cadcd..ac789c2 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -126,7 +126,7 @@ int copy_gd_to_ram_f_r(void) * in-RAM copy of Global Data (calculate_relocation_address() * has already calculated the in-RAM location of the GDT) */ - ram_gd->gd_addr = (ulong)ram_gd; + ram_gd->arch.gd_addr = (ulong)ram_gd; init_gd(ram_gd, (u64 *)gd->arch.gdt_addr); return 0;