• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * ===========================================================================
3 *  CPU-version-specific defines
4 * ===========================================================================
5 */
6
7/*
8 * Macro for "LDR PC,xxx", which is not allowed pre-ARMv5.  Essentially a
9 * one-way branch.
10 *
11 * May modify IP.  Does not modify LR.
12 */
13.macro  LDR_PC source
14    ldr     ip, \source
15    bx      ip
16.endm
17
18/*
19 * Macro for "MOV LR,PC / LDR PC,xxx", which is not allowed pre-ARMv5.
20 * Jump to subroutine.
21 *
22 * May modify IP and LR.
23 */
24.macro  LDR_PC_LR source
25    ldr     ip, \source
26    mov     lr, pc
27    bx      ip
28.endm
29
30/*
31 * Macro for "LDMFD SP!,{...regs...,PC}".
32 *
33 * May modify IP and LR.
34 */
35.macro  LDMFD_PC regs
36    ldmfd   sp!, {\regs,lr}
37    bx      lr
38.endm
39
40/*
41 * Macro for data memory barrier; not meaningful pre-ARMv6K.
42 */
43.macro  SMP_DMB
44.endm
45