Implement _umtx_op_err.S on powerpc / powerpc64.As per r177853, we need to avoid using errno inside user mutex code, since signal handlers can interfere with it and mess up libthr internal state.
Implement _umtx_op_err.S on powerpc / powerpc64.As per r177853, we need to avoid using errno inside user mutex code, since signal handlers can interfere with it and mess up libthr internal state.So, implement _umtx_op_err() instead, which makes a raw syscall andreturns the error value directly instead of using errno.Approved by: jhibbits (mentor)Differential Revision: https://reviews.freebsd.org/D20946
show more ...
Fix initial exec TLS mode for dynamically loaded shared objects.If dso uses initial exec TLS mode, rtld tries to allocate TLS instatic space. If there is no space left, the dlopen(3) fails. If spa
Fix initial exec TLS mode for dynamically loaded shared objects.If dso uses initial exec TLS mode, rtld tries to allocate TLS instatic space. If there is no space left, the dlopen(3) fails. If spaceif allocated, initial content from PT_TLS segment is distributed toall threads' pcbs, which was missed and caused un-initialized TLSsegment for such dso after dlopen(3).The mode is auto-detected either due to the relocation used, or if theDF_STATIC_TLS dynamic flag is set. In the later case, the TLS segmentis tried to allocate earlier, which increases chance of the dlopen(3)to succeed. LLD was recently fixed to properly emit the flag, ld.bdfdid it always.Initial test by: dumbbellTested by: emaste (amd64), ian (arm)Tested by: Gerald Aryeetey <aryeeteygerald_rogers.com> (arm64)Sponsored by: The FreeBSD FoundationMFC after: 2 weeksDifferential revision: https://reviews.freebsd.org/D19072
silence cast-align warnings from clang on powerpc64silence the following warning when compiling libthr with clang 8for powerpc64 architecture:usr/src/lib/libthr/arch/powerpc/include/pthread_md.h
silence cast-align warnings from clang on powerpc64silence the following warning when compiling libthr with clang 8for powerpc64 architecture:usr/src/lib/libthr/arch/powerpc/include/pthread_md.h:82:10: error:cast from 'uint8_t *' (aka 'unsigned char *') to 'struct tcb *'increases required alignment from 1 to 8 [-Werror,-Wcast-align]82: return ((struct tcb *)(_tp - TP_OFFSET));Submitted by: alfredo.junior_eldorado.org.brReviewed by: git_bdragon.rtk0.net, emaste, kib, jhibbits, luporlDifferential Revision: https://reviews.freebsd.org/D18807
lib: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using mis-identified many licenses so this was mostly a manual - errorpr
lib: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using mis-identified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
libthr: fix warnings at WARNS=6Fix more warnings about redundant declarations.Reviewed by: kib emasteMFC after: 3 daysSponsored by: Dell EMCDifferential Revision: https://reviews.freebsd.org/D
libthr: fix warnings at WARNS=6Fix more warnings about redundant declarations.Reviewed by: kib emasteMFC after: 3 daysSponsored by: Dell EMCDifferential Revision: https://reviews.freebsd.org/D10932
Merge all the copies of _tcb_ctor and _tcb_dtor.The amd64, i386, and sparc64 versions were identical, with the onedifference where the former two used inline asm instead of _tcb_get. Ihave compar
Merge all the copies of _tcb_ctor and _tcb_dtor.The amd64, i386, and sparc64 versions were identical, with the onedifference where the former two used inline asm instead of _tcb_get. Ihave compared the function before and after replacing the asm with _tcb_getand found the object files to be identical.The arm, mips, and powerpc versions were almost identical. The onlydifference was the powerpc version used an alignment of 1 where arm andmips 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 settingthe thread control block directly. As this is what the sparc64 code doeswe can use it directly.As after these observations all the architectures can now have identicalcode we can merge them into a common file.Differential Revision: https://reviews.freebsd.org/D1556Reviewed by: kibSponsored by: The FreeBSD Foundation
Avoid use of register variables. Clang 3.5 treats this as undefined behavior,and bad things happen.MFC after: 1 week
Unify 32-bit and 64-bit PowerPC libthr support. This reduces codeduplication, and simplifies the TBEMD import.Requested by: imp
- 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.
Rename TLS_TP_OFFSET back to TP_OFFSET. The former clashes with rtld.
Stylize.
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 si
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.
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 synchroni
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 isimproved massivly.Okayed by: jeff, mtm, rwatson, scottl