cpu: x86 port to 64bit

Change-Id: Ib1c6732d3a338f6d898fadc19e5af59032343451
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Scott Duplichan <scott@notabs.org>
Reviewed-on: http://review.coreboot.org/10580
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
This commit is contained in:
Stefan Reinauer 2015-06-18 01:15:27 -07:00
parent defee17c67
commit e021dea777
2 changed files with 10 additions and 2 deletions

View File

@ -27,6 +27,10 @@ gdtptr:
.word 0xffff, 0x0000 .word 0xffff, 0x0000
.byte 0x00, 0x93, 0xcf, 0x00 .byte 0x00, 0x93, 0xcf, 0x00
/* selgdt 0x18, flat code segment (64-bit) */
.word 0xffff, 0x0000
.byte 0x00, 0x9b, 0xaf, 0x00
gdt_end: gdt_end:

View File

@ -58,13 +58,17 @@ int lowmem_backup_size;
static inline void setup_secondary_gdt(void) static inline void setup_secondary_gdt(void)
{ {
u16 *gdt_limit; u16 *gdt_limit;
#ifdef __x86_64__
u64 *gdt_base;
#else
u32 *gdt_base; u32 *gdt_base;
#endif
gdt_limit = (void *)&_secondary_gdt_addr; gdt_limit = (void *)&_secondary_gdt_addr;
gdt_base = (void *)&gdt_limit[1]; gdt_base = (void *)&gdt_limit[1];
*gdt_limit = (u32)&gdt_end - (u32)&gdt - 1; *gdt_limit = (uintptr_t)&gdt_end - (uintptr_t)&gdt - 1;
*gdt_base = (u32)&gdt; *gdt_base = (uintptr_t)&gdt;
} }
static void copy_secondary_start_to_lowest_1M(void) static void copy_secondary_start_to_lowest_1M(void)