summaryrefslogtreecommitdiffstats
path: root/src/arch/x86/include/arch/cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/include/arch/cpu.h')
-rw-r--r--src/arch/x86/include/arch/cpu.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 851b58dd4974..5c371d9d85b0 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -179,8 +179,14 @@ struct cpu_info {
static inline struct cpu_info *cpu_info(void)
{
struct cpu_info *ci;
- __asm__("andl %%esp,%0; "
+ __asm__(
+#ifdef __x86_64__
+ "and %%rsp,%0; "
+ "or %2, %0 "
+#else
+ "andl %%esp,%0; "
"orl %2, %0 "
+#endif
:"=r" (ci)
: "0" (~(CONFIG_STACK_SIZE - 1)),
"r" (CONFIG_STACK_SIZE - sizeof(struct cpu_info))