From patchwork Mon Jan 2 04:09:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 133778 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 B1E79B6FA2 for ; Mon, 2 Jan 2012 15:10:45 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 26FCE281F0; Mon, 2 Jan 2012 05:10:26 +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 TxGYoBRMW7o9; Mon, 2 Jan 2012 05:10:25 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CA4542819A; Mon, 2 Jan 2012 05:10:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6ED83281EE for ; Mon, 2 Jan 2012 05:10:06 +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 sXWehpuKnCFu for ; Mon, 2 Jan 2012 05:10:05 +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-gy0-f172.google.com (mail-gy0-f172.google.com [209.85.160.172]) by theia.denx.de (Postfix) with ESMTPS id 237B42819D for ; Mon, 2 Jan 2012 05:09:57 +0100 (CET) Received: by ghbg18 with SMTP id g18so4915587ghb.3 for ; Sun, 01 Jan 2012 20:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=W8J1d/GAaYHO9TJBWUEs79ahiOvUOpsLkU7egAaeOio=; b=WMCnZz74d1D6diY6kwhQsaEJijx6hnLUJnRBdM4OOtuUhmgny4QQ9KYa1s2yfe4QEk pPXBNl27DiJNFukjgLC8nTwTQ24auylYB3q6+0tgMeU3N6Z5GJPkicyIxcKCYTQidI2H qmiZixA4EVif1FqeyD6nM206qWOP0YDCIpKfI= Received: by 10.236.120.165 with SMTP id p25mr3190452yhh.61.1325477396855; Sun, 01 Jan 2012 20:09:56 -0800 (PST) Received: from localhost.localdomain (d58-106-85-147.sbr801.nsw.optusnet.com.au. [58.106.85.147]) by mx.google.com with ESMTPS id 9sm114431452any.3.2012.01.01.20.09.54 (version=SSLv3 cipher=OTHER); Sun, 01 Jan 2012 20:09:56 -0800 (PST) From: Graeme Russ To: u-boot@lists.denx.de Date: Mon, 2 Jan 2012 15:09:20 +1100 Message-Id: <1325477374-6417-4-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.5.2.317.g391b14 In-Reply-To: <1325477374-6417-1-git-send-email-graeme.russ@gmail.com> References: <1325477374-6417-1-git-send-email-graeme.russ@gmail.com> Subject: [U-Boot] [PATCH 03/17] x86: Remove GDR related magic numbers 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 Signed-off-by: Graeme Russ --- arch/x86/cpu/start.S | 3 ++- arch/x86/include/asm/processor.h | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S index f87633b..7f9b6a7 100644 --- a/arch/x86/cpu/start.S +++ b/arch/x86/cpu/start.S @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -58,7 +59,7 @@ _start: /* This is the 32-bit cold-reset entry point */ /* Load the segement registes to match the gdt loaded in start16.S */ - movl $0x18, %eax + movl $(GDT_ENTRY_32BIT_DS * 8), %eax movw %ax, %fs movw %ax, %ds movw %ax, %gs diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 1e5dccd..203c63a 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -24,9 +24,13 @@ #ifndef __ASM_PROCESSOR_H_ #define __ASM_PROCESSOR_H_ 1 -#define GDT_ENTRY_32BIT_CS 2 +#define GDT_ENTRY_NULL 0 +#define GDT_ENTRY_UNUSED (GDT_ENTRY_NULL + 1) +#define GDT_ENTRY_32BIT_CS (GDT_ENTRY_UNUSED + 1) #define GDT_ENTRY_32BIT_DS (GDT_ENTRY_32BIT_CS + 1) #define GDT_ENTRY_16BIT_CS (GDT_ENTRY_32BIT_DS + 1) #define GDT_ENTRY_16BIT_DS (GDT_ENTRY_16BIT_CS + 1) +#define GDT_NUM_ENTRIES (GDT_ENTRY_16BIT_DS + 1) + #endif