History log of /freebsd-10.1-release/lib/libthr/arch/
Revision Date Author Comments
272461 03-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


239270 15-Aug-2012 gonzo

Merging of projects/armv6, part 2

Handle TLS for ARMv6 and ARMv7


232579 06-Mar-2012 gonzo

- Switch to saving non-offseted pointer to TLS block in order too keep things simple


231619 14-Feb-2012 gonzo

Add thread-local storage support for arm:

- Switch to Variant I TCB layout
- Use function from rtld for TCB allocation/deallocation


231350 10-Feb-2012 gonzo

Switch MIPS TLS implementation to Variant I:

Save pointer to the TLS structure taking into account TP_OFFSET
and TCB structure size.


228536 15-Dec-2011 dim

The TCB_GET32() and TCB_GET64() macros in the i386 and amd64-specific
versions of pthread_md.h have a special case of dereferencing a null
pointer. Clang warns about this with:

In file included from lib/libthr/arch/i386/i386/pthread_md.c:36:
lib/libthr/arch/i386/include/pthread_md.h:96:10: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
return (TCB_GET32(tcb_self));
^~~~~~~~~~~~~~~~~~~
lib/libthr/arch/i386/include/pthread_md.h:73:13: note: expanded from:
: "m" (*(u_int *)(__tcb_offset(name)))); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/libthr/arch/i386/include/pthread_md.h:96:10: note: consider using __builtin_trap() or qualifying pointer with 'volatile'

Since this indirection is done relative to the fs or gs segment, to
retrieve thread-specific data, it is an exception to the rule.

Therefore, add a volatile qualifier to tell the compiler we really want
to dereference a zero address.

MFC after: 1 week


223228 18-Jun-2011 marius

Merge from r161730:
o Set TP using inline assembly to avoid dead code elimination.
o Eliminate _tcb.

Merge from r161840:
Stylize: avoid using a global register variable.

Merge from r157461:
Simplify _get_curthread() and _tcb_ctor because libc and rtld now
already allocate thread pointer space in tls block for initial thread.

Merge from r177853:
Replace function _umtx_op with _umtx_op_err, the later function directly
returns errno, because errno can be mucked by user's signal handler and
most of pthread api heavily depends on errno to be correct, this change
should improve stability of the thread library.

MFC after: 1 week


217107 07-Jan-2011 kib

Add section .note.GNU-stack for assembly files used by 386 and amd64.


212516 13-Sep-2010 imp

Merge from tbemd, with a small amount of rework:
For all libthr contexts, use ${MACHINE_CPUARCH}
for all libc contexts, use ${MACHINE_ARCH} if it exists, otherwise use
${MACHINE_CPUARCH}
Move some common code up a layer (the .PATH statement was the same in
all the arch submakefiles).

# Hope she hasn't busted powerpc64 with this...


211773 24-Aug-2010 nwhitehorn

Unify 32-bit and 64-bit PowerPC libthr support. This reduces code
duplication, and simplifies the TBEMD import.

Requested by: imp


209893 11-Jul-2010 nwhitehorn

Fix SVN mismerge. We somehow ended up with the 32-bit powerpc version
in arch/powerpc64 instead of the 64-bit one.


209880 10-Jul-2010 nwhitehorn

Powerpc64 thread libraries support.


201864 09-Jan-2010 imp

Merge r195129 from project/mips to head by hand:

r195129 | gonzo | 2009-06-27 17:28:56 -0600 (Sat, 27 Jun 2009) | 2 lines
- Use sysarch(2) in MIPS version of _tcb_set/_tcb_get


198450 24-Oct-2009 marcel

Implement _umtx_op_err() for ia64.


178938 11-May-2008 imp

Commit missing mips libthr support that I thought I'd committed earlier


178581 26-Apr-2008 imp

Bring in mips threads support from perforce mips2-jnpr branch.


177853 02-Apr-2008 davidxu

Replace function _umtx_op with _umtx_op_err, the later function directly
returns errno, because errno can be mucked by user's signal handler and
most of pthread api heavily depends on errno to be correct, this change
should improve stability of the thread library.


176226 13-Feb-2008 obrien

style.Makefile(5)


176225 13-Feb-2008 obrien

style(9)


165241 15-Dec-2006 davidxu

- Remove variable _thr_scope_system, all threads are system scope.
- Rename _thr_smp_cpus to boolean variable _thr_is_smp.
- Define CPU_SPINWAIT macro for each arch, only X86 supports it.


161840 01-Sep-2006 marcel

Stylize: avoid using a global register variable.


161804 01-Sep-2006 marcel

Rename TLS_TP_OFFSET back to TP_OFFSET. The former clashes with rtld.


161801 01-Sep-2006 marcel

Stylize.


161787 31-Aug-2006 marcel

Stylize.


161780 31-Aug-2006 marcel

TLS fixes:
o The TLS pointer (r2) points 0x7000 after the *end* of the TCB.
o _rtld_allocate_tls() gets a pointer to the current TCB, not the
current TLS pointer.
o _rtld_free_tls() gets the size of the TCB structure.


161779 31-Aug-2006 marcel

Fix harmless bug: sizeof(tcb) equals sizeof(void*) not sizeof(struct tcb).
The argument is (currently) not used by _rtld_free_tls().


161730 30-Aug-2006 marcel

o Set TP using inline assembly to avoid dead code elimination.
o Eliminate _tcb.


161526 22-Aug-2006 ru

Remove alpha left-overs.


157462 04-Apr-2006 davidxu

Remove declaration of _thr_initial from MD header file, it is no longer
needed.


157461 04-Apr-2006 davidxu

Simplify _get_curthread() and _tcb_ctor because libc and rtld now
already allocate thread pointer space in tls block for initial thread.
Only i386 and amd64 have been done, others still have to be tested.


154095 07-Jan-2006 davidxu

Remove functions i386_get_gsbase and i386_set_gsbase, they were already
in libc.


151859 29-Oct-2005 davidxu

Remove unused variable.

Reviewed by: cognet


151836 29-Oct-2005 davidxu

Kill unused variable declaration.


145578 27-Apr-2005 davidxu

Remove COMPAT_32BIT, it is no longer needed.


145438 23-Apr-2005 davidxu

Remove unused variable.


145437 23-Apr-2005 davidxu

Now libthr only uses GDT based tls on i386. using LDT can only increase
clock cycles and has 8191 threads limitation.


145431 23-Apr-2005 davidxu

Add i386_get_gsbase, i386_set_gsbase since old libc doesn't have the
functions, otherwise user ports have to be rebuilt.


145040 14-Apr-2005 peter

Adapt the libpthread patch for using i386_set_gsbase() to libthr.


144765 07-Apr-2005 cognet

Use the new atomic_cmpset_32().


144518 02-Apr-2005 davidxu

Import my recent 1:1 threading working. some features improved includes:
1. fast simple type mutex.
2. __thread tls works.
3. asynchronous cancellation works ( using signal ).
4. thread synchronization is fully based on umtx, mainly, condition
variable and other synchronization objects were rewritten by using
umtx directly. those objects can be shared between processes via
shared memory, it has to change ABI which does not happen yet.
5. default stack size is increased to 1M on 32 bits platform, 2M for
64 bits platform.
As the result, some mysql super-smack benchmarks show performance is
improved massivly.

Okayed by: jeff, mtm, rwatson, scottl


138494 06-Dec-2004 peter

Fix inverted #ifdef that I added. Who had the pointy hat last?

Submitted by: kan


137292 06-Nov-2004 peter

Use the recently exposed fs/gs set functions when compiling libthr to
run as a 32 bit support library for an amd64 kernel. 32 bit consumers of
libthr have zero chance of running on an amd64 kernel since we don't
implement the i386_set_ldt() family of functions. Note that this commit
doesn't make it actually work, it just removes one more obstacle.


134051 19-Aug-2004 davidxu

Adjust code to support AMD64, on AMD64, thread needs to set fsbase by
itself before it can execute any other code, so new thread should be
created with all signals are masked until after fsbase is set.


134050 19-Aug-2004 davidxu

Add AMD64 support code.


133755 15-Aug-2004 dfr

Add TLS support for libthr on i386.


126643 05-Mar-2004 markm

Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT
C++" (implying C).

There are places where (void *) pointers are not valid, such as for
function pointers, but in the special case of (void *)0, agreement
settles on it being OK.

Most of the fixes were NULL where an integer zero was needed; many
of the fixes were NULL where ascii <nul> ('\0') was needed, and a
few were just "other".

Tested on: i386 sparc64


126476 02-Mar-2004 grehan

libthr powerpc support.

Submitted by: Suleiman Souhlal <refugee@segfaulted.com>
Tested with: most libpthread tests, Apache 'worker' MDM


125307 01-Feb-2004 mtm

Bump up the maximum number concurrent threads on x86.


123107 02-Dec-2003 mtm

Use dynamic instead of static LDT allocation.

Approved by: re (scottl)


117959 24-Jul-2003 marcel

Implement _get_curthread and _set_curthread. We use GCCs builtin
function this, which expands to PAL calls (rduniq and wruniq).
This needs adjustment when TLS is implemented.


117784 19-Jul-2003 mtm

This commit was generated by cvs2svn to compensate for changes in r117783,
which included commits to RCS files with non-trunk default branches.


117012 29-Jun-2003 mtm

The move to _retire() a thread in the GC instead of in the thread's
exit function has invalidated the need for _spin[un]lock_pthread().
The _spin[un]lock() functions can now dereference curthread without
the danger that the ldtentry containing the pointer to the thread
has been cleared out from under them.


115666 02-Jun-2003 obrien

.S comments must be C comments, not ASM ones.


115388 29-May-2003 mtm

Missing unlock.

Approved by: re/jhb


115313 25-May-2003 mtm

Return gracefully, rather than aborting, when the maximum concurrent
threads per process has been reached. Return EAGAIN, as per spec.

Approved by: re/blanket libthr


115302 25-May-2003 marcel

The struct mcontext has changed. It's using the register sets. Bring
this in line.


115271 23-May-2003 mtm

Add two functions: _spinlock_pthread() and _spinunlock_pthread()
that take the address of a struct pthread as their first argument.
_spin[un]lock() just become wrappers arround these two functions.
These new functions are for use in situations where curthread can't be
used. One example is _thread_retire(), where we invalidate the array index
curthread uses to get its pointer..

Approved by: re/blanket libthr


115260 23-May-2003 mtm

Make WARNS2 clean. The fixes mostly included:
o removed unused variables
o explicit inclusion of header files
o prototypes for externally defined functions

Approved by: re/blanket libthr


115203 21-May-2003 mtm

o Make the defenition of _set_curthread() match its declaration
in thr_private.h

o Lock down the ldt_entries array and ldt_free, which points to
the next free slot. As noted in the comments, it's necessary
to special case the initial_thread because %gs is not setup
for it yet. This is ok because that early in the program there
won't be any reentrancy issues anyways.

Approved by: re/blanket libthr


114773 06-May-2003 mtm

Fix a null dereference leading to a core dump when
the number of threads exceeds the number of open slots
in ldt_entries[].

Approved by: markm (mentor)(implicit)
Reviewed by: jeff


113735 20-Apr-2003 marcel

Add support for ia64.

Note that the tp register (r13) is reserved as the TLS pointer in
the same way that that gp register (r1) is reserved as the global
pointer. This implementation uses the tp register to point to the
thread structure used by the threads implementation. This is not
in violation with the runtime specification provided the TLS is
a fixed distance from the thread structure. This is only an issue
when code used the __thread keyword to create TLS. This is not
supported at the moment.


112995 03-Apr-2003 jake

- Pass a ucontext_t to _set_curthread. If non-NULL the new thread is set
as curthread in the new context, so that it will be set automatically when
the thread is switched to. This fixes a race where we'd run for a little
while with curthread unset in _thread_start.

Reviewed by: jeff


112992 02-Apr-2003 jeff

- Don't overrun the ldt buffer.

Submitted by: gordan@freebsd.org


112969 02-Apr-2003 jake

Implement _get_curthread and _set_curthread. This is especially easy.


112964 01-Apr-2003 jake

Add MD makefile.


112925 01-Apr-2003 jeff

- Adjust the makefiles so we have a per architecture makefile.


112918 01-Apr-2003 jeff

- Add libthr but don't hook it up to the regular build yet. This is an
adaptation of libc_r for the thr system call interface. This is beta
quality code.