replace these placeholders with real implementations.

translated from the mips version.
This commit is contained in:
chs 2004-07-18 20:48:04 +00:00
parent c2f33bd76d
commit 2f80fec241
3 changed files with 61 additions and 48 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: __clone.S,v 1.4 2004/07/01 06:50:04 skrll Exp $ */
/* $NetBSD: __clone.S,v 1.5 2004/07/18 20:48:04 chs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -44,11 +44,51 @@
#endif
.import __cerror, code
/*
* int clone(int (*fn)(void *), void *stack, int flags, void *arg);
*/
/* XXX - this is unimplemented at this time. */
ENTRY(__clone, 0)
/*
* Sanity checks: func and stack may not be NULL.
*/
ldi EINVAL, %t1
b,n __cerror
comb,= %r0, %arg0, __cerror
nop
comb,= %r0, %arg1, __cerror
nop
/*
* Put the func and arg arguments into a frame in the child's stack.
*/
ldo (HPPA_FRAME_SIZE * 2)(%arg1), %arg1
stw %arg0, HPPA_FRAME_ARG(0)(%arg1)
stw %arg3, HPPA_FRAME_ARG(1)(%arg1)
/*
* The system call expects (flags, stack).
*/
copy %arg2, %arg0
SYSCALL(__clone)
comb,<>,n %r0, %ret1, 9f
bv,n %r0(%rp)
9: /*
* Child: Reload the function and argument from the new stack.
*/
ldw HPPA_FRAME_ARG(0)(%sp), %r22
ldw HPPA_FRAME_ARG(1)(%sp), %arg0
/* Call the clone's entry point. */
stw %r19, HPPA_FRAME_ARG(2)(%sp)
bl $$dyncall, %r31
copy %r31, %rp
ldw HPPA_FRAME_ARG(2)(%sp), %r19
/* Pass the return value to _exit(). */
copy %ret0, %arg0
PIC_CALL(_exit)
/* NOTREACHED */
EXIT(__clone)

View File

@ -1,4 +1,4 @@
/* $NetBSD: getcontext.S,v 1.2 2004/07/01 06:50:04 skrll Exp $ */
/* $NetBSD: getcontext.S,v 1.3 2004/07/18 20:48:04 chs Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,12 +37,21 @@
*/
#include <sys/errno.h>
#include <machine/mcontext.h>
#include "SYS.h"
.import __cerror, code
#ifdef WEAK_ALIAS
WEAK_ALIAS(getcontext, _getcontext)
#endif
/* XXX - this is unimplemented at this time. */
ENTRY(getcontext, 0)
ldi EINVAL, %t1
b,n __cerror
EXIT(getcontext)
#define _OFFSETOF_UC_GREGS (10 * 4)
#define SZREG 4
ENTRY(_getcontext, 0)
SYSCALL(getcontext)
stw %rp, (_OFFSETOF_UC_GREGS + _REG_PCOQH * SZREG)(%arg0)
ldo 4(%rp), %r1
stw %r1, (_OFFSETOF_UC_GREGS + _REG_PCOQT * SZREG)(%arg0)
bv %r0(%rp)
stw %r0, (_OFFSETOF_UC_GREGS + _REG_RET0 * SZREG)(%arg0)
EXIT(_getcontext)

View File

@ -1,41 +1,5 @@
/* $NetBSD: shmat.S,v 1.2 2003/10/06 05:30:21 matt Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/* $NetBSD: shmat.S,v 1.3 2004/07/18 20:48:04 chs Exp $ */
#include "SYS.h"
ENTRY(shmat, 0)
bv %r0(%rp)
copy %arg0, %ret0
EXIT(shmat)
RSYSCALL(shmat)