about summary refs log tree commit diff
path: root/src/signal/powerpc64
diff options
context:
space:
mode:
Diffstat (limited to 'src/signal/powerpc64')
-rw-r--r--src/signal/powerpc64/restore.s11
-rw-r--r--src/signal/powerpc64/sigsetjmp.s30
2 files changed, 41 insertions, 0 deletions
diff --git a/src/signal/powerpc64/restore.s b/src/signal/powerpc64/restore.s
new file mode 100644
index 00000000..4d41c27a
--- /dev/null
+++ b/src/signal/powerpc64/restore.s
@@ -0,0 +1,11 @@
+	.global __restore
+	.type __restore,%function
+__restore:
+	li      0, 119 #__NR_sigreturn
+	sc
+
+	.global __restore_rt
+	.type __restore_rt,%function
+__restore_rt:
+	li      0, 172 # __NR_rt_sigreturn
+	sc
diff --git a/src/signal/powerpc64/sigsetjmp.s b/src/signal/powerpc64/sigsetjmp.s
new file mode 100644
index 00000000..52ac1d03
--- /dev/null
+++ b/src/signal/powerpc64/sigsetjmp.s
@@ -0,0 +1,30 @@
+	.global sigsetjmp
+	.global __sigsetjmp
+	.type sigsetjmp,%function
+	.type __sigsetjmp,%function
+	.hidden ___setjmp
+sigsetjmp:
+__sigsetjmp:
+	addis 2, 12, .TOC.-__sigsetjmp@ha
+	addi  2,  2, .TOC.-__sigsetjmp@l
+	.localentry sigsetjmp,.-sigsetjmp
+	.localentry __sigsetjmp,.-__sigsetjmp
+
+	cmpwi cr7, 4, 0
+	beq-  cr7, ___setjmp
+
+	mflr  5
+	std   5, 512(3)
+	std  16, 512+8+8(3)
+	mr   16, 3
+
+	bl ___setjmp
+
+	mr   4,  3
+	mr   3, 16
+	ld   5, 512(3)
+	mtlr 5
+	ld  16, 512+8+8(3)
+
+.hidden __sigsetjmp_tail
+	b __sigsetjmp_tail