From mboxrd@z Thu Jan 1 00:00:00 1970 From: Graeme Russ Date: Wed, 04 Jan 2012 21:20:56 +1100 Subject: [U-Boot] [PATCH 03/17] x86: Remove GDR related magic numbers In-Reply-To: References: <1325477374-6417-1-git-send-email-graeme.russ@gmail.com> <1325477374-6417-4-git-send-email-graeme.russ@gmail.com> Message-ID: <4F042808.2030407@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 On 04/01/12 16:23, Simon Glass wrote: > Hi Graeme, > > On Sun, Jan 1, 2012 at 8:09 PM, Graeme Russ wrote: >> >> 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) >> + > > Ick - any reason not to use an enum here? Done, but I still need a rouge #define for the assembler case above Also, I added an X86_ prefix as per Linux headers and moved the size define up from patch 7 Regards Graeme