summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/vax/sys/tfork_thread.S
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-06-21 00:56:59 +0000
committerguenther <guenther@openbsd.org>2012-06-21 00:56:59 +0000
commit16b62b6a0b93be6a70f097edd49f4c661f85cd4f (patch)
treeb60ec958758bfe01ad491979d73feeea25c66228 /lib/libc/arch/vax/sys/tfork_thread.S
parentfix strlcpy truncation check. from carsten at debian org, ok markus (diff)
downloadwireguard-openbsd-16b62b6a0b93be6a70f097edd49f4c661f85cd4f.tar.xz
wireguard-openbsd-16b62b6a0b93be6a70f097edd49f4c661f85cd4f.zip
__tfork() needs to set the stack address of the new thread in the kernel,
so that it can't get a signal while still running on the parent thread's stack. Also, pass in sizeof(struct __tfork) to provide forward compat when more members are added. This is an ABI change, so switch syscall numbers and bump lib majors this time. ok deraadt@ matthew@
Diffstat (limited to 'lib/libc/arch/vax/sys/tfork_thread.S')
-rw-r--r--lib/libc/arch/vax/sys/tfork_thread.S16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/libc/arch/vax/sys/tfork_thread.S b/lib/libc/arch/vax/sys/tfork_thread.S
index 1d22f1e924b..123c4a83641 100644
--- a/lib/libc/arch/vax/sys/tfork_thread.S
+++ b/lib/libc/arch/vax/sys/tfork_thread.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: tfork_thread.S,v 1.1 2012/03/22 00:44:56 guenther Exp $ */
+/* $OpenBSD: tfork_thread.S,v 1.2 2012/06/21 00:56:59 guenther Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat
@@ -28,15 +28,14 @@
#include "SYS.h"
/*
- * int __tfork_thread(const struct __tfork *param, void *stack, void (*func)(void *), void *arg);
+ * int __tfork_thread(const struct __tfork *param, size_t psize, void (*func)(void *), void *arg);
*/
-ENTRY(__tfork_thread, R2|R3|R4)
+ENTRY(__tfork_thread, R2|R3)
/*
* Save thread creation arguments into registers.
*/
- movl 8(ap), r2 /* stack */
- movl 12(ap), r3 /* func */
- movl 16(ap), r4 /* arg */
+ movl 12(ap), r2 /* func */
+ movl 16(ap), r3 /* arg */
__DO_SYSCALL(__tfork)
jcs 9f
@@ -55,9 +54,8 @@ ENTRY(__tfork_thread, R2|R3|R4)
* Note that since we can not pass a register to calls, we need
* to waste 4 bytes of stack in every thread.
*/
- movl r2, sp /* stack */
- pushl r3 /* func */
- pushl r4 /* arg */
+ pushl r2 /* func */
+ pushl r3 /* arg */
calls $1, *4(sp) /* func */
__DO_SYSCALL(__threxit)