summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/arm/rtems/asm.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/cpu/arm/rtems/asm.h')
-rw-r--r--cpukit/score/cpu/arm/rtems/asm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/cpukit/score/cpu/arm/rtems/asm.h b/cpukit/score/cpu/arm/rtems/asm.h
index 04c5360790..f8b027cf1b 100644
--- a/cpukit/score/cpu/arm/rtems/asm.h
+++ b/cpukit/score/cpu/arm/rtems/asm.h
@@ -141,4 +141,20 @@
.globl name ; name: ; .globl name ## _arm ; name ## _arm:
#endif
+.macro SWITCH_FROM_THUMB_TO_ARM
+#ifdef __thumb__
+.align 2
+ bx pc
+.arm
+#endif /* __thumb__ */
+.endm
+
+.macro SWITCH_FROM_ARM_TO_THUMB REG
+#ifdef __thumb__
+ add \REG, pc, #1
+ bx \REG
+.thumb
+#endif /* __thumb__ */
+.endm
+
#endif /* _RTEMS_ASM_H */