summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-11-10 18:00:24 -0700
committerSimon Glass <sjg@chromium.org>2014-11-21 07:24:12 +0100
commit21b9b14b49b742c3ee70f819aab3918f517bf0b8 (patch)
tree8ac47249a8ff2acc57db96ee24e5a603f4d00ea0
parent880a3cc4381ac0e2e39ce3313e267fb3e297bc3f (diff)
downloadu-boot-imx-21b9b14b49b742c3ee70f819aab3918f517bf0b8.zip
u-boot-imx-21b9b14b49b742c3ee70f819aab3918f517bf0b8.tar.gz
u-boot-imx-21b9b14b49b742c3ee70f819aab3918f517bf0b8.tar.bz2
x86: Add processor functions to halt and get stack pointer
Add a function to get the stack pointer and another to halt the CPU. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r--arch/x86/include/asm/processor.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index bb3172f..b2854a9 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -30,4 +30,23 @@ enum {
#define X86_GDT_SIZE (X86_GDT_NUM_ENTRIES * X86_GDT_ENTRY_SIZE)
+#ifndef __ASSEMBLY__
+
+static inline __attribute__((always_inline)) void cpu_hlt(void)
+{
+ asm("hlt");
+}
+
+static inline ulong cpu_get_sp(void)
+{
+ ulong result;
+
+ asm volatile(
+ "mov %%esp, %%eax"
+ : "=a" (result));
+ return result;
+}
+
+#endif /* __ASSEMBLY__ */
+
#endif