summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/sparc/sys
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/sparc/sys
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/sparc/sys')
-rw-r--r--lib/libc/arch/sparc/sys/tfork_thread.S12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/libc/arch/sparc/sys/tfork_thread.S b/lib/libc/arch/sparc/sys/tfork_thread.S
index 882a07f7234..09bf0083810 100644
--- a/lib/libc/arch/sparc/sys/tfork_thread.S
+++ b/lib/libc/arch/sparc/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,11 +28,9 @@
#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)
- mov %o1, %o4 /* save stack */
-
/*
* We can not invoke __tfork as a G2-style system call since we want
* different return paths.
@@ -54,12 +52,8 @@ ENTRY(__tfork_thread)
1:
/*
- * In child process: switch stack, invoke function, then exit.
- * Don't forget to allocate room for a window save on the new
- * stack!
+ * In child process: invoke function, then exit.
*/
- sub %g0, %g0, %fp
- sub %o4, 96, %sp /* stack */
call %o2 /* func */
mov %o3, %o0 /* arg */