123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #include <sysdep.h>
- #include "ucontext_i.h"
- .syntax unified
- .text
- ENTRY(swapcontext)
-
- push {r0,r1,r3,r14}
- cfi_adjust_cfa_offset (16)
- cfi_rel_offset (r0,0)
- cfi_rel_offset (r1,4)
- cfi_rel_offset (r3,8)
- cfi_rel_offset (r14,12)
- bl __getcontext
- mov r4, r0
- pop {r0,r1,r3,r14}
- cfi_adjust_cfa_offset (-16)
- cfi_restore (r0)
- cfi_restore (r1)
- cfi_restore (r3)
- cfi_restore (r14)
-
- cmp r4, #0
- itt ne
- movne r0, r4
- RETINSTR(ne, r14)
-
- str r13,[r0, #MCONTEXT_ARM_SP]
- str r14,[r0, #MCONTEXT_ARM_LR]
- str r14,[r0, #MCONTEXT_ARM_PC]
-
- mov r0, r1
- b __setcontext
- END(swapcontext)
|