summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/gdt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/x86/gdt.c b/src/arch/x86/gdt.c
index b7bc62eb70..24a1c81072 100644
--- a/src/arch/x86/gdt.c
+++ b/src/arch/x86/gdt.c
@@ -37,7 +37,7 @@ struct gdtarg {
static void move_gdt(int is_recovery)
{
void *newgdt;
- u16 num_gdt_bytes = (uintptr_t)&gdt_end - (uintptr_t)&gdt;
+ u16 num_gdt_bytes;
struct gdtarg gdtarg;
/* ramstage is already in high memory. No need to use a new gdt. */
@@ -45,6 +45,7 @@ static void move_gdt(int is_recovery)
return;
newgdt = cbmem_find(CBMEM_ID_GDT);
+ num_gdt_bytes = (uintptr_t)&gdt_end - (uintptr_t)&gdt;
if (!newgdt) {
newgdt = cbmem_add(CBMEM_ID_GDT, ALIGN(num_gdt_bytes, 512));
if (!newgdt) {