diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-06-21 00:57:00 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2012-06-21 00:57:00 +0000 |
commit | 867c8588faf5fba418fc7c3a85aa2bd4c3327e01 (patch) | |
tree | e98c388fcdff4a138a38722ee463c1b12f6c133a /lib/libc/arch/arm | |
parent | 28222fd1268ab97426703666e99f70ed942e847b (diff) |
__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/arm')
-rw-r--r-- | lib/libc/arch/arm/sys/tfork_thread.S | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/libc/arch/arm/sys/tfork_thread.S b/lib/libc/arch/arm/sys/tfork_thread.S index 0ece8d15d2a..4115477f28d 100644 --- a/lib/libc/arch/arm/sys/tfork_thread.S +++ b/lib/libc/arch/arm/sys/tfork_thread.S @@ -1,4 +1,4 @@ -/* $OpenBSD: tfork_thread.S,v 1.1 2012/03/22 00:44:55 guenther Exp $ */ +/* $OpenBSD: tfork_thread.S,v 1.2 2012/06/21 00:56:59 guenther Exp $ */ /* * Copyright (c) 2005 Dale Rahn <drahn@openbsd.org> * @@ -19,30 +19,23 @@ #include "SYS.h" /* - * r0 r1 r2 r3 - * __tfork_thread(param, stack_addr, start_fnc, start_arg); + * r0 r1 r2 r3 + * __tfork_thread(param, psize, start_fnc, start_arg); */ ENTRY(__tfork_thread) - stmdb sp!, {r4} - mov r4, r1 - - SYSTRAP(__tfork) - bcs 1f + bcs 1f /* XXX can this be PIC_SYM(CERROR, PLT) ? */ /* check if we are parent or child */ cmp r0, #0 - ldmneia sp!, {r4} movne pc, lr /* child */ - mov sp, r4 mov r0, r3 mov lr, pc mov pc, r2 nop SYSTRAP(__threxit) 1: - ldmia sp!, {r4} - b PIC_SYM(CERROR, PLT) + b PIC_SYM(CERROR, PLT) |