CVS commit: src/lib/libc/arch/vax/string

2020-01-23 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 23 16:34:12 UTC 2020

Modified Files:
src/lib/libc/arch/vax/string: index.S

Log Message:
Fix name of keyword so it will worwk correctly.  :)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/vax/string/index.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/vax/string/index.S
diff -u src/lib/libc/arch/vax/string/index.S:1.4 src/lib/libc/arch/vax/string/index.S:1.5
--- src/lib/libc/arch/vax/string/index.S:1.4	Tue Jan 25 02:38:15 2011
+++ src/lib/libc/arch/vax/string/index.S	Thu Jan 23 16:34:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: index.S,v 1.4 2011/01/25 02:38:15 matt Exp $	*/
+/*	$NetBSD: index.S,v 1.5 2020/01/23 16:34:12 pgoyette Exp $	*/
 /*
  * Copyright (c) 1980, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -39,7 +39,7 @@
 #include "DEFS.h"
 
 #ifdef LIBC_SCCS
-RCSID("$NetSBD$")
+RCSID("$NetBSD: index.S,v 1.5 2020/01/23 16:34:12 pgoyette Exp $")
 #endif
 
 /* Alas not quite twice as fast as the generic C version on a uvax2 */



CVS commit: src/lib/libc/arch/vax/gen

2018-11-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Nov  8 18:19:37 UTC 2018

Modified Files:
src/lib/libc/arch/vax/gen: Makefile.inc
Added Files:
src/lib/libc/arch/vax/gen: fabsf.S

Log Message:
Attempt to implement fabsf by copying fabs and s/d/f/g.

Vax wizards, please vaxinate if I flubbed this!


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/arch/vax/gen/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/vax/gen/fabsf.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/vax/gen/Makefile.inc
diff -u src/lib/libc/arch/vax/gen/Makefile.inc:1.17 src/lib/libc/arch/vax/gen/Makefile.inc:1.18
--- src/lib/libc/arch/vax/gen/Makefile.inc:1.17	Tue Jul  6 05:59:52 2010
+++ src/lib/libc/arch/vax/gen/Makefile.inc	Thu Nov  8 18:19:37 2018
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.17 2010/07/06 05:59:52 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.18 2018/11/08 18:19:37 riastradh Exp $
 
 SRCS+=	byte_swap_2.S byte_swap_4.S bswap64.S \
-	fabs.S frexp.c \
+	fabs.S fabsf.S frexp.c \
 	fpclassifyf.c fpclassifyd.c \
 	infinityf.c infinity.c infinityl.c \
 	isfinitef.c isfinited.c \

Added files:

Index: src/lib/libc/arch/vax/gen/fabsf.S
diff -u /dev/null src/lib/libc/arch/vax/gen/fabsf.S:1.1
--- /dev/null	Thu Nov  8 18:19:37 2018
+++ src/lib/libc/arch/vax/gen/fabsf.S	Thu Nov  8 18:19:37 2018
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	The Regents of the University of California.  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. Neither the name of the University 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 REGENTS 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 REGENTS 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.
+ */
+
+#include "DEFS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	/* .asciz "@(#)fabs.s	8.1 (Berkeley) 6/4/93" */
+RCSID("$NetBSD: fabsf.S,v 1.1 2018/11/08 18:19:37 riastradh Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+/* fabsf - floating absolute value, float edition */
+
+ENTRY(fabsf, 0)
+	movf	4(%ap),%r0
+	bgeq	1f
+	mnegf	%r0,%r0
+1:
+	ret
+END(fabsf)



CVS commit: src/lib/libc/arch/vax/gen

2016-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 22:02:48 UTC 2016

Modified Files:
src/lib/libc/arch/vax/gen: __longjmp14.c

Log Message:
use __register_t


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/vax/gen/__longjmp14.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/vax/gen/__longjmp14.c
diff -u src/lib/libc/arch/vax/gen/__longjmp14.c:1.4 src/lib/libc/arch/vax/gen/__longjmp14.c:1.5
--- src/lib/libc/arch/vax/gen/__longjmp14.c:1.4	Mon Apr 28 16:22:57 2008
+++ src/lib/libc/arch/vax/gen/__longjmp14.c	Sun Jan 24 17:02:48 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: __longjmp14.c,v 1.4 2008/04/28 20:22:57 martin Exp $	*/
+/*	$NetBSD: __longjmp14.c,v 1.5 2016/01/24 22:02:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 
 struct _jmp_buf {
 	struct sigcontext jb_sc;
-	register_t jb_regs[6];
+	__register_t jb_regs[6];
 };
 
 void



CVS commit: src/lib/libc/arch/vax/sys

2013-07-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul 18 12:27:01 UTC 2013

Modified Files:
src/lib/libc/arch/vax/sys: brk.S sbrk.S

Log Message:
Make __curbrk  __minbrk hidden.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/vax/sys/brk.S
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/vax/sys/sbrk.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/vax/sys/brk.S
diff -u src/lib/libc/arch/vax/sys/brk.S:1.13 src/lib/libc/arch/vax/sys/brk.S:1.14
--- src/lib/libc/arch/vax/sys/brk.S:1.13	Tue Jan 25 02:38:15 2011
+++ src/lib/libc/arch/vax/sys/brk.S	Thu Jul 18 12:27:01 2013
@@ -31,23 +31,26 @@
 
 #if defined(SYSLIBC_SCCS)  !defined(lint)
 	/* .asciz @(#)brk.s	8.1 (Berkeley) 6/4/93 */
-RCSID($NetBSD: brk.S,v 1.13 2011/01/25 02:38:15 matt Exp $)
+RCSID($NetBSD: brk.S,v 1.14 2013/07/18 12:27:01 matt Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
-	.globl	CURBRK
+	.globl	_C_LABEL(__curbrk)
 	.globl	_C_LABEL(__minbrk)
+	.hidden _C_LABEL(__curbrk)
+	.hidden	_C_LABEL(__minbrk)
 
 #ifdef WEAK_ALIAS
 WEAK_ALIAS(brk, _brk)
 #endif
 
 ENTRY(_brk, 0)
-	cmpl	_C_LABEL(__minbrk),4(%ap)	# gtr  _end 
+	moval	_C_LABEL(__minbrk),%r5		# gtr  _end 
+	cmpl	(%r5),4(%ap)			# gtr  _end 
 	blequ	1f#   is fine
-	movl	_C_LABEL(__minbrk),4(%ap)	# shrink back to _end
+	movl	(%r5),4(%ap)			# shrink back to _end
 1:	chmk	$ SYS_break			# do it
 	jcs	err
-	movl	4(%ap),CURBRK
+	movl	4(%ap),_C_LABEL(__curbrk)
 	clrl	%r0
 	ret
 err:

Index: src/lib/libc/arch/vax/sys/sbrk.S
diff -u src/lib/libc/arch/vax/sys/sbrk.S:1.11 src/lib/libc/arch/vax/sys/sbrk.S:1.12
--- src/lib/libc/arch/vax/sys/sbrk.S:1.11	Tue Jan 25 02:38:15 2011
+++ src/lib/libc/arch/vax/sys/sbrk.S	Thu Jul 18 12:27:01 2013
@@ -31,12 +31,14 @@
 
 #if defined(SYSLIBC_SCCS)  !defined(lint)
 	/* .asciz @(#)sbrk.s	8.1 (Berkeley) 6/4/93 */
-RCSID($NetBSD: sbrk.S,v 1.11 2011/01/25 02:38:15 matt Exp $)
+RCSID($NetBSD: sbrk.S,v 1.12 2013/07/18 12:27:01 matt Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 	.globl	_end
 	.globl	_C_LABEL(__minbrk)
-	.globl	CURBRK
+	.globl	_C_LABEL(__curbrk)
+	.hidden	_C_LABEL(__minbrk)
+	.hidden	_C_LABEL(__curbrk)
 
 #ifdef WEAK_ALIAS
 WEAK_ALIAS(sbrk, _sbrk)
@@ -45,19 +47,20 @@ WEAK_ALIAS(sbrk, _sbrk)
 	.data
 _C_LABEL(__minbrk):
 	.long	_end
-CURBRK:
+_C_LABEL(__curbrk):
 	.long	_end
 	.text
 
 ENTRY(_sbrk, 0)
-	addl3	CURBRK,4(%ap),-(%sp)
+	moval	_C_LABEL(__curbrk),%r5
+	addl3	(%r5),4(%ap),-(%sp)
 	pushl	$1
 	movl	%ap,%r3
 	movl	%sp,%ap
 	chmk	$ SYS_break
 	jcs 	err
-	movl	CURBRK,%r0
-	addl2	4(%r3),CURBRK
+	movl	(%r5),%r0
+	addl2	4(%r3),(%r5)
 	ret
 err:
 	jmp	CERROR+2



CVS commit: src/lib/libc/arch/vax

2011-11-21 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Nov 21 16:17:48 UTC 2011

Modified Files:
src/lib/libc/arch/vax/gen: alloca.S
src/lib/libc/arch/vax/sys: __vfork14.S getcontext.S

Log Message:
gcc 4.5 on vax creates PLT stubs with an entry mask of 0xffc
rather than 0 like gcc 4.1 did, so the sneaky assembly functions
that ret without really returning now clobber their registers.
adjust these functions to avoid this problem.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/vax/gen/alloca.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/vax/sys/__vfork14.S
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/vax/sys/getcontext.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/vax/gen/alloca.S
diff -u src/lib/libc/arch/vax/gen/alloca.S:1.4 src/lib/libc/arch/vax/gen/alloca.S:1.5
--- src/lib/libc/arch/vax/gen/alloca.S:1.4	Tue Jan 25 02:38:15 2011
+++ src/lib/libc/arch/vax/gen/alloca.S	Mon Nov 21 16:17:48 2011
@@ -31,17 +31,17 @@
 
 #if defined(LIBC_SCCS)  !defined(lint)
 	/* .asciz @(#)alloca.s	8.1 (Berkeley) 6/4/93 */
-RCSID($NetBSD: alloca.S,v 1.4 2011/01/25 02:38:15 matt Exp $)
+RCSID($NetBSD: alloca.S,v 1.5 2011/11/21 16:17:48 chs Exp $)
 #endif /* LIBC_SCCS and not lint */
 
 ENTRY(alloca, 0)
 	movl	4(%ap),%r0	# get allocation size
-	movl	16(%fp),%r2	# save return address before we smash it
+	movl	16(%fp),%r1	# save return address before we smash it
 	movab	here,16(%fp)
 	ret
 here:
 	subl2	%r0,%sp		# create stack space
 	bicl2	$3,%sp		# align to longword boundary
 	movl	%sp,%r0
-	jmp	(%r2)
+	jmp	(%r1)
 END(alloca)

Index: src/lib/libc/arch/vax/sys/__vfork14.S
diff -u src/lib/libc/arch/vax/sys/__vfork14.S:1.6 src/lib/libc/arch/vax/sys/__vfork14.S:1.7
--- src/lib/libc/arch/vax/sys/__vfork14.S:1.6	Tue Jan 25 02:38:15 2011
+++ src/lib/libc/arch/vax/sys/__vfork14.S	Mon Nov 21 16:17:48 2011
@@ -31,7 +31,7 @@
 
 #if defined(SYSLIBC_SCCS)  !defined(lint)
 	/* .asciz @(#)Ovfork.s	8.1 (Berkeley) 6/4/93 */
-RCSID($NetBSD: __vfork14.S,v 1.6 2011/01/25 02:38:15 matt Exp $)
+RCSID($NetBSD: __vfork14.S,v 1.7 2011/11/21 16:17:48 chs Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 /*
@@ -51,10 +51,11 @@ RCSID($NetBSD: __vfork14.S,v 1.6 2011/0
  */
 
 ENTRY(__vfork14, 0)
-	movl	16(%fp),%r2	# save return address before we smash it
+	movl	16(%fp),%r0	# save return address before we smash it
 	movab	here,16(%fp)
 	ret
 here:
+	movl	%r0,%r2
 	chmk	$ SYS___vfork14
 	bcs	err		# if failed, set errno and return -1
 	/* this next trick is Chris Torek's fault */

Index: src/lib/libc/arch/vax/sys/getcontext.S
diff -u src/lib/libc/arch/vax/sys/getcontext.S:1.5 src/lib/libc/arch/vax/sys/getcontext.S:1.6
--- src/lib/libc/arch/vax/sys/getcontext.S:1.5	Tue Jan 25 02:38:15 2011
+++ src/lib/libc/arch/vax/sys/getcontext.S	Mon Nov 21 16:17:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: getcontext.S,v 1.5 2011/01/25 02:38:15 matt Exp $	*/
+/*	$NetBSD: getcontext.S,v 1.6 2011/11/21 16:17:48 chs Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include SYS.h
 
 #ifdef SYSLIBC_SCCS
-RCSID($NetBSD: getcontext.S,v 1.5 2011/01/25 02:38:15 matt Exp $)
+RCSID($NetBSD: getcontext.S,v 1.6 2011/11/21 16:17:48 chs Exp $)
 #endif
 
 #ifdef WEAK_ALIAS
@@ -48,8 +48,8 @@ ENTRY(_getcontext, 0)
 	jcc	1f
 	jmp	CERROR+2		/* badness happened */
 
-1:	movl	4(%ap),%r2		/* ptr to ucontext */
-	movl	16(%fp),%r3		/* PC to return to */
+1:	movl	4(%ap),%r0		/* ptr to ucontext */
+	movl	16(%fp),%r1		/* PC to return to */
 	movab	2f,16(%fp)		/* let's return early */
 	ret
 	/*
@@ -59,8 +59,9 @@ ENTRY(_getcontext, 0)
 	 * the callers state but we still have control.
 	 */
 	_ALIGN_TEXT
-2:	movq	%ap,(36+12*4)(%r2)	/* adjust AP + SP */
-	movl	%fp,(36+14*4)(%r2)	/* adjust FP */
-	movl	%r3,(36+15*4)(%r2)	/* adjust PC */
-	jmp	(%r3)			/* and return */
+2:	movq	%ap,(36+12*4)(%r0)	/* adjust AP + SP */
+	movl	%fp,(36+14*4)(%r0)	/* adjust FP */
+	movl	%r3,(36+15*4)(%r0)	/* adjust PC */
+	clrl	%r0
+	jmp	(%r1)			/* and return */
 END(_getcontext)



CVS commit: src/lib/libc/arch/vax/gen

2009-06-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun  3 01:02:29 UTC 2009

Modified Files:
src/lib/libc/arch/vax/gen: Makefile.inc
Added Files:
src/lib/libc/arch/vax/gen: _lwp.c

Log Message:
add _lwp_makecontext for the vax.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/vax/gen/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/vax/gen/_lwp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/vax/gen/Makefile.inc
diff -u src/lib/libc/arch/vax/gen/Makefile.inc:1.14 src/lib/libc/arch/vax/gen/Makefile.inc:1.15
--- src/lib/libc/arch/vax/gen/Makefile.inc:1.14	Thu Mar  4 18:42:39 2004
+++ src/lib/libc/arch/vax/gen/Makefile.inc	Tue Jun  2 21:02:28 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.14 2004/03/04 23:42:39 kleink Exp $
+#	$NetBSD: Makefile.inc,v 1.15 2009/06/03 01:02:28 christos Exp $
 
 SRCS+=	byte_swap_2.S byte_swap_4.S bswap64.S \
 	fabs.S frexp.c \
@@ -11,7 +11,7 @@
 	signbitf.c signbitd.c \
 	swapcontext.S \
 	udiv.S urem.S \
-	__setjmp14.S __sigsetjmp14.S _setjmp.S 
+	__setjmp14.S __sigsetjmp14.S _lwp.c _setjmp.S 
 
 # ABI compatibility for libc.so.12
 SRCS+=	isinf.c isnan.c

Added files:

Index: src/lib/libc/arch/vax/gen/_lwp.c
diff -u /dev/null src/lib/libc/arch/vax/gen/_lwp.c:1.1
--- /dev/null	Tue Jun  2 21:02:29 2009
+++ src/lib/libc/arch/vax/gen/_lwp.c	Tue Jun  2 21:02:28 2009
@@ -0,0 +1,79 @@
+/*	$NetBSD: _lwp.c,v 1.1 2009/06/03 01:02:28 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas
+ *
+ * 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.
+ *
+ * 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.
+ */
+
+#include sys/cdefs.h
+#if defined(LIBC_SCCS)  !defined(lint)
+__RCSID($NetBSD: _lwp.c,v 1.1 2009/06/03 01:02:28 christos Exp $);
+#endif /* LIBC_SCCS and not lint */
+
+#include namespace.h
+#include sys/types.h
+#include inttypes.h
+#include ucontext.h
+#include lwp.h
+#include stdlib.h
+
+void
+_lwp_makecontext(ucontext_t *u, void (*start)(void *),
+void *arg, void *private, caddr_t stack_base, size_t stack_size)
+{
+	__greg_t *gr = u-uc_mcontext.__gregs;
+	int *sp;
+
+	getcontext(u);
+	u-uc_link = NULL;
+
+	u-uc_stack.ss_sp = stack_base;
+	u-uc_stack.ss_size = stack_size;
+
+	/* Align to a word */
+	/* LINTED uintptr_t is safe */
+	sp = (int *)((uintptr_t)(stack_base + stack_size)  ~0x3);
+	
+	/*
+	 * Allocate necessary stack space for arguments including arg count
+	 * and call frame
+	 */
+	sp -= 1 + 1 + 5;
+
+	sp[0] = 0;			/* condition handler is null */
+	sp[1] = 0x2000;		/* make this a CALLS frame */
+	sp[2] = 0;			/* saved argument pointer */
+	sp[3] = 0;			/* saved frame pointer */
+	sp[4] = (intptr_t)_lwp_exit + 2;/* return via _lwp_exit */
+	sp[5] = 1;			/* argc */
+	sp[6] = (intptr_t)arg;		/* argv */
+	
+	gr[_REG_AP] = (__greg_t)(sp + 5);
+	gr[_REG_SP] = (__greg_t)sp;
+	gr[_REG_FP] = (__greg_t)sp;
+	gr[_REG_PC] = (__greg_t)start + 2;
+}