Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion context/switch-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ FSIZE(switch_frame)
FNAME(create_frame)
" stmfd r0!, {r1, r2}\n" // Save arguments for new coroutine
" mov ip, lr\n" // Save LR so can use same STM slot
" ldr lr, =action_entry\n"
" adr lr, action_entry\n"
" stmfd r0!, {r4, r5, r6, r7, r8, r9, sl, fp, lr}\n"
IF_VFP_FP(
" fstmfdd r0!, {d8-d15}\n")
Expand Down
8 changes: 7 additions & 1 deletion context/switch-arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ FSIZE(switch_frame)
FNAME(create_frame)
" stp x1, x2, [x0, #-16]!\n"
" mov x16, lr\n" // Save LR so can use same STP slot
" ldr lr, =action_entry\n"
// This should be simply
// adr lr,action_entry
// but it would appear that on Apple the target for adr needs to be both
// local AND known at the instant it is seen by the assembler. The
// reference .1f is an alias for action_entry below to work around this
" adr lr, .1f\n"
" stp x19, x20, [x0, #-16]!\n"
" stp x21, x22, [x0, #-16]!\n"
" stp x23, x24, [x0, #-16]!\n"
Expand All @@ -118,6 +123,7 @@ FNAME(create_frame)
" stp d14, d15, [x0, #-16]!\n"
" br x16\n"

"1:\n"
"action_entry:\n"
// Receive control after first switch to new frame. Top of stack has
// the saved context and routine to call, switch argument is in r0.
Expand Down
Loading