summaryrefslogtreecommitdiff
path: root/src/arch/x86/c_start.S
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2020-08-27 20:50:18 +0200
committerPatrick Georgi <pgeorgi@google.com>2021-07-06 06:09:13 +0000
commitadcf7827bd00757cd52e87693c8bbfbe08ed6b13 (patch)
tree30d823ebe33966e2367e3f4c7aab9a4dae05fffe /src/arch/x86/c_start.S
parente85e7af6d02cb7d5acc51a10d0a1abbd7980ce12 (diff)
arch/x86: Use ENV_X86_64 instead of _x86_64_
Tested on Intel Sandybridge x86_64 and x86_32. Change-Id: I152483d24af0512c0ee4fbbe8931b7312e487ac6 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/44867 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/arch/x86/c_start.S')
-rw-r--r--src/arch/x86/c_start.S18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/arch/x86/c_start.S b/src/arch/x86/c_start.S
index b7ffddc385..3ef03b3346 100644
--- a/src/arch/x86/c_start.S
+++ b/src/arch/x86/c_start.S
@@ -24,7 +24,7 @@ thread_stacks:
#endif
.section ".text._start", "ax", @progbits
-#ifdef __x86_64__
+#if ENV_X86_64
.code64
#else
.code32
@@ -32,7 +32,7 @@ thread_stacks:
.globl _start
_start:
cli
-#ifdef __x86_64__
+#if ENV_X86_64
movabs $gdtaddr, %rax
lgdt (%rax)
#else
@@ -45,7 +45,7 @@ _start:
movl %eax, %ss
movl %eax, %fs
movl %eax, %gs
-#ifdef __x86_64__
+#if ENV_X86_64
mov $RAM_CODE_SEG64, %ecx
call SetCodeSelector
#endif
@@ -54,7 +54,7 @@ _start:
cld
-#ifdef __x86_64__
+#if ENV_X86_64
mov %rdi, %rax
movabs %rax, _cbmem_top_ptr
movabs $_stack, %rdi
@@ -117,7 +117,7 @@ _start:
.globl gdb_stub_breakpoint
gdb_stub_breakpoint:
-#ifdef __x86_64__
+#if ENV_X86_64
pop %rax /* Return address */
pushfl
push %cs
@@ -139,7 +139,7 @@ gdb_stub_breakpoint:
gdtaddr:
.word gdt_end - gdt - 1
-#ifdef __x86_64__
+#if ENV_X86_64
.quad gdt
#else
.long gdt /* we know the offset */
@@ -176,7 +176,7 @@ gdt:
/* selgdt 0x18, flat data segment */
.word 0xffff, 0x0000
-#ifdef __x86_64__
+#if ENV_X86_64
.byte 0x00, 0x92, 0xcf, 0x00
#else
.byte 0x00, 0x93, 0xcf, 0x00
@@ -210,7 +210,7 @@ gdt:
* limit
*/
-#ifdef __x86_64__
+#if ENV_X86_64
/* selgdt 0x48, flat x64 code segment */
.word 0xffff, 0x0000
.byte 0x00, 0x9b, 0xaf, 0x00
@@ -218,7 +218,7 @@ gdt:
gdt_end:
.section ".text._start", "ax", @progbits
-#ifdef __x86_64__
+#if ENV_X86_64
SetCodeSelector:
# save rsp because iret will align it to a 16 byte boundary
mov %rsp, %rdx