summaryrefslogtreecommitdiff
path: root/coroutine/arm32/Context.S
diff options
context:
space:
mode:
Diffstat (limited to 'coroutine/arm32/Context.S')
-rw-r--r--coroutine/arm32/Context.S20
1 files changed, 15 insertions, 5 deletions
diff --git a/coroutine/arm32/Context.S b/coroutine/arm32/Context.S
index 195364fb65..945e4f82d5 100644
--- a/coroutine/arm32/Context.S
+++ b/coroutine/arm32/Context.S
@@ -5,18 +5,28 @@
## Copyright, 2018, by Samuel Williams.
##
+#define TOKEN_PASTE(x,y) x##y
+
+.file "Context.S"
.text
+.globl PREFIXED_SYMBOL(coroutine_transfer)
+.align 2
+.type PREFIXED_SYMBOL(coroutine_transfer),%function
+.syntax unified
-.globl coroutine_transfer
-coroutine_transfer:
+PREFIXED_SYMBOL(coroutine_transfer):
# Save caller state (8 registers + return address)
push {r4-r11,lr}
-
+
# Save caller stack pointer
str sp, [r0]
-
+
# Restore callee stack pointer
ldr sp, [r1]
-
+
# Restore callee state (8 registers program counter)
pop {r4-r11,pc}
+
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif