summaryrefslogtreecommitdiffstats
path: root/lib/libthr/arch
Commit message (Collapse)AuthorAgeFilesLines
* Unmagic the thread pointer offset.br2016-04-141-1/+1
|
* Add pthread MD part for RISC-V.br2016-01-271-0/+92
| | | | | | | Reviewed by: andrew Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5063
* Start support for the RISC-V 64-bit architecture developed by UC Berkeley.br2015-12-111-0/+1
| | | | | | | | | | | | | | | RISC-V is a new ISA designed to support computer research and education, and is now become a standard open architecture for industry implementations. This is a minimal set of changes required to run 'make kernel-toolchain' using external (GNU) toolchain. The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv. Reviewed by: andrew, bdrewery, emaste, imp Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4445
* Disable SSE in libthrvangyzen2015-08-052-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang emits SSE instructions on amd64 in the common path of pthread_mutex_unlock. If the thread does not otherwise use SSE, this usage incurs a context-switch of the FPU/SSE state, which reduces the performance of multiple real-world applications by a non-trivial amount (3-5% in one application). Instead of this change, I experimented with eagerly switching the FPU state at context-switch time. This did not help. Most of the cost seems to be in the read/write of memory--as kib@ stated--and not in the #NM handling. I tested on machines with and without XSAVEOPT. One counter-argument to this change is that most applications already use SIMD, and the number of applications and amount of SIMD usage are only increasing. This is absolutely true. I agree that--in general and in principle--this change is in the wrong direction. However, there are applications that do not use enough SSE to offset the extra context-switch cost. SSE does not provide a clear benefit in the current libthr code with the current compiler, but it does provide a clear loss in some cases. Therefore, disabling SSE in libthr is a non-loss for most, and a gain for some. I refrained from disabling SSE in libc--as was suggested--because I can't make the above argument for libc. It provides a wide variety of code; each case should be analyzed separately. https://lists.freebsd.org/pipermail/freebsd-current/2015-March/055193.html Suggestions from: dim, jmg, rpaulo Approved by: kib (mentor) MFC after: 2 weeks Sponsored by: Dell Inc.
* Add pthread_md.h for arm64.andrew2015-03-301-0/+84
| | | | | | Differential Revision: https://reviews.freebsd.org/D2137 Reviewed by: kib Sponsored by: The FreeBSD Foundation
* Start to import support for the AArch64 architecture from ARM. This changeandrew2015-03-191-0/+2
| | | | | | | | | | | | | | | | | only adds support for kernel-toolchain, however it is expected further changes to add kernel and userland support will be committed as they are reviewed. As our copy of binutils is too old the devel/aarch64-binutils port needs to be installed to pull in a linker. To build either TARGET needs to be set to arm64, or TARGET_ARCH set to aarch64. The latter is set so uname -p will return aarch64 as existing third party software expects this. Differential Revision: https://reviews.freebsd.org/D2005 Relnotes: Yes Sponsored by: The FreeBSD Foundation
* Merge all the copies of _tcb_ctor and _tcb_dtor.andrew2015-01-2118-376/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The amd64, i386, and sparc64 versions were identical, with the one difference where the former two used inline asm instead of _tcb_get. I have compared the function before and after replacing the asm with _tcb_get and found the object files to be identical. The arm, mips, and powerpc versions were almost identical. The only difference was the powerpc version used an alignment of 1 where arm and mips used 16. As this is an increase in alignment is will be safe. Along with this arm, mips, and powerpc all passed, when initial was true, the value returned from _tcb_get as the first argument to _rtld_allocate_tls. This would then return this pointer back to the caller. We can remove these extra calls by checking if initial is set and setting the thread control block directly. As this is what the sparc64 code does we can use it directly. As after these observations all the architectures can now have identical code we can merge them into a common file. Differential Revision: https://reviews.freebsd.org/D1556 Reviewed by: kib Sponsored by: The FreeBSD Foundation
* Avoid use of register variables. Clang 3.5 treats this as undefined behavior,jhibbits2015-01-061-7/+7
| | | | | | and bad things happen. MFC after: 1 week
* Remove ia64.marcel2014-07-074-174/+0
| | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan
* Merging of projects/armv6, part 2gonzo2012-08-151-1/+13
| | | | Handle TLS for ARMv6 and ARMv7
* - Switch to saving non-offseted pointer to TLS block in order too keep ↵gonzo2012-03-061-8/+4
| | | | things simple
* Add thread-local storage support for arm:gonzo2012-02-142-4/+5
| | | | | - Switch to Variant I TCB layout - Use function from rtld for TCB allocation/deallocation
* Switch MIPS TLS implementation to Variant I:gonzo2012-02-102-13/+20
| | | | | Save pointer to the TLS structure taking into account TP_OFFSET and TCB structure size.
* The TCB_GET32() and TCB_GET64() macros in the i386 and amd64-specificdim2011-12-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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
* Merge from r161730:marius2011-06-184-21/+54
| | | | | | | | | | | | | | | | | | | | 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
* Add section .note.GNU-stack for assembly files used by 386 and amd64.kib2011-01-072-0/+4
|
* Merge from tbemd, with a small amount of rework:imp2010-09-137-14/+0
| | | | | | | | | | 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...
* Unify 32-bit and 64-bit PowerPC libthr support. This reduces codenwhitehorn2010-08-245-145/+14
| | | | | | duplication, and simplifies the TBEMD import. Requested by: imp
* Fix SVN mismerge. We somehow ended up with the 32-bit powerpc versionnwhitehorn2010-07-112-4/+4
| | | | in arch/powerpc64 instead of the 64-bit one.
* Powerpc64 thread libraries support.nwhitehorn2010-07-103-0/+143
|
* Merge r195129 from project/mips to head by hand:imp2010-01-091-2/+6
| | | | | 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
* Implement _umtx_op_err() for ia64.marcel2009-10-243-1/+38
|
* Commit missing mips libthr support that I thought I'd committed earlierimp2008-05-112-0/+141
|
* Bring in mips threads support from perforce mips2-jnpr branch.imp2008-04-261-0/+5
|
* Replace function _umtx_op with _umtx_op_err, the later function directlydavidxu2008-04-026-2/+81
| | | | | | 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.
* style.Makefile(5)obrien2008-02-136-6/+6
|
* style(9)obrien2008-02-132-6/+6
|
* - Remove variable _thr_scope_system, all threads are system scope.davidxu2006-12-156-1/+11
| | | | | - Rename _thr_smp_cpus to boolean variable _thr_is_smp. - Define CPU_SPINWAIT macro for each arch, only X86 supports it.
* Stylize: avoid using a global register variable.marcel2006-09-012-6/+8
|
* Rename TLS_TP_OFFSET back to TP_OFFSET. The former clashes with rtld.marcel2006-09-011-3/+3
|
* Stylize.marcel2006-09-012-17/+11
|
* Stylize.marcel2006-08-311-6/+2
|
* TLS fixes:marcel2006-08-312-4/+8
| | | | | | | 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.
* Fix harmless bug: sizeof(tcb) equals sizeof(void*) not sizeof(struct tcb).marcel2006-08-311-1/+1
| | | | The argument is (currently) not used by _rtld_free_tls().
* o Set TP using inline assembly to avoid dead code elimination.marcel2006-08-301-5/+3
| | | | o Eliminate _tcb.
* Remove alpha left-overs.ru2006-08-223-133/+0
|
* Remove declaration of _thr_initial from MD header file, it is no longerdavidxu2006-04-042-4/+0
| | | | needed.
* Simplify _get_curthread() and _tcb_ctor because libc and rtld nowdavidxu2006-04-044-15/+6
| | | | | already allocate thread pointer space in tls block for initial thread. Only i386 and amd64 have been done, others still have to be tested.
* Remove functions i386_get_gsbase and i386_set_gsbase, they were alreadydavidxu2006-01-071-14/+0
| | | | in libc.
* Remove unused variable.davidxu2005-10-292-9/+0
| | | | Reviewed by: cognet
* Kill unused variable declaration.davidxu2005-10-291-2/+0
|
* Remove COMPAT_32BIT, it is no longer needed.davidxu2005-04-271-5/+0
|
* Remove unused variable.davidxu2005-04-231-1/+0
|
* Now libthr only uses GDT based tls on i386. using LDT can only increasedavidxu2005-04-232-53/+3
| | | | clock cycles and has 8191 threads limitation.
* Add i386_get_gsbase, i386_set_gsbase since old libc doesn't have thedavidxu2005-04-231-0/+14
| | | | functions, otherwise user ports have to be rebuilt.
* Adapt the libpthread patch for using i386_set_gsbase() to libthr.peter2005-04-142-16/+41
|
* Use the new atomic_cmpset_32().cognet2005-04-072-20/+0
|
* Import my recent 1:1 threading working. some features improved includes:davidxu2005-04-0224-354/+941
| | | | | | | | | | | | | | | | 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
* Fix inverted #ifdef that I added. Who had the pointy hat last?peter2004-12-061-1/+1
| | | | Submitted by: kan
* Use the recently exposed fs/gs set functions when compiling libthr topeter2004-11-061-0/+12
| | | | | | | 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.
OpenPOWER on IntegriCloud