summaryrefslogtreecommitdiff
path: root/arch/arm/lpc17xx/setjmp.s
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-02-05 04:35:27 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-02-05 04:35:27 +0100
commit61ba39a23786a7ae9694705af1d146c00a319144 (patch)
treef9ad51bee751f7e878ac3e7ad4d45f993605c37d /arch/arm/lpc17xx/setjmp.s
parente2d292afdb43cd7d9391128563384e1edd53c52e (diff)
Getting rid of newlib, starting to implement a libc. Highly experimental, highly untested.
Diffstat (limited to 'arch/arm/lpc17xx/setjmp.s')
-rw-r--r--arch/arm/lpc17xx/setjmp.s33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/lpc17xx/setjmp.s b/arch/arm/lpc17xx/setjmp.s
new file mode 100644
index 0000000..9ffffc2
--- /dev/null
+++ b/arch/arm/lpc17xx/setjmp.s
@@ -0,0 +1,33 @@
+.cpu cortex-m3
+.syntax unified
+
+.section ".text.setjmp","x",%progbits
+.align 2
+.thumb
+.thumb_func
+.globl setjmp
+.type setjmp, %function
+setjmp:
+.fnstart
+ mov ip, sp
+ stmea a1!, {v1-v7, fp, ip, lr}
+ mov a1, #0
+ bx lr
+.fnend
+.size setjmp,.-setjmp
+
+.section ".text.longjmp","x",%progbits
+.align 2
+.thumb
+.thumb_func
+.globl longjmp
+.type longjmp, %function
+longjmp:
+.fnstart
+ ldmfd a1!, {v1-v7, fp, ip, lr}
+ mov sp, ip
+ movs a1, a2
+ it eq
+ moveq a1, #1
+.fnend
+.size longjmp,.-longjmp