pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/libpthread_dbg Import libpthread_dbg-20161124 as...
details: https://anonhg.NetBSD.org/pkgsrc/rev/617bcb5d676b
branches: trunk
changeset: 358255:617bcb5d676b
user: kamil <kamil%pkgsrc.org@localhost>
date: Wed Feb 08 01:02:19 2017 +0000
description:
Import libpthread_dbg-20161124 as devel/libpthread_dbg.
The pthread_dbg library provides an implementation of the standard POSIX
threads library debugging facilities.
The NetBSD implementation is based on 1:1 thread model, therefore each
pthread(3) has a kernel thread, called a light-weight process (LWP).
Note that the system private thread interfaces upon which the pthread(3)
library is built are subject to change without notice. In order to
remain compatible with future NetBSD releases, programs must be linked
against the dynamic version of the thread library. Statically linked
programs using the POSIX threads framework may not work when run on a
future version of the system.
The pthread_dbg library is designed to be used in debuggers and to
control and introspect the NetBSD implementation of the POSIX threads.
Software may use native LWP threads without pthread(3) layer, in that
case pthread_dbg cannot be used.
Sponsored by <The NetBSD Foundation>
diffstat:
devel/libpthread_dbg/DESCR | 17 +
devel/libpthread_dbg/Makefile | 25 +
devel/libpthread_dbg/PLIST | 15 +
devel/libpthread_dbg/distinfo | 2 +
devel/libpthread_dbg/files/Makefile | 39 +
devel/libpthread_dbg/files/arch/aarch64/pthread_md.h | 57 ++
devel/libpthread_dbg/files/arch/alpha/pthread_md.S | 57 ++
devel/libpthread_dbg/files/arch/alpha/pthread_md.h | 57 ++
devel/libpthread_dbg/files/arch/arm/pthread_md.h | 80 ++
devel/libpthread_dbg/files/arch/hppa/pthread_md.S | 67 ++
devel/libpthread_dbg/files/arch/hppa/pthread_md.h | 64 ++
devel/libpthread_dbg/files/arch/i386/pthread_md.h | 94 +++
devel/libpthread_dbg/files/arch/ia64/pthread_md.h | 45 +
devel/libpthread_dbg/files/arch/m68k/pthread_md.h | 49 +
devel/libpthread_dbg/files/arch/mips/pthread_md.h | 47 +
devel/libpthread_dbg/files/arch/or1k/pthread_md.h | 47 +
devel/libpthread_dbg/files/arch/powerpc/pthread_md.h | 61 ++
devel/libpthread_dbg/files/arch/riscv/pthread_md.h | 47 +
devel/libpthread_dbg/files/arch/sh3/pthread_md.h | 62 ++
devel/libpthread_dbg/files/arch/sparc/pthread_md.h | 50 +
devel/libpthread_dbg/files/arch/sparc64/pthread_md.h | 47 +
devel/libpthread_dbg/files/arch/vax/pthread_md.h | 58 ++
devel/libpthread_dbg/files/arch/x86_64/pthread_md.h | 97 +++
devel/libpthread_dbg/files/pthread.h | 422 +++++++++++++++
devel/libpthread_dbg/files/pthread_dbg.3 | 152 +++++
devel/libpthread_dbg/files/pthread_dbg.c | 520 +++++++++++++++++++
devel/libpthread_dbg/files/pthread_dbg.h | 200 +++++++
devel/libpthread_dbg/files/pthread_dbg_int.h | 48 +
devel/libpthread_dbg/files/pthread_int.h | 333 ++++++++++++
devel/libpthread_dbg/files/shlib_version | 5 +
devel/libpthread_dbg/files/td_map_pth2thr.3 | 71 ++
devel/libpthread_dbg/files/td_open.3 | 79 ++
devel/libpthread_dbg/files/td_thr_getname.3 | 75 ++
devel/libpthread_dbg/files/td_thr_info.3 | 109 +++
devel/libpthread_dbg/files/td_thr_iter.3 | 69 ++
35 files changed, 3267 insertions(+), 0 deletions(-)
diffs (truncated from 3407 to 300 lines):
diff -r ce0d8621045c -r 617bcb5d676b devel/libpthread_dbg/DESCR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libpthread_dbg/DESCR Wed Feb 08 01:02:19 2017 +0000
@@ -0,0 +1,17 @@
+The pthread_dbg library provides an implementation of the standard POSIX
+threads library debugging facilities.
+
+The NetBSD implementation is based on 1:1 thread model, therefore each
+pthread(3) has a kernel thread, called a light-weight process (LWP).
+
+Note that the system private thread interfaces upon which the pthread(3)
+library is built are subject to change without notice. In order to
+remain compatible with future NetBSD releases, programs must be linked
+against the dynamic version of the thread library. Statically linked
+programs using the POSIX threads framework may not work when run on a
+future version of the system.
+
+The pthread_dbg library is designed to be used in debuggers and to
+control and introspect the NetBSD implementation of the POSIX threads.
+Software may use native LWP threads without pthread(3) layer, in that
+case pthread_dbg cannot be used.
diff -r ce0d8621045c -r 617bcb5d676b devel/libpthread_dbg/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libpthread_dbg/Makefile Wed Feb 08 01:02:19 2017 +0000
@@ -0,0 +1,25 @@
+# $NetBSD: Makefile,v 1.1 2017/02/08 01:02:19 kamil Exp $
+#
+
+PKGNAME= libpthread_dbg-20161124
+CATEGORIES= pkgtools
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+#HOMEPAGE=
+COMMENT= POSIX Debug Threads Library
+LICENSE= original-bsd
+
+USE_BSD_MAKEFILE= yes
+USE_TOOLS= nroff
+
+INSTALLATION_DIRS+= include lib ${PKGMANDIR}/man3
+PKGSRC_LOCKTYPE= none # avoid "bootstrapping problem"
+
+do-extract:
+ ${CP} -R ${FILESDIR} ${WRKSRC}
+
+# XXX: What's wrong with files/Makefile?
+post-install:
+ ${CP} ${WRKSRC}/pthread_dbg.h ${DESTDIR}${PREFIX}/include
+
+.include "../../mk/bsd.pkg.mk"
diff -r ce0d8621045c -r 617bcb5d676b devel/libpthread_dbg/PLIST
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libpthread_dbg/PLIST Wed Feb 08 01:02:19 2017 +0000
@@ -0,0 +1,15 @@
+@comment $NetBSD: PLIST,v 1.1 2017/02/08 01:02:19 kamil Exp $
+include/pthread_dbg.h
+lib/libpthread_dbg.a
+lib/libpthread_dbg.so
+lib/libpthread_dbg.so.2
+lib/libpthread_dbg.so.2.0
+lib/libpthread_dbg_p.a
+lib/libpthread_dbg_pic.a
+man/man3/pthread_dbg.3
+man/man3/td_close.3
+man/man3/td_map_pth2thr.3
+man/man3/td_open.3
+man/man3/td_thr_getname.3
+man/man3/td_thr_info.3
+man/man3/td_thr_iter.3
diff -r ce0d8621045c -r 617bcb5d676b devel/libpthread_dbg/distinfo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libpthread_dbg/distinfo Wed Feb 08 01:02:19 2017 +0000
@@ -0,0 +1,2 @@
+$NetBSD: distinfo,v 1.1 2017/02/08 01:02:19 kamil Exp $
+
diff -r ce0d8621045c -r 617bcb5d676b devel/libpthread_dbg/files/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libpthread_dbg/files/Makefile Wed Feb 08 01:02:19 2017 +0000
@@ -0,0 +1,39 @@
+# $NetBSD: Makefile,v 1.1 2017/02/08 01:02:19 kamil Exp $
+#
+
+#.include <bsd.own.mk>
+
+LIB= pthread_dbg
+
+SRCS= pthread_dbg.c
+
+CPPFLAGS+= -D__LIBPTHREAD_SOURCE__
+
+.if defined(PTHREAD_MACHINE_ARCH) && !empty(PTHREAD_MACHINE_ARCH) && \
+ exists(${.CURDIR}/arch/${PTHREAD_MACHINE_ARCH})
+ARCHSUBDIR= ${PTHREAD_MACHINE_ARCH}
+.elif exists(${.CURDIR}/arch/${MACHINE_ARCH})
+ARCHSUBDIR= ${MACHINE_ARCH}
+.elif exists(${.CURDIR}/arch/${MACHINE_CPU})
+ARCHSUBDIR= ${MACHINE_CPU}
+.else
+.BEGIN:
+ @echo "no ARCHSUBDIR for ${MACHINE_ARCH}/${MACHINE_CPU}; skipping..."
+.endif
+
+ARCHDIR= ${.CURDIR}/arch/${ARCHSUBDIR}
+
+CPPFLAGS+= -I${ARCHDIR}
+
+INCS= pthread_dbg.h
+
+MAN+= pthread_dbg.3
+MAN+= td_open.3
+MAN+= td_map_pth2thr.3
+MAN+= td_thr_getname.3
+MAN+= td_thr_info.3
+MAN+= td_thr_iter.3
+
+MLINKS+= td_open.3 td_close.3
+
+.include <bsd.lib.mk>
diff -r ce0d8621045c -r 617bcb5d676b devel/libpthread_dbg/files/arch/aarch64/pthread_md.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libpthread_dbg/files/arch/aarch64/pthread_md.h Wed Feb 08 01:02:19 2017 +0000
@@ -0,0 +1,57 @@
+/* $NetBSD: pthread_md.h,v 1.1 2017/02/08 01:02:19 kamil Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 _LIB_PTHREAD_AARCH64_MD_H
+#define _LIB_PTHREAD_AARCH64_MD_H
+
+static inline uintptr_t
+pthread__sp(void)
+{
+ uintptr_t ret;
+
+ __asm __volatile("mov %0, sp" : "=r" (ret));
+
+ return ret;
+}
+
+#define pthread__smt_pause() __asm __volatile("wfe") /* wfe */
+#define pthread__smt_wake() __asm __volatile("sev") /* sev */
+
+#define pthread__uc_sp(ucp) ((ucp)->uc_mcontext.__gregs[_REG_SP])
+
+/*
+ * Set initial, sane values for registers whose values aren't just
+ * "don't care".
+ */
+#define _INITCONTEXT_U_MD(ucp) \
+ (ucp)->uc_mcontext.__gregs[_REG_SPSR] = 0;
+
+#endif /* _LIB_PTHREAD_AARCH64_MD_H */
diff -r ce0d8621045c -r 617bcb5d676b devel/libpthread_dbg/files/arch/alpha/pthread_md.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libpthread_dbg/files/arch/alpha/pthread_md.S Wed Feb 08 01:02:19 2017 +0000
@@ -0,0 +1,57 @@
+/* $NetBSD: pthread_md.S,v 1.1 2017/02/08 01:02:19 kamil Exp $ */
+
+/*-
+ * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson.
+
+ * 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 <machine/asm.h>
+
+ .align 2
+LEAF(pthread__ras_simple_lock_init, 1)
+ stl zero, 0(a0)
+ nop
+ RET
+END(pthread__ras_simple_lock_init)
+
+ .align 2
+LEAF(pthread__ras_simple_lock_try, 1)
+ ldiq t0, 1
+pthread__lock_ras_start: .globl pthread__lock_ras_start
+ ldl v0, 0(a0)
+ stl t0, 0(a0)
+pthread__lock_ras_end: .globl pthread__lock_ras_end
+ cmpeq v0, 0, v0
+ RET
+END(pthread__ras_simple_lock_try)
+
+ .align 2
+LEAF(pthread__ras_simple_unlock, 1)
+ stl zero, 0(a0)
+ nop
+ RET
+END(pthread__ras_simple_unlock)
diff -r ce0d8621045c -r 617bcb5d676b devel/libpthread_dbg/files/arch/alpha/pthread_md.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libpthread_dbg/files/arch/alpha/pthread_md.h Wed Feb 08 01:02:19 2017 +0000
@@ -0,0 +1,57 @@
+/* $NetBSD: pthread_md.h,v 1.1 2017/02/08 01:02:19 kamil Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nathan J. Williams.
+ *
+ * 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 _LIB_PTHREAD_ALPHA_MD_H
+#define _LIB_PTHREAD_ALPHA_MD_H
+
+#define PTHREAD__ASM_RASOPS
+
+static inline unsigned long
+pthread__sp(void)
+{
+ unsigned long ret;
+
+ __asm("mov $30, %0" : "=r" (ret));
+
+ return ret;
+}
+
+#define pthread__uc_sp(ucp) ((ucp)->uc_mcontext.__gregs[_REG_SP])
+
+/*
+ * Set initial, sane values for registers whose values aren't just
+ * "don't care".
+ * 0x0008 is ALPHA_PSL_USERSET from arch/alpha/include/alpha_cpu.h
+ */
+#define _INITCONTEXT_U_MD(ucp) \
+ (ucp)->uc_mcontext.__gregs[_REG_PS] = 0x0008;
+
Home |
Main Index |
Thread Index |
Old Index