aboutsummaryrefslogtreecommitdiff
path: root/kernel/arch/sh3
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/sh3')
-rw-r--r--kernel/arch/sh3/asm.h58
-rw-r--r--kernel/arch/sh3/contextspfunc.S55
-rw-r--r--kernel/arch/sh3/execsp.S146
-rw-r--r--kernel/arch/sh3/h_execregs.S86
-rw-r--r--kernel/arch/sh3/signalsphandler.S61
-rw-r--r--kernel/arch/sh3/stack_pointer.h35
-rw-r--r--kernel/arch/sh3/threadspfunc.S41
7 files changed, 482 insertions, 0 deletions
diff --git a/kernel/arch/sh3/asm.h b/kernel/arch/sh3/asm.h
new file mode 100644
index 000000000000..16389b5c299e
--- /dev/null
+++ b/kernel/arch/sh3/asm.h
@@ -0,0 +1,58 @@
+/* $NetBSD: asm.h,v 1.1 2025/04/26 22:34:52 uwe Exp $ */
+
+/*-
+ * Copyright (c) 2025 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.
+ *
+ * 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.
+ */
+
+#ifndef TESTS_KERNEL_ARCH_SH3_ASM_H
+#define TESTS_KERNEL_ARCH_SH3_ASM_H
+
+#include <machine/asm.h>
+
+/*
+ * We define convenience macros to hide the difference between direct
+ * and PIC function calls, but with variable accesses it gets a bit
+ * more unwieldy, so don't impose this on the general audience
+ */
+
+#ifdef __PIC__
+
+#define VAR_DATUM(v) .long v@GOT
+
+#define MOVL_VAR(label, reg) \
+ mov.l label, r0; \
+ mov.l @(r0, r12), reg
+
+#else
+
+#define VAR_DATUM(v) .long v
+
+#define MOVL_VAR(label, reg) \
+ mov.l label, reg; \
+
+#endif
+
+
+#endif /* TESTS_KERNEL_ARCH_SH3_ASM_H */
diff --git a/kernel/arch/sh3/contextspfunc.S b/kernel/arch/sh3/contextspfunc.S
new file mode 100644
index 000000000000..51e91133417e
--- /dev/null
+++ b/kernel/arch/sh3/contextspfunc.S
@@ -0,0 +1,55 @@
+/* $NetBSD: contextspfunc.S,v 1.1 2025/04/26 22:34:52 uwe Exp $ */
+
+/*-
+ * Copyright (c) 2025 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.
+ *
+ * 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 "asm.h"
+
+RCSID("$NetBSD: contextspfunc.S,v 1.1 2025/04/26 22:34:52 uwe Exp $")
+
+
+/*
+ * void contextspfunc()
+ *
+ * makecontext(3) function. Store the stack pointer on entry at
+ * the global variable contextsp and call contextdone.
+ */
+ENTRY(contextspfunc)
+ mov sp, r1
+ PIC_PROLOGUE(.L_GOT)
+
+ MOVL_VAR(.L_contextsp, r0)
+ mov.l r1, @r0
+
+ mov.l .L_contextdone, r0
+1: JUMP r0
+ PIC_EPILOGUE_SLOT
+
+ .p2align 2
+.L_GOT: PIC_GOT_DATUM
+.L_contextsp: VAR_DATUM(contextsp)
+.L_contextdone: CALL_DATUM(contextdone, 1b)
+ SET_ENTRY_SIZE(contextspfunc)
diff --git a/kernel/arch/sh3/execsp.S b/kernel/arch/sh3/execsp.S
new file mode 100644
index 000000000000..639ed4e6487b
--- /dev/null
+++ b/kernel/arch/sh3/execsp.S
@@ -0,0 +1,146 @@
+/* $NetBSD: execsp.S,v 1.2 2025/04/27 00:03:46 riastradh Exp $ */
+
+/*-
+ * Copyright (c) 2025 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.
+ *
+ * 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 "asm.h"
+
+RCSID("$NetBSD: execsp.S,v 1.2 2025/04/27 00:03:46 riastradh Exp $")
+
+
+/*
+ * void execsp_start()
+ *
+ * ELF entry point. Saves the stack pointer in startsp and defers
+ * to the usual csu __start routine.
+ *
+ * See sys/arch/sh3/sh3/sh3_machdep.c setregs()
+ */
+ENTRY(execsp_start)
+ mov sp, r1 // for consistency, don't need to
+ PIC_PROLOGUE_NOSAVE(.L_start_GOT)
+
+ MOVL_VAR(.L_startsp, r0)
+ mov.l r1, @r0
+
+ mov.l .L___start, r0
+1: JUMP r0
+ nop
+
+ .p2align 2
+.L_start_GOT: PIC_GOT_DATUM
+.L_startsp: VAR_DATUM(startsp)
+.L___start: CALL_DATUM(__start, 1b)
+ SET_ENTRY_SIZE(execsp_start)
+
+
+/*
+ * void execsp_ctor(void)
+ *
+ * ELF constructor. Saves the stack pointer in ctorsp and
+ * returns.
+ */
+ENTRY(execsp_ctor)
+ mov sp, r1
+ PIC_PROLOGUE(.L_ctor_GOT)
+
+ MOVL_VAR(.L_ctorsp, r0)
+ mov.l r1, @r0
+
+ rts
+ PIC_EPILOGUE_SLOT
+
+ .p2align 2
+.L_ctor_GOT: PIC_GOT_DATUM
+.L_ctorsp: VAR_DATUM(ctorsp)
+ SET_ENTRY_SIZE(execsp_ctor)
+
+ /* Make execsp_ctor a constructor. */
+ .pushsection .ctors, "aw", @progbits
+ .p2align 2
+ .long _C_LABEL(execsp_ctor)
+ .popsection
+
+
+/*
+ * int main(int argc, char **argv, ...)
+ *
+ * Main function. Saves the stack pointer in mainsp and returns
+ * zero. We will call execsp_main in execsp_dtor once dtorsp has
+ * been initialized.
+ */
+ENTRY(main)
+ mov sp, r1
+ PIC_PROLOGUE(.L_main_GOT)
+
+ MOVL_VAR(.L_mainsp, r0)
+ mov.l r1, @r0
+
+ PIC_EPILOGUE
+ rts
+ mov #0, r0
+
+ .p2align 2
+.L_main_GOT: PIC_GOT_DATUM
+.L_mainsp: VAR_DATUM(mainsp)
+ SET_ENTRY_SIZE(main)
+
+
+/*
+ * void execsp_dtor(void)
+ *
+ * ELF destructor. Saves the stack pointer in dtorsp and defers
+ * to the C execsp_main in h_execsp.c to report the stack pointers
+ * back to the t_signal_and_sp parent.
+ */
+ENTRY(execsp_dtor)
+ mov sp, r1
+ sts.l pr, @-sp
+ PIC_PROLOGUE(.L_dtor_GOT)
+
+ MOVL_VAR(.L_dtorsp, r0)
+ mov.l r1, @r0
+
+ mov.l .L_execsp_main, r0
+1: CALL r0
+ nop
+
+ PIC_EPILOGUE
+ lds.l @sp+, pr
+ rts
+ nop
+
+ .p2align 2
+.L_dtor_GOT: PIC_GOT_DATUM
+.L_dtorsp: VAR_DATUM(dtorsp)
+.L_execsp_main: CALL_DATUM(execsp_main, 1b)
+ SET_ENTRY_SIZE(execsp_dtor)
+
+ /* Make execsp_ctor a destructor. */
+ .pushsection .dtors, "aw", @progbits
+ .p2align 2
+ .long _C_LABEL(execsp_dtor)
+ .popsection
diff --git a/kernel/arch/sh3/h_execregs.S b/kernel/arch/sh3/h_execregs.S
new file mode 100644
index 000000000000..d7c91161c34a
--- /dev/null
+++ b/kernel/arch/sh3/h_execregs.S
@@ -0,0 +1,86 @@
+/* $NetBSD: h_execregs.S,v 1.1 2025/04/27 02:24:07 uwe Exp $ */
+
+/*-
+ * Copyright (c) 2025 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.
+ *
+ * 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.
+ */
+
+#define _LOCORE
+#include <machine/asm.h>
+#include <machine/mcontext.h>
+#include <sys/syscall.h>
+
+
+// ELF entry point
+ENTRY(execregs_start)
+ // __gregset_t r; // mcontext (but general regs only)
+ mov.l sp, @-sp
+ mov.l r0, @-sp
+ mov.l r1, @-sp
+ mov.l r2, @-sp
+ mov.l r3, @-sp
+ mov.l r4, @-sp
+ mov.l r5, @-sp
+ mov.l r6, @-sp
+ mov.l r7, @-sp
+ mov.l r8, @-sp
+ mov.l r9, @-sp
+ mov.l r10, @-sp
+ mov.l r11, @-sp
+ mov.l r12, @-sp
+ mov.l r13, @-sp
+ mov.l r14, @-sp
+ sts.l pr, @-sp
+ sts.l mach, @-sp
+ sts.l macl, @-sp
+ mov #0, r0
+ mov.l r0, @-sp // _REG_SR is privileged
+ mova .Lend, r0 // _REG_PC
+ mov.l @r0, r1
+ sub r1, r0
+ mov.l r0, @-sp
+ stc.l gbr, @-sp
+
+ // write(STDOUT_FILENO, &r, sizeof(__gregset_t))
+ mov #1, r4
+ mov sp, r5
+ mov #(_NGREG * 4), r6
+ mov #SYS_write, r0
+ trapa #0x80
+
+ // _exit(0)
+ mov #0, r4
+ mov #SYS_exit, r0
+ trapa #0x80
+
+ .p2align 2
+.Lend: .long .Lend - execregs_start
+ SET_ENTRY_SIZE(execregs_start)
+
+
+// main stub to simplify linking
+ENTRY(main)
+ rts
+ mov #0, r0
+ SET_ENTRY_SIZE(main)
diff --git a/kernel/arch/sh3/signalsphandler.S b/kernel/arch/sh3/signalsphandler.S
new file mode 100644
index 000000000000..e0a86ae40558
--- /dev/null
+++ b/kernel/arch/sh3/signalsphandler.S
@@ -0,0 +1,61 @@
+/* $NetBSD: signalsphandler.S,v 1.2 2025/04/26 23:49:55 uwe Exp $ */
+
+/*-
+ * Copyright (c) 2025 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.
+ *
+ * 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 "asm.h"
+RCSID("$NetBSD: signalsphandler.S,v 1.2 2025/04/26 23:49:55 uwe Exp $")
+
+
+/*
+ * void signalsphandler(int signo)
+ *
+ * Signal handler. Store the stack pointer on entry at the global
+ * variable signalsp and return.
+ */
+ENTRY(signalsphandler)
+ mov sp, r1
+#ifdef __PIC__
+ // PR kern/59327: don't touch stack as SP may be misaligned
+ // and as SuperH is a strict alignment architecture, we will
+ // get SIGBUS if we try to save registers on the stack
+ mov r12, r2
+#endif
+ PIC_PROLOGUE_NOSAVE(.L_GOT)
+
+ MOVL_VAR(.L_signalsp, r0)
+ mov.l r1, @r0
+
+#ifdef __PIC__
+ mov r2, r12
+#endif
+ rts
+ nop
+
+ .p2align 2
+.L_GOT: PIC_GOT_DATUM
+.L_signalsp: VAR_DATUM(signalsp)
+ SET_ENTRY_SIZE(signalsphandler)
diff --git a/kernel/arch/sh3/stack_pointer.h b/kernel/arch/sh3/stack_pointer.h
new file mode 100644
index 000000000000..ed3366602f56
--- /dev/null
+++ b/kernel/arch/sh3/stack_pointer.h
@@ -0,0 +1,35 @@
+/* $NetBSD: stack_pointer.h,v 1.1 2025/04/26 22:34:52 uwe Exp $ */
+
+/*-
+ * Copyright (c) 2025 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.
+ *
+ * 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.
+ */
+
+#ifndef TESTS_KERNEL_ARCH_SH3_STACK_POINTER_H
+#define TESTS_KERNEL_ARCH_SH3_STACK_POINTER_H
+
+#define MISALIGN_SP __asm __volatile("add #-1, sp" ::: "memory")
+#define FIX_SP __asm __volatile("add #+1, sp" ::: "memory")
+
+#endif /* TESTS_KERNEL_ARCH_SH3_STACK_POINTER_H */
diff --git a/kernel/arch/sh3/threadspfunc.S b/kernel/arch/sh3/threadspfunc.S
new file mode 100644
index 000000000000..de065e54191b
--- /dev/null
+++ b/kernel/arch/sh3/threadspfunc.S
@@ -0,0 +1,41 @@
+/* $NetBSD: threadspfunc.S,v 1.1 2025/04/26 22:34:52 uwe Exp $ */
+
+/*-
+ * Copyright (c) 2025 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.
+ *
+ * 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 "asm.h"
+RCSID("$NetBSD: threadspfunc.S,v 1.1 2025/04/26 22:34:52 uwe Exp $")
+
+
+/*
+ * void *threadspfunc(void *cookie)
+ *
+ * pthread_create(3) function. Return the stack pointer on entry.
+ */
+ENTRY(threadspfunc)
+ rts
+ mov sp, r0
+ SET_ENTRY_SIZE(threadspfunc)