From: Graeme Russ Date: Mon, 2 Jan 2012 15:09:20 +1100 Subject: [U-Boot] [PATCH 03/17] x86: Remove GDR related magic numbers In-Reply-To: <1325477374-6417-1-git-send-email-graeme.russ@gmail.com> References: <1325477374-6417-1-git-send-email-graeme.russ@gmail.com> Message-ID: <1325477374-6417-4-git-send-email-graeme.russ@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@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 -- 1.7.5.2.317.g391b14