Module Name: src Committed By: christos Date: Mon Nov 4 15:45:25 UTC 2024
Modified Files: src/distrib/sets/lists/comp: ad.arm ad.m68k ad.mips ad.powerpc ad.riscv ad.sh3 md.alpha md.amd64 md.hppa md.i386 md.ia64 md.or1k md.sparc md.vax src/include: lwp.h src/sys/arch/alpha/include: Makefile mcontext.h src/sys/arch/amd64/include: Makefile mcontext.h src/sys/arch/arm/include: Makefile mcontext.h src/sys/arch/hppa/include: Makefile mcontext.h src/sys/arch/i386/include: Makefile mcontext.h src/sys/arch/ia64/include: Makefile mcontext.h src/sys/arch/m68k/include: Makefile mcontext.h src/sys/arch/mips/include: Makefile mcontext.h src/sys/arch/or1k/include: Makefile mcontext.h src/sys/arch/powerpc/include: Makefile mcontext.h src/sys/arch/riscv/include: Makefile mcontext.h src/sys/arch/sh3/include: Makefile mcontext.h src/sys/arch/sparc/include: Makefile mcontext.h src/sys/arch/vax/include: Makefile mcontext.h Removed Files: src/sys/arch/alpha/include: lwp.h src/sys/arch/amd64/include: lwp.h src/sys/arch/arm/include: lwp.h src/sys/arch/hppa/include: lwp.h src/sys/arch/i386/include: lwp.h src/sys/arch/ia64/include: lwp.h src/sys/arch/m68k/include: lwp.h src/sys/arch/mips/include: lwp.h src/sys/arch/or1k/include: lwp.h src/sys/arch/powerpc/include: lwp.h src/sys/arch/riscv/include: lwp.h src/sys/arch/sh3/include: lwp.h src/sys/arch/sparc/include: lwp.h src/sys/arch/vax/include: lwp.h Log Message: Undo previous lwp.h change. To generate a diff of this commit: cvs rdiff -u -r1.112 -r1.113 src/distrib/sets/lists/comp/ad.arm cvs rdiff -u -r1.74 -r1.75 src/distrib/sets/lists/comp/ad.m68k cvs rdiff -u -r1.95 -r1.96 src/distrib/sets/lists/comp/ad.mips cvs rdiff -u -r1.109 -r1.110 src/distrib/sets/lists/comp/ad.powerpc cvs rdiff -u -r1.24 -r1.25 src/distrib/sets/lists/comp/ad.riscv cvs rdiff -u -r1.50 -r1.51 src/distrib/sets/lists/comp/ad.sh3 cvs rdiff -u -r1.83 -r1.84 src/distrib/sets/lists/comp/md.alpha cvs rdiff -u -r1.304 -r1.305 src/distrib/sets/lists/comp/md.amd64 cvs rdiff -u -r1.19 -r1.20 src/distrib/sets/lists/comp/md.hppa cvs rdiff -u -r1.211 -r1.212 src/distrib/sets/lists/comp/md.i386 cvs rdiff -u -r1.14 -r1.15 src/distrib/sets/lists/comp/md.ia64 cvs rdiff -u -r1.15 -r1.16 src/distrib/sets/lists/comp/md.or1k cvs rdiff -u -r1.106 -r1.107 src/distrib/sets/lists/comp/md.sparc cvs rdiff -u -r1.57 -r1.58 src/distrib/sets/lists/comp/md.vax cvs rdiff -u -r1.14 -r1.15 src/include/lwp.h cvs rdiff -u -r1.35 -r1.36 src/sys/arch/alpha/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/alpha/include/lwp.h cvs rdiff -u -r1.13 -r1.14 src/sys/arch/alpha/include/mcontext.h cvs rdiff -u -r1.23 -r1.24 src/sys/arch/amd64/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/amd64/include/lwp.h cvs rdiff -u -r1.22 -r1.23 src/sys/arch/amd64/include/mcontext.h cvs rdiff -u -r1.53 -r1.54 src/sys/arch/arm/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/arm/include/lwp.h cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/include/mcontext.h cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hppa/include/Makefile \ src/sys/arch/hppa/include/mcontext.h cvs rdiff -u -r1.1 -r0 src/sys/arch/hppa/include/lwp.h cvs rdiff -u -r1.51 -r1.52 src/sys/arch/i386/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/include/lwp.h cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/include/mcontext.h cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/ia64/include/lwp.h cvs rdiff -u -r1.14 -r1.15 src/sys/arch/ia64/include/mcontext.h cvs rdiff -u -r1.36 -r1.37 src/sys/arch/m68k/include/Makefile cvs rdiff -u -r1.2 -r0 src/sys/arch/m68k/include/lwp.h cvs rdiff -u -r1.14 -r1.15 src/sys/arch/m68k/include/mcontext.h cvs rdiff -u -r1.36 -r1.37 src/sys/arch/mips/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/mips/include/lwp.h cvs rdiff -u -r1.25 -r1.26 src/sys/arch/mips/include/mcontext.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/or1k/include/Makefile \ src/sys/arch/or1k/include/mcontext.h cvs rdiff -u -r1.1 -r0 src/sys/arch/or1k/include/lwp.h cvs rdiff -u -r1.43 -r1.44 src/sys/arch/powerpc/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/powerpc/include/lwp.h cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/include/mcontext.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/riscv/include/lwp.h cvs rdiff -u -r1.10 -r1.11 src/sys/arch/riscv/include/mcontext.h cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sh3/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/sh3/include/lwp.h cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sh3/include/mcontext.h cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sparc/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/sparc/include/lwp.h cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sparc/include/mcontext.h cvs rdiff -u -r1.31 -r1.32 src/sys/arch/vax/include/Makefile cvs rdiff -u -r1.1 -r0 src/sys/arch/vax/include/lwp.h cvs rdiff -u -r1.13 -r1.14 src/sys/arch/vax/include/mcontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/comp/ad.arm diff -u src/distrib/sets/lists/comp/ad.arm:1.112 src/distrib/sets/lists/comp/ad.arm:1.113 --- src/distrib/sets/lists/comp/ad.arm:1.112 Sun Nov 3 17:24:20 2024 +++ src/distrib/sets/lists/comp/ad.arm Mon Nov 4 10:45:22 2024 @@ -1,4 +1,4 @@ -# $NetBSD: ad.arm,v 1.112 2024/11/03 22:24:20 christos Exp $ +# $NetBSD: ad.arm,v 1.113 2024/11/04 15:45:22 christos Exp $ # ./usr/bin/elf2aout comp-sysutil-bin ./usr/include/acorn26 comp-obsolete obsolete @@ -162,7 +162,6 @@ ./usr/include/arm/kcore.h comp-c-include ./usr/include/arm/limits.h comp-c-include ./usr/include/arm/lock.h comp-c-include -./usr/include/arm/lwp.h comp-c-include ./usr/include/arm/math.h comp-c-include ./usr/include/arm/mcontext.h comp-c-include ./usr/include/arm/mutex.h comp-c-include Index: src/distrib/sets/lists/comp/ad.m68k diff -u src/distrib/sets/lists/comp/ad.m68k:1.74 src/distrib/sets/lists/comp/ad.m68k:1.75 --- src/distrib/sets/lists/comp/ad.m68k:1.74 Sun Nov 3 17:24:20 2024 +++ src/distrib/sets/lists/comp/ad.m68k Mon Nov 4 10:45:22 2024 @@ -1,4 +1,4 @@ -# $NetBSD: ad.m68k,v 1.74 2024/11/03 22:24:20 christos Exp $ +# $NetBSD: ad.m68k,v 1.75 2024/11/04 15:45:22 christos Exp $ # ./usr/bin/elf2aout comp-sysutil-bin ./usr/include/gcc-4.5/math-68881.h comp-obsolete obsolete @@ -55,7 +55,6 @@ ./usr/include/m68k/kcore.h comp-c-include ./usr/include/m68k/limits.h comp-c-include ./usr/include/m68k/lock.h comp-c-include -./usr/include/m68k/lwp.h comp-c-include ./usr/include/m68k/m68k.h comp-c-include ./usr/include/m68k/math.h comp-c-include ./usr/include/m68k/mcontext.h comp-c-include Index: src/distrib/sets/lists/comp/ad.mips diff -u src/distrib/sets/lists/comp/ad.mips:1.95 src/distrib/sets/lists/comp/ad.mips:1.96 --- src/distrib/sets/lists/comp/ad.mips:1.95 Sun Nov 3 17:24:20 2024 +++ src/distrib/sets/lists/comp/ad.mips Mon Nov 4 10:45:22 2024 @@ -1,4 +1,4 @@ -# $NetBSD: ad.mips,v 1.95 2024/11/03 22:24:20 christos Exp $ +# $NetBSD: ad.mips,v 1.96 2024/11/04 15:45:22 christos Exp $ # -./usr/lib/64/libgomp.a -./usr/lib/64/libgomp.so @@ -83,7 +83,6 @@ ./usr/include/mips/limits.h comp-c-include ./usr/include/mips/lock.h comp-c-include ./usr/include/mips/locore.h comp-c-include -./usr/include/mips/lwp.h comp-c-include ./usr/include/mips/math.h comp-c-include ./usr/include/mips/mcontext.h comp-c-include ./usr/include/mips/mips1_pte.h comp-c-include Index: src/distrib/sets/lists/comp/ad.powerpc diff -u src/distrib/sets/lists/comp/ad.powerpc:1.109 src/distrib/sets/lists/comp/ad.powerpc:1.110 --- src/distrib/sets/lists/comp/ad.powerpc:1.109 Sun Nov 3 17:24:20 2024 +++ src/distrib/sets/lists/comp/ad.powerpc Mon Nov 4 10:45:22 2024 @@ -1,4 +1,4 @@ -# $NetBSD: ad.powerpc,v 1.109 2024/11/03 22:24:20 christos Exp $ +# $NetBSD: ad.powerpc,v 1.110 2024/11/04 15:45:22 christos Exp $ # ./usr/bin/elf2aout comp-sysutil-bin ./usr/bin/psim comp-obsolete obsolete @@ -218,7 +218,6 @@ ./usr/include/powerpc/kcore.h comp-c-include ./usr/include/powerpc/limits.h comp-c-include ./usr/include/powerpc/lock.h comp-c-include -./usr/include/powerpc/lwp.h comp-c-include ./usr/include/powerpc/machine_type.h comp-obsolete obsolete ./usr/include/powerpc/math.h comp-c-include ./usr/include/powerpc/mcontext.h comp-c-include Index: src/distrib/sets/lists/comp/ad.riscv diff -u src/distrib/sets/lists/comp/ad.riscv:1.24 src/distrib/sets/lists/comp/ad.riscv:1.25 --- src/distrib/sets/lists/comp/ad.riscv:1.24 Sun Nov 3 17:24:20 2024 +++ src/distrib/sets/lists/comp/ad.riscv Mon Nov 4 10:45:22 2024 @@ -1,4 +1,4 @@ -# $NetBSD: ad.riscv,v 1.24 2024/11/03 22:24:20 christos Exp $ +# $NetBSD: ad.riscv,v 1.25 2024/11/04 15:45:22 christos Exp $ # ./usr/include/g++/bits/riscv32 comp-c-include arch64,compat ./usr/include/g++/bits/riscv32/c++config.h comp-c-include arch64,gcc,compat @@ -37,7 +37,6 @@ ./usr/include/riscv/kcore.h comp-c-include ./usr/include/riscv/limits.h comp-c-include ./usr/include/riscv/lock.h comp-c-include -./usr/include/riscv/lwp.h comp-c-include ./usr/include/riscv/math.h comp-c-include ./usr/include/riscv/mcontext.h comp-c-include ./usr/include/riscv/mutex.h comp-c-include Index: src/distrib/sets/lists/comp/ad.sh3 diff -u src/distrib/sets/lists/comp/ad.sh3:1.50 src/distrib/sets/lists/comp/ad.sh3:1.51 --- src/distrib/sets/lists/comp/ad.sh3:1.50 Sun Nov 3 17:24:20 2024 +++ src/distrib/sets/lists/comp/ad.sh3 Mon Nov 4 10:45:22 2024 @@ -1,4 +1,4 @@ -# $NetBSD: ad.sh3,v 1.50 2024/11/03 22:24:20 christos Exp $ +# $NetBSD: ad.sh3,v 1.51 2024/11/04 15:45:22 christos Exp $ # ./usr/include/gcc-4.5/tgmath.h comp-obsolete obsolete ./usr/include/gcc-4.8/tgmath.h comp-obsolete obsolete @@ -40,7 +40,6 @@ ./usr/include/sh3/intr.h comp-c-include ./usr/include/sh3/limits.h comp-c-include ./usr/include/sh3/lock.h comp-c-include -./usr/include/sh3/lwp.h comp-c-include ./usr/include/sh3/math.h comp-c-include ./usr/include/sh3/mcontext.h comp-c-include ./usr/include/sh3/mutex.h comp-c-include Index: src/distrib/sets/lists/comp/md.alpha diff -u src/distrib/sets/lists/comp/md.alpha:1.83 src/distrib/sets/lists/comp/md.alpha:1.84 --- src/distrib/sets/lists/comp/md.alpha:1.83 Sun Nov 3 17:24:20 2024 +++ src/distrib/sets/lists/comp/md.alpha Mon Nov 4 10:45:22 2024 @@ -1,4 +1,4 @@ -# $NetBSD: md.alpha,v 1.83 2024/11/03 22:24:20 christos Exp $ +# $NetBSD: md.alpha,v 1.84 2024/11/04 15:45:22 christos Exp $ # ./usr/include/alpha comp-c-include ./usr/include/alpha/_G_config.h comp-obsolete obsolete @@ -42,7 +42,6 @@ ./usr/include/alpha/kcore.h comp-c-include ./usr/include/alpha/limits.h comp-c-include ./usr/include/alpha/lock.h comp-c-include -./usr/include/alpha/lwp.h comp-c-include ./usr/include/alpha/math.h comp-c-include ./usr/include/alpha/mcontext.h comp-c-include ./usr/include/alpha/mutex.h comp-c-include Index: src/distrib/sets/lists/comp/md.amd64 diff -u src/distrib/sets/lists/comp/md.amd64:1.304 src/distrib/sets/lists/comp/md.amd64:1.305 --- src/distrib/sets/lists/comp/md.amd64:1.304 Sun Nov 3 17:24:20 2024 +++ src/distrib/sets/lists/comp/md.amd64 Mon Nov 4 10:45:22 2024 @@ -1,4 +1,4 @@ -# $NetBSD: md.amd64,v 1.304 2024/11/03 22:24:20 christos Exp $ +# $NetBSD: md.amd64,v 1.305 2024/11/04 15:45:22 christos Exp $ # ./usr/include/amd64 comp-c-include ./usr/include/amd64/ansi.h comp-c-include @@ -38,7 +38,6 @@ ./usr/include/amd64/limits.h comp-c-include ./usr/include/amd64/linux32_machdep.h comp-c-include ./usr/include/amd64/lock.h comp-c-include -./usr/include/amd64/lwp.h comp-c-include ./usr/include/amd64/math.h comp-c-include ./usr/include/amd64/mcontext.h comp-c-include ./usr/include/amd64/mtrr.h comp-c-include @@ -1304,7 +1303,6 @@ ./usr/include/i386/kcore.h comp-c-include ./usr/include/i386/limits.h comp-c-include ./usr/include/i386/lock.h comp-c-include -./usr/include/i386/lwp.h comp-c-include ./usr/include/i386/math.h comp-c-include ./usr/include/i386/mcontext.h comp-c-include ./usr/include/i386/mtrr.h comp-c-include Index: src/distrib/sets/lists/comp/md.hppa diff -u src/distrib/sets/lists/comp/md.hppa:1.19 src/distrib/sets/lists/comp/md.hppa:1.20 --- src/distrib/sets/lists/comp/md.hppa:1.19 Sun Nov 3 17:24:20 2024 +++ src/distrib/sets/lists/comp/md.hppa Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -# $NetBSD: md.hppa,v 1.19 2024/11/03 22:24:20 christos Exp $ +# $NetBSD: md.hppa,v 1.20 2024/11/04 15:45:23 christos Exp $ # ./usr/include/gcc-4.5/tgmath.h comp-obsolete obsolete ./usr/include/gcc-4.8/tgmath.h comp-obsolete obsolete @@ -105,7 +105,6 @@ ./usr/include/hppa/limits.h comp-c-include ./usr/include/hppa/loadfile_machdep.h comp-c-include ./usr/include/hppa/lock.h comp-c-include -./usr/include/hppa/lwp.h comp-c-include ./usr/include/hppa/math.h comp-c-include ./usr/include/hppa/mcontext.h comp-c-include ./usr/include/hppa/mutex.h comp-c-include Index: src/distrib/sets/lists/comp/md.i386 diff -u src/distrib/sets/lists/comp/md.i386:1.211 src/distrib/sets/lists/comp/md.i386:1.212 --- src/distrib/sets/lists/comp/md.i386:1.211 Sun Nov 3 17:24:20 2024 +++ src/distrib/sets/lists/comp/md.i386 Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -# $NetBSD: md.i386,v 1.211 2024/11/03 22:24:20 christos Exp $ +# $NetBSD: md.i386,v 1.212 2024/11/04 15:45:23 christos Exp $ # ./usr/include/clang-3.4/__wmmintrin_aes.h comp-obsolete obsolete ./usr/include/clang-3.4/__wmmintrin_pclmul.h comp-obsolete obsolete @@ -1232,7 +1232,6 @@ ./usr/include/i386/limits.h comp-c-include ./usr/include/i386/loadfile_machdep.h comp-obsolete obsolete ./usr/include/i386/lock.h comp-c-include -./usr/include/i386/lwp.h comp-c-include ./usr/include/i386/math.h comp-c-include ./usr/include/i386/mcontext.h comp-c-include ./usr/include/i386/mouse.h comp-obsolete obsolete Index: src/distrib/sets/lists/comp/md.ia64 diff -u src/distrib/sets/lists/comp/md.ia64:1.14 src/distrib/sets/lists/comp/md.ia64:1.15 --- src/distrib/sets/lists/comp/md.ia64:1.14 Sun Nov 3 17:24:21 2024 +++ src/distrib/sets/lists/comp/md.ia64 Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -# $NetBSD: md.ia64,v 1.14 2024/11/03 22:24:21 christos Exp $ +# $NetBSD: md.ia64,v 1.15 2024/11/04 15:45:23 christos Exp $ # ./usr/include/gcc-4.8/ia64intrin.h comp-obsolete obsolete ./usr/include/gcc-4.8/tgmath.h comp-obsolete obsolete @@ -51,7 +51,6 @@ ./usr/include/ia64/limits.h comp-c-include ./usr/include/ia64/loadfile_machdep.h comp-c-include ./usr/include/ia64/lock.h comp-c-include -./usr/include/ia64/lwp.h comp-c-include ./usr/include/ia64/math.h comp-c-include ./usr/include/ia64/mca_machdep.h comp-c-include ./usr/include/ia64/mcontext.h comp-c-include Index: src/distrib/sets/lists/comp/md.or1k diff -u src/distrib/sets/lists/comp/md.or1k:1.15 src/distrib/sets/lists/comp/md.or1k:1.16 --- src/distrib/sets/lists/comp/md.or1k:1.15 Sun Nov 3 17:24:21 2024 +++ src/distrib/sets/lists/comp/md.or1k Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -# $NetBSD: md.or1k,v 1.15 2024/11/03 22:24:21 christos Exp $ +# $NetBSD: md.or1k,v 1.16 2024/11/04 15:45:23 christos Exp $ # ./usr/include/gcc-4.8/tgmath.h comp-obsolete obsolete ./usr/include/gcc-5/tgmath.h comp-obsolete obsolete @@ -35,7 +35,6 @@ ./usr/include/or1k/kcore.h comp-c-include ./usr/include/or1k/limits.h comp-c-include ./usr/include/or1k/lock.h comp-c-include -./usr/include/or1k/lwp.h comp-c-include ./usr/include/or1k/math.h comp-c-include ./usr/include/or1k/mcontext.h comp-c-include ./usr/include/or1k/mutex.h comp-c-include Index: src/distrib/sets/lists/comp/md.sparc diff -u src/distrib/sets/lists/comp/md.sparc:1.106 src/distrib/sets/lists/comp/md.sparc:1.107 --- src/distrib/sets/lists/comp/md.sparc:1.106 Sun Nov 3 17:24:21 2024 +++ src/distrib/sets/lists/comp/md.sparc Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -# $NetBSD: md.sparc,v 1.106 2024/11/03 22:24:21 christos Exp $ +# $NetBSD: md.sparc,v 1.107 2024/11/04 15:45:23 christos Exp $ # ./usr/include/gcc-4.5/tgmath.h comp-obsolete obsolete ./usr/include/gcc-4.8/tgmath.h comp-obsolete obsolete @@ -58,7 +58,6 @@ ./usr/include/sparc/kcore.h comp-c-include ./usr/include/sparc/limits.h comp-c-include ./usr/include/sparc/lock.h comp-c-include -./usr/include/sparc/lwp.h comp-c-include ./usr/include/sparc/math.h comp-c-include ./usr/include/sparc/mcontext.h comp-c-include ./usr/include/sparc/mutex.h comp-c-include Index: src/distrib/sets/lists/comp/md.vax diff -u src/distrib/sets/lists/comp/md.vax:1.57 src/distrib/sets/lists/comp/md.vax:1.58 --- src/distrib/sets/lists/comp/md.vax:1.57 Sun Nov 3 17:24:21 2024 +++ src/distrib/sets/lists/comp/md.vax Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -# $NetBSD: md.vax,v 1.57 2024/11/03 22:24:21 christos Exp $ +# $NetBSD: md.vax,v 1.58 2024/11/04 15:45:23 christos Exp $ # ./usr/include/gcc-4.5/tgmath.h comp-obsolete obsolete ./usr/include/gcc-4.8/tgmath.h comp-obsolete obsolete @@ -47,7 +47,6 @@ ./usr/include/vax/leds.h comp-c-include ./usr/include/vax/limits.h comp-c-include ./usr/include/vax/lock.h comp-c-include -./usr/include/vax/lwp.h comp-c-include ./usr/include/vax/macros.h comp-c-include ./usr/include/vax/math.h comp-c-include ./usr/include/vax/mcontext.h comp-c-include Index: src/include/lwp.h diff -u src/include/lwp.h:1.14 src/include/lwp.h:1.15 --- src/include/lwp.h:1.14 Sun Nov 3 17:24:20 2024 +++ src/include/lwp.h Mon Nov 4 10:45:22 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: lwp.h,v 1.14 2024/11/03 22:24:20 christos Exp $ */ +/* $NetBSD: lwp.h,v 1.15 2024/11/04 15:45:22 christos Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -64,6 +64,4 @@ int _lwp_getname(lwpid_t, char *, size_t int _lwp_ctl(int, struct lwpctl **); __END_DECLS -#include <machine/lwp.h> - #endif /* !_LWP_H_ */ Index: src/sys/arch/alpha/include/Makefile diff -u src/sys/arch/alpha/include/Makefile:1.35 src/sys/arch/alpha/include/Makefile:1.36 --- src/sys/arch/alpha/include/Makefile:1.35 Sun Nov 3 17:24:21 2024 +++ src/sys/arch/alpha/include/Makefile Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.35 2024/11/03 22:24:21 christos Exp $ +# $NetBSD: Makefile,v 1.36 2024/11/04 15:45:23 christos Exp $ INCSDIR= /usr/include/alpha @@ -13,7 +13,7 @@ INCS= alpha_cpu.h ansi.h aout_machdep.h intr.h \ joystick.h \ kbio.h kcore.h \ - limits.h lock.h lwp.h \ + limits.h lock.h \ math.h mcontext.h mutex.h \ pal.h param.h pcb.h pio.h pmap.h proc.h profile.h prom.h psl.h \ pte.h ptrace.h \ Index: src/sys/arch/alpha/include/mcontext.h diff -u src/sys/arch/alpha/include/mcontext.h:1.13 src/sys/arch/alpha/include/mcontext.h:1.14 --- src/sys/arch/alpha/include/mcontext.h:1.13 Sun Nov 3 17:24:21 2024 +++ src/sys/arch/alpha/include/mcontext.h Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.13 2024/11/03 22:24:21 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.14 2024/11/04 15:45:23 christos Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -104,4 +104,24 @@ typedef struct { #define _UC_MACHINE_SET_PC(uc, pc) _UC_MACHINE_PC(uc) = (pc) +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \ + defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> + +__BEGIN_DECLS +static __inline void * +__lwp_getprivate_fast(void) +{ + register void *__tmp __asm("$0"); + + __asm volatile("call_pal %1 # PAL_rdunique" + : "=r" (__tmp) + : "i" (0x009e /* PAL_rdunique */)); + + return __tmp; +} +__END_DECLS + +#endif + #endif /* !_ALPHA_MCONTEXT_H_ */ Index: src/sys/arch/amd64/include/Makefile diff -u src/sys/arch/amd64/include/Makefile:1.23 src/sys/arch/amd64/include/Makefile:1.24 --- src/sys/arch/amd64/include/Makefile:1.23 Sun Nov 3 17:24:21 2024 +++ src/sys/arch/amd64/include/Makefile Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.23 2024/11/03 22:24:21 christos Exp $ +# $NetBSD: Makefile,v 1.24 2024/11/04 15:45:23 christos Exp $ INCSDIR= /usr/include/amd64 @@ -19,7 +19,7 @@ INCS= ansi.h aout_machdep.h asm.h \ netbsd32_machdep.h \ param.h pcb.h pci_machdep.h pio.h pmap.h proc.h \ profile.h psl.h pte.h ptrace.h \ - lwp.h reg.h rwlock.h \ + reg.h rwlock.h \ segments.h setjmp.h signal.h sljit_machdep.h specialreg.h sysarch.h \ trap.h tss.h types.h \ userret.h \ Index: src/sys/arch/amd64/include/mcontext.h diff -u src/sys/arch/amd64/include/mcontext.h:1.22 src/sys/arch/amd64/include/mcontext.h:1.23 --- src/sys/arch/amd64/include/mcontext.h:1.22 Sun Nov 3 17:24:21 2024 +++ src/sys/arch/amd64/include/mcontext.h Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.22 2024/11/03 22:24:21 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.23 2024/11/04 15:45:23 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -84,6 +84,24 @@ typedef struct { #define __UCONTEXT_SIZE 784 +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \ + defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> + +__BEGIN_DECLS +static __inline void * +__lwp_getprivate_fast(void) +{ + void *__tmp; + + __asm volatile("movq %%fs:0, %0" : "=r" (__tmp)); + + return __tmp; +} +__END_DECLS + +#endif + #ifdef _KERNEL /* Index: src/sys/arch/arm/include/Makefile diff -u src/sys/arch/arm/include/Makefile:1.53 src/sys/arch/arm/include/Makefile:1.54 --- src/sys/arch/arm/include/Makefile:1.53 Sun Nov 3 17:24:21 2024 +++ src/sys/arch/arm/include/Makefile Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.53 2024/11/03 22:24:21 christos Exp $ +# $NetBSD: Makefile,v 1.54 2024/11/04 15:45:23 christos Exp $ INCSDIR= /usr/include/arm @@ -12,7 +12,7 @@ INCS= aeabi.h ansi.h aout_machdep.h apmv int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \ joystick.h \ kcore.h \ - limits.h lock.h lwp.h \ + limits.h lock.h \ math.h mcontext.h mutex.h \ param.h pcb.h proc.h profile.h rwlock.h \ ptrace.h \ Index: src/sys/arch/arm/include/mcontext.h diff -u src/sys/arch/arm/include/mcontext.h:1.25 src/sys/arch/arm/include/mcontext.h:1.26 --- src/sys/arch/arm/include/mcontext.h:1.25 Sun Nov 3 17:24:21 2024 +++ src/sys/arch/arm/include/mcontext.h Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.25 2024/11/03 22:24:21 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.26 2024/11/04 15:45:23 christos Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -210,6 +210,52 @@ typedef struct { #endif +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \ + defined(__LIBPTHREAD_SOURCE__) + +#include <sys/tls.h> + +#if defined(__aarch64__) + +__BEGIN_DECLS +static __inline void * +__lwp_getprivate_fast(void) +{ + void *__tpidr; + __asm __volatile("mrs\t%0, tpidr_el0" : "=r"(__tpidr)); + return __tpidr; +} +__END_DECLS + +#elif defined(__arm__) + +__BEGIN_DECLS +static __inline void * +__lwp_getprivate_fast(void) +{ +#if !defined(__thumb__) || defined(_ARM_ARCH_T2) + extern void *_lwp_getprivate(void); + void *rv; + __asm("mrc p15, 0, %0, c13, c0, 3" : "=r"(rv)); + if (__predict_true(rv)) + return rv; + /* + * Some ARM cores are broken and don't raise an undefined fault when an + * unrecogized mrc instruction is encountered, but just return zero. + * To do deal with that, if we get a zero we (re-)fetch the value using + * syscall. + */ + return _lwp_getprivate(); +#else + extern void *__aeabi_read_tp(void); + return __aeabi_read_tp(); +#endif /* !__thumb__ || _ARM_ARCH_T2 */ +} +__END_DECLS +#endif + +#endif /* _RTLD_SOURCE || _LIBC_SOURCE || __LIBPTHREAD_SOURCE__ */ + /* Machine-dependent uc_flags */ #define _UC_TLSBASE _UC_MD_BIT19 /* see <sys/ucontext.h> */ Index: src/sys/arch/hppa/include/Makefile diff -u src/sys/arch/hppa/include/Makefile:1.14 src/sys/arch/hppa/include/Makefile:1.15 --- src/sys/arch/hppa/include/Makefile:1.14 Sun Nov 3 17:24:21 2024 +++ src/sys/arch/hppa/include/Makefile Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 2024/11/03 22:24:21 christos Exp $ +# $NetBSD: Makefile,v 1.15 2024/11/04 15:45:23 christos Exp $ INCSDIR= /usr/include/hppa @@ -11,7 +11,7 @@ INCS= ansi.h aout_machdep.h asm.h autoco ieee.h ieeefp.h intr.h intrdefs.h iomod.h isa_machdep.h \ int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \ kcore.h \ - limits.h loadfile_machdep.h lock.h lwp.h \ + limits.h loadfile_machdep.h lock.h \ math.h mcontext.h mutex.h \ nvm.h \ param.h pcb.h pdc.h pmap.h proc.h profile.h psl.h pte.h ptrace.h \ Index: src/sys/arch/hppa/include/mcontext.h diff -u src/sys/arch/hppa/include/mcontext.h:1.14 src/sys/arch/hppa/include/mcontext.h:1.15 --- src/sys/arch/hppa/include/mcontext.h:1.14 Sun Nov 3 17:24:21 2024 +++ src/sys/arch/hppa/include/mcontext.h Mon Nov 4 10:45:23 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.14 2024/11/03 22:24:21 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.15 2024/11/04 15:45:23 christos Exp $ */ #ifndef _HPPA_MCONTEXT_H_ #define _HPPA_MCONTEXT_H_ @@ -91,6 +91,24 @@ do { \ } while (/*CONSTCOND*/0) #define _UC_MACHINE_INTRV(uc) ((uc)->uc_mcontext.__gregs[_REG_RET0]) +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \ + defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> + +__BEGIN_DECLS +static __inline void * +__lwp_getprivate_fast(void) +{ + register void *__tmp; + + __asm volatile("mfctl\t27 /* CR_TLS */, %0" : "=r" (__tmp)); + + return __tmp; +} +__END_DECLS + +#endif + #endif /* !__ASSEMBLER__ */ #define _UC_SETSTACK _UC_MD_BIT16 Index: src/sys/arch/i386/include/Makefile diff -u src/sys/arch/i386/include/Makefile:1.51 src/sys/arch/i386/include/Makefile:1.52 --- src/sys/arch/i386/include/Makefile:1.51 Sun Nov 3 17:24:21 2024 +++ src/sys/arch/i386/include/Makefile Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.51 2024/11/03 22:24:21 christos Exp $ +# $NetBSD: Makefile,v 1.52 2024/11/04 15:45:24 christos Exp $ INCSDIR= /usr/include/i386 @@ -14,7 +14,7 @@ INCS= ansi.h aout_machdep.h apmvar.h asm intr.h intrdefs.h \ joystick.h \ kcore.h \ - limits.h lock.h lwp.h \ + limits.h lock.h \ math.h mcontext.h mutex.h mtrr.h multiboot.h multiboot2.h \ param.h pcb.h pio.h pmap.h proc.h profile.h psl.h \ pte.h ptrace.h \ Index: src/sys/arch/i386/include/mcontext.h diff -u src/sys/arch/i386/include/mcontext.h:1.17 src/sys/arch/i386/include/mcontext.h:1.18 --- src/sys/arch/i386/include/mcontext.h:1.17 Sun Nov 3 17:24:21 2024 +++ src/sys/arch/i386/include/mcontext.h Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.17 2024/11/03 22:24:21 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.18 2024/11/04 15:45:24 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -113,4 +113,22 @@ typedef struct { #define __UCONTEXT_SIZE 776 +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \ + defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> + +__BEGIN_DECLS +static __inline void * +__lwp_getprivate_fast(void) +{ + void *__tmp; + + __asm volatile("movl %%gs:0, %0" : "=r" (__tmp)); + + return __tmp; +} +__END_DECLS + +#endif + #endif /* !_I386_MCONTEXT_H_ */ Index: src/sys/arch/ia64/include/Makefile diff -u src/sys/arch/ia64/include/Makefile:1.9 src/sys/arch/ia64/include/Makefile:1.10 --- src/sys/arch/ia64/include/Makefile:1.9 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/ia64/include/Makefile Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.9 2024/11/03 22:24:22 christos Exp $ +# $NetBSD: Makefile,v 1.10 2024/11/04 15:45:24 christos Exp $ INCSDIR= /usr/include/ia64 @@ -8,9 +8,9 @@ INCS= _regset.h acpi_machdep.h ansi.h \ endian.h endian_machdep.h fenv.h float.h fpu.h frame.h \ ia64_cpu.h ieee.h ieeefp.h int_const.h int_fmtio.h int_limits.h \ int_mwgwtypes.h int_types.h intr.h limits.h \ - loadfile_machdep.h lock.h lwp.h math.h mca_machdep.h mcontext.h \ - md_var.h mutex.h pal.h param.h pcb.h pmap.h proc.h profile.h pte.h \ - ptrace.h reg.h sal.h rwlock.h setjmp.h signal.h smp.h ssc.h types.h \ + loadfile_machdep.h lock.h math.h mca_machdep.h mcontext.h md_var.h \ + mutex.h pal.h param.h pcb.h pmap.h proc.h profile.h pte.h ptrace.h \ + reg.h sal.h rwlock.h setjmp.h signal.h smp.h ssc.h types.h \ vmparam.h wchar_limits.h .include <bsd.kinc.mk> Index: src/sys/arch/ia64/include/mcontext.h diff -u src/sys/arch/ia64/include/mcontext.h:1.14 src/sys/arch/ia64/include/mcontext.h:1.15 --- src/sys/arch/ia64/include/mcontext.h:1.14 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/ia64/include/mcontext.h Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.14 2024/11/03 22:24:22 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.15 2024/11/04 15:45:24 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -121,4 +121,19 @@ typedef struct __mcontext { #define _UC_SETSTACK _UC_MD_BIT17 #define _UC_CLRSTACK _UC_MD_BIT18 + +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \ + defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> + +__BEGIN_DECLS +static __inline void * +__lwp_getprivate_fast(void) +{ + return (void*)0; +} +__END_DECLS + +#endif + #endif /* !_IA64_MCONTEXT_H_ */ Index: src/sys/arch/m68k/include/Makefile diff -u src/sys/arch/m68k/include/Makefile:1.36 src/sys/arch/m68k/include/Makefile:1.37 --- src/sys/arch/m68k/include/Makefile:1.36 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/m68k/include/Makefile Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.36 2024/11/03 22:24:22 christos Exp $ +# $NetBSD: Makefile,v 1.37 2024/11/04 15:45:24 christos Exp $ INCSDIR= /usr/include/m68k @@ -12,7 +12,7 @@ INCS= ansi.h aout_machdep.h asm.h asm_si int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \ intr.h \ kcore.h \ - limits.h lock.h lwp.h \ + limits.h lock.h \ m68k.h math.h mcontext.h mmu_30.h mmu_40.h mmu_51.h mutex.h \ param.h pmap_motorola.h pcb.h proc.h profile.h \ psl.h pte_motorola.h ptrace.h \ Index: src/sys/arch/m68k/include/mcontext.h diff -u src/sys/arch/m68k/include/mcontext.h:1.14 src/sys/arch/m68k/include/mcontext.h:1.15 --- src/sys/arch/m68k/include/mcontext.h:1.14 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/m68k/include/mcontext.h Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.14 2024/11/03 22:24:22 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.15 2024/11/04 15:45:24 christos Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -110,4 +110,35 @@ typedef struct { #define __UCONTEXT_SIZE 1024 +#if defined(_LIBC_SOURCE) || defined(_RTLD_SOURCE) || defined(__LIBPTHREAD_SOURCE__) +#define TLS_TP_OFFSET 0x7000 +#define TLS_DTV_OFFSET 0x8000 + +#include <sys/tls.h> + +__CTASSERT(TLS_TP_OFFSET + sizeof(struct tls_tcb) < 0x8000); +__CTASSERT(TLS_TP_OFFSET % sizeof(struct tls_tcb) == 0); + +__BEGIN_DECLS + +void *_lwp_getprivate(void); +void _lwp_setprivate(void *); + +static __inline struct tls_tcb * +__lwp_gettcb_fast(void) +{ + unsigned int __tcb = (unsigned int)_lwp_getprivate(); + return (struct tls_tcb *)(uintptr_t) + (__tcb - TLS_TP_OFFSET - sizeof(struct tls_tcb)); +} + +static inline void +__lwp_settcb(struct tls_tcb *__tcb) +{ + __tcb += TLS_TP_OFFSET / sizeof(*__tcb) + 1; + _lwp_setprivate(__tcb); +} +__END_DECLS +#endif + #endif /* !_M68K_MCONTEXT_H_ */ Index: src/sys/arch/mips/include/Makefile diff -u src/sys/arch/mips/include/Makefile:1.36 src/sys/arch/mips/include/Makefile:1.37 --- src/sys/arch/mips/include/Makefile:1.36 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/mips/include/Makefile Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.36 2024/11/03 22:24:22 christos Exp $ +# $NetBSD: Makefile,v 1.37 2024/11/04 15:45:24 christos Exp $ INCSDIR= /usr/include/mips @@ -10,7 +10,7 @@ INCS= ansi.h asm.h \ ieee.h ieeefp.h \ int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \ kcore.h kdbparam.h \ - limits.h lock.h locore.h lwp.h mcontext.h math.h \ + limits.h lock.h locore.h mcontext.h math.h \ mips1_pte.h mips3_pte.h mips_opcode.h mips_param.h mutex.h \ pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h \ reg.h regdef.h regnum.h reloc.h rwlock.h \ Index: src/sys/arch/mips/include/mcontext.h diff -u src/sys/arch/mips/include/mcontext.h:1.25 src/sys/arch/mips/include/mcontext.h:1.26 --- src/sys/arch/mips/include/mcontext.h:1.25 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/mips/include/mcontext.h Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.25 2024/11/03 22:24:22 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.26 2024/11/04 15:45:24 christos Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -187,4 +187,55 @@ typedef struct { #error O64 is not supported #endif +#if defined(_LIBC_SOURCE) || defined(_RTLD_SOURCE) || defined(__LIBPTHREAD_SOURCE__) +#define TLS_TP_OFFSET 0x7000 +#define TLS_DTV_OFFSET 0x8000 + +#include <sys/tls.h> + +__CTASSERT(TLS_TP_OFFSET + sizeof(struct tls_tcb) < 0x8000); +__CTASSERT(TLS_TP_OFFSET % sizeof(struct tls_tcb) == 0); + +__BEGIN_DECLS + +static __inline struct tls_tcb * +__lwp_gettcb_fast(void) +{ + struct tls_tcb *__tcb; + + /* + * Only emit a rdhwr $3, $29 so the kernel can quickly emulate it. + */ + __asm __volatile( +#if 1 + // For some reason the syscall is much faster than + // emulating rdhwr $3,$29 on a CN50xx + "addiu $2,$0,316; syscall; nop; move %[__tcb],$2" +#else + ".set push" + ";.set mips32r2" + ";.p2align 4" + ";ssnop" + ";rdhwr $3,$29" + ";ssnop" + ";move %0,$3" + ";.set pop" +#endif + : [__tcb]"=r"(__tcb) + : + : "v0", "v1", "a3"); + return __tcb - (TLS_TP_OFFSET / sizeof(*__tcb) + 1); +} + +void _lwp_setprivate(void *); + +static inline void +__lwp_settcb(struct tls_tcb *__tcb) +{ + __tcb += TLS_TP_OFFSET / sizeof(*__tcb) + 1; + _lwp_setprivate(__tcb); +} +__END_DECLS +#endif + #endif /* _MIPS_MCONTEXT_H_ */ Index: src/sys/arch/or1k/include/Makefile diff -u src/sys/arch/or1k/include/Makefile:1.3 src/sys/arch/or1k/include/Makefile:1.4 --- src/sys/arch/or1k/include/Makefile:1.3 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/or1k/include/Makefile Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2024/11/03 22:24:22 christos Exp $ +# $NetBSD: Makefile,v 1.4 2024/11/04 15:45:24 christos Exp $ INCSDIR= /usr/include/or1k @@ -12,7 +12,7 @@ INCS= ansi.h aout_machdep.h asm.h \ int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \ intr.h \ kcore.h \ - limits.h lock.h lwp.h \ + limits.h lock.h \ math.h mcontext.h mutex.h \ param.h pcb.h pmap.h \ proc.h profile.h pte.h ptrace.h \ Index: src/sys/arch/or1k/include/mcontext.h diff -u src/sys/arch/or1k/include/mcontext.h:1.3 src/sys/arch/or1k/include/mcontext.h:1.4 --- src/sys/arch/or1k/include/mcontext.h:1.3 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/or1k/include/mcontext.h Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.3 2024/11/03 22:24:22 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.4 2024/11/04 15:45:24 christos Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -94,4 +94,48 @@ typedef struct { #define _UC_MACHINE_SET_PC(uc, pc) _UC_MACHINE_PC(uc) = (pc) +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> + +/* + * On OpenRISC 1000, since displacements are signed 16-bit values, the TCB + * Pointer is biased by 0x7000 + sizeof(tcb) so that first thread datum can be + * addressed by -28672 thereby leaving 60KB available for use as thread data. + */ +#define TLS_TP_OFFSET 0x7000 +#define TLS_DTV_OFFSET 0x8000 +__CTASSERT(TLS_TP_OFFSET + sizeof(struct tls_tcb) < 0x8000); + +static __inline void * +__lwp_getprivate_fast(void) +{ + void *__tp; + __asm("l.ori %0,r10,0" : "=r"(__tp)); + return __tp; +} + +static __inline void * +__lwp_gettcb_fast(void) +{ + void *__tcb; + + __asm __volatile( + "l.addi %[__tcb],r10,%[__offset]" + : [__tcb] "=r" (__tcb) + : [__offset] "n" (-(TLS_TP_OFFSET + sizeof(struct tls_tcb)))); + + return __tcb; +} + +static __inline void +__lwp_settcb(void *__tcb) +{ + __asm __volatile( + "l.addi r10,%[__tcb],%[__offset]" + : + : [__tcb] "r" (__tcb), + [__offset] "n" (TLS_TP_OFFSET + sizeof(struct tls_tcb))); +} +#endif /* _RTLD_SOURCE || _LIBC_SOURCE || __LIBPTHREAD_SOURCE__ */ + #endif /* !_OR1K_MCONTEXT_H_ */ Index: src/sys/arch/powerpc/include/Makefile diff -u src/sys/arch/powerpc/include/Makefile:1.43 src/sys/arch/powerpc/include/Makefile:1.44 --- src/sys/arch/powerpc/include/Makefile:1.43 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/powerpc/include/Makefile Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.43 2024/11/03 22:24:22 christos Exp $ +# $NetBSD: Makefile,v 1.44 2024/11/04 15:45:24 christos Exp $ .if !defined(INCSDIR) INCSDIR?= /usr/include/powerpc @@ -13,7 +13,7 @@ INCS+= ansi.h aout_machdep.h asm.h \ ieee.h ieeefp.h \ int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \ kcore.h \ - limits.h lock.h lwp.h \ + limits.h lock.h \ math.h mcontext.h mutex.h \ param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h \ reg.h reloc.h rwlock.h \ Index: src/sys/arch/powerpc/include/mcontext.h diff -u src/sys/arch/powerpc/include/mcontext.h:1.24 src/sys/arch/powerpc/include/mcontext.h:1.25 --- src/sys/arch/powerpc/include/mcontext.h:1.24 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/powerpc/include/mcontext.h Mon Nov 4 10:45:24 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.24 2024/11/03 22:24:22 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.25 2024/11/04 15:45:24 christos Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -141,4 +141,48 @@ typedef struct { #define _UC_MACHINE_SET_PC(uc, pc) _UC_MACHINE_PC(uc) = (pc) +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> + +/* + * On PowerPC, since displacements are signed 16-bit values, the TCB Pointer + * is biased by 0x7000 + sizeof(tcb) so that first thread datum can be + * addressed by -28672 thereby leaving 60KB available for use as thread data. + */ +#define TLS_TP_OFFSET 0x7000 +#define TLS_DTV_OFFSET 0x8000 +__CTASSERT(TLS_TP_OFFSET + sizeof(struct tls_tcb) < 0x8000); + +__BEGIN_DECLS + +static __inline void * +__lwp_gettcb_fast(void) +{ + void *__tcb; + + __asm __volatile( + "addi %[__tcb],%%r2,%[__offset]" + : [__tcb] "=r" (__tcb) + : [__offset] "n" (-(TLS_TP_OFFSET + sizeof(struct tls_tcb)))); + + return __tcb; +} + +void _lwp_setprivate(void *); + +static __inline void +__lwp_settcb(void *__tcb) +{ + __tcb = (uint8_t *)__tcb + TLS_TP_OFFSET + sizeof(struct tls_tcb); + + __asm __volatile( + "mr %%r2,%[__tcb]" + : + : [__tcb] "r" (__tcb)); + + _lwp_setprivate(__tcb); +} +__END_DECLS +#endif /* _RTLD_SOURCE || _LIBC_SOURCE || __LIBPTHREAD_SOURCE__ */ + #endif /* !_POWERPC_MCONTEXT_H_ */ Index: src/sys/arch/riscv/include/Makefile diff -u src/sys/arch/riscv/include/Makefile:1.4 src/sys/arch/riscv/include/Makefile:1.5 --- src/sys/arch/riscv/include/Makefile:1.4 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/riscv/include/Makefile Mon Nov 4 10:45:25 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2024/11/03 22:24:22 christos Exp $ +# $NetBSD: Makefile,v 1.5 2024/11/04 15:45:25 christos Exp $ INCSDIR= /usr/include/riscv @@ -11,7 +11,7 @@ INCS= ansi.h aout_machdep.h asm.h \ ieee.h ieeefp.h \ int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \ kcore.h \ - limits.h lock.h lwp.h \ + limits.h lock.h \ math.h mcontext.h mutex.h \ param.h pcb.h pmap.h \ proc.h profile.h pte.h ptrace.h \ Index: src/sys/arch/riscv/include/mcontext.h diff -u src/sys/arch/riscv/include/mcontext.h:1.10 src/sys/arch/riscv/include/mcontext.h:1.11 --- src/sys/arch/riscv/include/mcontext.h:1.10 Sun Nov 3 17:24:22 2024 +++ src/sys/arch/riscv/include/mcontext.h Mon Nov 4 10:45:25 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.10 2024/11/03 22:24:22 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.11 2024/11/04 15:45:25 christos Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -147,4 +147,51 @@ typedef struct { #define _UC_MACHINE_SET_PC(uc, pc) _UC_MACHINE_PC(uc) = (pc) +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> + +static __inline void * +__lwp_getprivate_fast(void) +{ + void *__tp; + __asm("mv %0, tp" : "=r"(__tp)); + return __tp; +} + +/* + * On RISCV, since displacements are signed 12-bit values, the TCB Pointer + * is biased by sizeof(tcb) so that first thread datum can be addressed by + * -sizeof(tcb). + */ + +#define TLS_TP_OFFSET 0x0 +#define TLS_TCB_ALIGN 16 +#define TLS_DTV_OFFSET 0x800 +__CTASSERT(TLS_TP_OFFSET + sizeof(struct tls_tcb) < 0x800); + +static __inline void * +__lwp_gettcb_fast(void) +{ + void *__tcb; + + __asm __volatile( + "addi %[__tcb], tp, %[__offset]" + : [__tcb] "=r" (__tcb) + : [__offset] "n" (-(TLS_TP_OFFSET + sizeof(struct tls_tcb)))); + + return __tcb; +} + +static __inline void +__lwp_settcb(void *__tcb) +{ + __asm __volatile( + "addi tp, %[__tcb], %[__offset]" + : + : [__tcb] "r" (__tcb), + [__offset] "n" (TLS_TP_OFFSET + sizeof(struct tls_tcb))); +} + +#endif /* _RTLD_SOURCE || _LIBC_SOURCE || __LIBPTHREAD_SOURCE__ */ + #endif /* !_RISCV_MCONTEXT_H_ */ Index: src/sys/arch/sh3/include/Makefile diff -u src/sys/arch/sh3/include/Makefile:1.30 src/sys/arch/sh3/include/Makefile:1.31 --- src/sys/arch/sh3/include/Makefile:1.30 Sun Nov 3 17:24:23 2024 +++ src/sys/arch/sh3/include/Makefile Mon Nov 4 10:45:25 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.30 2024/11/03 22:24:23 christos Exp $ +# $NetBSD: Makefile,v 1.31 2024/11/04 15:45:25 christos Exp $ INCSDIR= /usr/include/sh3 @@ -11,7 +11,7 @@ INCS= ansi.h aout_machdep.h asm.h \ ieee.h ieeefp.h \ int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \ intr.h \ - limits.h lock.h lwp.h \ + limits.h lock.h \ math.h mcontext.h mutex.h \ param.h pcb.h pmap.h proc.h profile.h psl.h \ pte.h ptrace.h \ Index: src/sys/arch/sh3/include/mcontext.h diff -u src/sys/arch/sh3/include/mcontext.h:1.14 src/sys/arch/sh3/include/mcontext.h:1.15 --- src/sys/arch/sh3/include/mcontext.h:1.14 Sun Nov 3 17:24:23 2024 +++ src/sys/arch/sh3/include/mcontext.h Mon Nov 4 10:45:25 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.14 2024/11/03 22:24:23 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.15 2024/11/04 15:45:25 christos Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -95,4 +95,22 @@ typedef struct { #define _UC_CLRSTACK _UC_MD_BIT17 #define _UC_TLSBASE _UC_MD_BIT19 +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \ + defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> + +__BEGIN_DECLS +static __inline void * +__lwp_getprivate_fast(void) +{ + register void *__gbr; + + __asm volatile("stc gbr, %0" : "=r" (__gbr)); + + return __gbr; +} +__END_DECLS + +#endif + #endif /* !_SH3_MCONTEXT_H_ */ Index: src/sys/arch/sparc/include/Makefile diff -u src/sys/arch/sparc/include/Makefile:1.37 src/sys/arch/sparc/include/Makefile:1.38 --- src/sys/arch/sparc/include/Makefile:1.37 Sun Nov 3 17:24:23 2024 +++ src/sys/arch/sparc/include/Makefile Mon Nov 4 10:45:25 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.37 2024/11/03 22:24:23 christos Exp $ +# $NetBSD: Makefile,v 1.38 2024/11/04 15:45:25 christos Exp $ INCSDIR= /usr/include/sparc @@ -12,7 +12,7 @@ INCS= ansi.h aout_machdep.h apmvar.h asm int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \ intr.h \ kbd.h kbio.h kcore.h \ - limits.h lock.h lwp.h \ + limits.h lock.h \ math.h mcontext.h mutex.h \ oldmon.h openpromio.h \ param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h \ Index: src/sys/arch/sparc/include/mcontext.h diff -u src/sys/arch/sparc/include/mcontext.h:1.20 src/sys/arch/sparc/include/mcontext.h:1.21 --- src/sys/arch/sparc/include/mcontext.h:1.20 Sun Nov 3 17:24:23 2024 +++ src/sys/arch/sparc/include/mcontext.h Mon Nov 4 10:45:25 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.20 2024/11/03 22:24:23 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.21 2024/11/04 15:45:25 christos Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -161,4 +161,22 @@ do { \ (uc)->uc_mcontext.__gregs[_REG_nPC] = (pc) + 4; \ } while (/*CONSTCOND*/0) +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \ + defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> + +__BEGIN_DECLS +static __inline void * +__lwp_getprivate_fast(void) +{ + register void *__tmp; + + __asm volatile("mov %%g7, %0" : "=r" (__tmp)); + + return __tmp; +} +__END_DECLS + +#endif + #endif /* !_SPARC_MCONTEXT_H_ */ Index: src/sys/arch/vax/include/Makefile diff -u src/sys/arch/vax/include/Makefile:1.31 src/sys/arch/vax/include/Makefile:1.32 --- src/sys/arch/vax/include/Makefile:1.31 Sun Nov 3 17:24:23 2024 +++ src/sys/arch/vax/include/Makefile Mon Nov 4 10:45:25 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.31 2024/11/03 22:24:23 christos Exp $ +# $NetBSD: Makefile,v 1.32 2024/11/04 15:45:25 christos Exp $ INCSDIR= /usr/include/vax @@ -11,7 +11,7 @@ INCS= ansi.h aout_machdep.h asm.h \ int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \ ioa.h \ ka410.h ka420.h ka43.h ka630.h ka650.h ka750.h ka820.h \ - leds.h lcgreg.h limits.h lock.h lwp.h \ + leds.h lcgreg.h limits.h lock.h \ macros.h math.h mcontext.h mtpr.h mutex.h \ nexus.h param.h pcb.h pmap.h \ proc.h profile.h psl.h pte.h ptrace.h \ Index: src/sys/arch/vax/include/mcontext.h diff -u src/sys/arch/vax/include/mcontext.h:1.13 src/sys/arch/vax/include/mcontext.h:1.14 --- src/sys/arch/vax/include/mcontext.h:1.13 Sun Nov 3 17:24:23 2024 +++ src/sys/arch/vax/include/mcontext.h Mon Nov 4 10:45:25 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.13 2024/11/03 22:24:23 christos Exp $ */ +/* $NetBSD: mcontext.h,v 1.14 2024/11/04 15:45:25 christos Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -76,4 +76,21 @@ typedef struct { #define _UC_MACHINE_SET_PC(uc, pc) _UC_MACHINE_PC(uc) = (pc) +#if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \ + defined(__LIBPTHREAD_SOURCE__) +#include <sys/tls.h> +#include <sys/syscall.h> + +__BEGIN_DECLS +static __inline void * +__lwp_getprivate_fast(void) +{ + register void *tcb __asm("r0"); + __asm("chmk %0" :: "i"(SYS__lwp_getprivate) : "r0"); + return tcb; +} +__END_DECLS + +#endif + #endif /* !_VAX_MCONTEXT_H_ */