From patchwork Wed Apr 29 02:25:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 465846 X-Patchwork-Delegate: sjg@chromium.org 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 66CA814007F for ; Wed, 29 Apr 2015 12:26:59 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 49CF84BA91; Wed, 29 Apr 2015 04:26:38 +0200 (CEST) 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 j5npvZJDa--o; Wed, 29 Apr 2015 04:26:38 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 936BC4BA94; Wed, 29 Apr 2015 04:26:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3839E4B9EA for ; Wed, 29 Apr 2015 04:25:44 +0200 (CEST) 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 9IE2_0IP9C1N for ; Wed, 29 Apr 2015 04:25:44 +0200 (CEST) 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-oi0-f74.google.com (mail-oi0-f74.google.com [209.85.218.74]) by theia.denx.de (Postfix) with ESMTPS id 0E9B74BA41 for ; Wed, 29 Apr 2015 04:25:39 +0200 (CEST) Received: by oiax69 with SMTP id x69so959923oia.1 for ; Tue, 28 Apr 2015 19:25:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w/AU+WrlOrvBTbk9efsW0XHjrrpmRlRiP/9rd/BcLZc=; b=X1J0T8I1hTHXJXXVdAu+cofoy25pGK4QApIILap1A4ouCfJv9rcGPgeFBM6AfcsFyg 5IUFHJ4SfU0tGGyIv8+pbn3917BGkodLzpVZtwvyUInAKPuS296l3JoOfjPod5Rg8uuk RezyIL2amD8/HWmQ1iW2IrATtGhU0TpFCD48aoDNXXHu4rqaluZAzvqkW7T8OyglKyx3 gbp7iv39EB3i7yUKWat17/1Ip0HUXLAYWzWMtl4qliu2m1R4BFYZuOxNIWYRLmQu+63U chWcYPMQm9wR3dRCE5qIDBWMVCznepvwSnd+Q+og244rlsdiaPuKuxhweShznF2HA18q HzUA== X-Gm-Message-State: ALoCoQnOBWioNCQCmuwhZbZPKIr/HDCQaY5kvIycgLCcay5ERuDkOHRmFuyuQ44wdF0om8EhnPr9 X-Received: by 10.50.88.70 with SMTP id be6mr23211879igb.6.1430274338668; Tue, 28 Apr 2015 19:25:38 -0700 (PDT) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id i27si1316257yha.6.2015.04.28.19.25.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2015 19:25:38 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id SChWVUNf.2; Tue, 28 Apr 2015 19:25:38 -0700 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 1EE8C221124; Tue, 28 Apr 2015 20:25:38 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 28 Apr 2015 20:25:15 -0600 Message-Id: <1430274322-14383-14-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1430274322-14383-1-git-send-email-sjg@chromium.org> References: <1430274322-14383-1-git-send-email-sjg@chromium.org> Cc: Graeme Russ , Thomas Beaman Subject: [U-Boot] [PATCH v2 13/20] x86: Store the GDT pointer in global_data X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When we start up additional CPUs we want them to use the same Global Descriptor Table. Store the address of this in global_data so we can reference it later. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v2: None arch/x86/cpu/cpu.c | 1 + arch/x86/include/asm/global_data.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 02e66d8..78eb3fe 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -133,6 +133,7 @@ static void load_gdt(const u64 *boot_gdt, u16 num_entries) void setup_gdt(gd_t *id, u64 *gdt_addr) { + id->arch.gdt = gdt_addr; /* CS: code, read/execute, 4 GB, base 0 */ gdt_addr[X86_GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xfffff); diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 5ee06eb..4d9eac6 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -68,6 +68,7 @@ struct arch_global_data { /* MRC training data to save for the next boot */ char *mrc_output; unsigned int mrc_output_len; + void *gdt; /* Global descriptor table */ }; #endif