diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-02-22 09:49:52 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-05-03 15:05:38 +0200 |
commit | 6b8e614bac8ef7e3a69ec597894c7fc6c217aff4 (patch) | |
tree | 733b580b5097f6496acd01661aa076907ea0965f /arch | |
parent | acbeeab989f7a58e208590ce57f6b9696018cdf5 (diff) | |
download | barebox-6b8e614bac8ef7e3a69ec597894c7fc6c217aff4.tar.gz barebox-6b8e614bac8ef7e3a69ec597894c7fc6c217aff4.tar.xz |
add arm helper function to determine the program counter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/common.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/include/asm/common.h b/arch/arm/include/asm/common.h index 9afcff78f6..f3a87c81c9 100644 --- a/arch/arm/include/asm/common.h +++ b/arch/arm/include/asm/common.h @@ -1 +1,19 @@ +#ifndef __ASM_ARM_COMMON_H +#define __ASM_ARM_COMMON_H + #define ARCH_SHUTDOWN + +static inline unsigned long get_pc(void) +{ + unsigned long pc; + + __asm__ __volatile__( + "mov %0, pc\n" + : "=r" (pc) + : + : "memory"); + + return pc; +} + +#endif /* __ASM_ARM_COMMON_H */ |