about summary refs log tree commit diff
path: root/src/setjmp/powerpc/setjmp.s
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-11-14 14:01:39 -0500
committerRich Felker <dalias@aerifal.cx>2012-11-14 14:01:39 -0500
commitc6d441e3a246370d9c459396ec22b096db93850e (patch)
treefa3d4a4ca03531ceab9e60abb50e37780fce60ed /src/setjmp/powerpc/setjmp.s
parentc4a35f8c2a4b1a7e62a4b9e5b2748fb4fbcace79 (diff)
parent1c8eb8bad791fe9d01d0d4ab77882db634fa933d (diff)
downloadmusl-c6d441e3a246370d9c459396ec22b096db93850e.tar.gz
musl-c6d441e3a246370d9c459396ec22b096db93850e.tar.xz
musl-c6d441e3a246370d9c459396ec22b096db93850e.zip
Merge remote-tracking branch 'ppc-port/ppc-squashed'
Diffstat (limited to 'src/setjmp/powerpc/setjmp.s')
-rw-r--r--src/setjmp/powerpc/setjmp.s40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/setjmp/powerpc/setjmp.s b/src/setjmp/powerpc/setjmp.s
new file mode 100644
index 00000000..27c975e4
--- /dev/null
+++ b/src/setjmp/powerpc/setjmp.s
@@ -0,0 +1,40 @@
+        .global __setjmp
+        .global _setjmp
+        .global setjmp
+        .type   __setjmp,@function
+        .type   _setjmp,@function
+        .type   setjmp,@function
+__setjmp:
+_setjmp:
+setjmp:
+	# 0) store IP int 0, then into the jmpbuf pointed to by r3 (first arg)
+	mflr 0
+	stw 0, 0(3)
+	# 1) store reg1 (SP)
+	stw 1, 4(3)
+	# 2) store cr
+	mfcr 0
+	stw 0, 8(3)
+	# 3) store r14-31
+	stw 14, 12(3)
+	stw 15, 16(3)
+	stw 16, 20(3)
+	stw 17, 24(3)
+	stw 18, 28(3)
+	stw 19, 32(3)
+	stw 20, 36(3)
+	stw 21, 40(3)
+	stw 22, 44(3)
+	stw 23, 48(3)
+	stw 24, 52(3)
+	stw 25, 56(3)
+	stw 26, 60(3)
+	stw 27, 64(3)
+	stw 28, 68(3)
+	stw 29, 72(3)
+	stw 30, 76(3)
+	stw 31, 80(3)
+	# 4) set return value to 0
+	li 3, 0
+	# 5) return
+	blr