about summary refs log tree commit diff
path: root/sysdeps/htl
Commit message (Collapse)AuthorAgeFilesLines
* htl: Implement some support for TLS_DTV_AT_TPSergey Bugaev2024-03-231-2/+14
| | | | | Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-ID: <20240323173301.151066-19-bugaevc@gmail.com>
* htl: Respect GL(dl_stack_flags) when allocating stacksSergey Bugaev2024-03-231-0/+4
| | | | | | | | | | | | Previously, HTL would always allocate non-executable stacks. This has never been noticed, since GNU Mach on x86 ignores VM_PROT_EXECUTE and makes all pages implicitly executable. Since GNU Mach on AArch64 supports non-executable pages, HTL forgetting to pass VM_PROT_EXECUTE immediately breaks any code that (unfortunately, still) relies on executable stacks. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-ID: <20240323173301.151066-7-bugaevc@gmail.com>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-01114-114/+114
|
* htl: move pthread_attr_setdetachstate into libcGuy-Fleury Iteriteka2023-08-241-2/+0
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230716084414.107245-11-gfleury@disroot.org>
* htl: move pthread_attr_getdetachstate into libcGuy-Fleury Iteriteka2023-08-241-2/+0
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230716084414.107245-10-gfleury@disroot.org>
* htl: move pthread_attr_setschedpolicy into libcGuy-Fleury Iteriteka2023-08-241-2/+0
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230716084414.107245-9-gfleury@disroot.org>
* htl: move pthread_attr_getschedpolicy into libcGuy-Fleury Iteriteka2023-08-241-2/+0
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230716084414.107245-8-gfleury@disroot.org>
* htl: move pthread_attr_setinheritsched into libcGuy-Fleury Iteriteka2023-08-241-2/+0
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230716084414.107245-7-gfleury@disroot.org>
* htl: move pthread_attr_getinheritsched into libcGuy-Fleury Iteriteka2023-08-241-2/+0
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230716084414.107245-6-gfleury@disroot.org>
* htl: move pthread_attr_getschedparam into libcGuy-Fleury Iteriteka2023-08-241-4/+0
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230716084414.107245-5-gfleury@disroot.org>
* htl: move pthread_setschedparam into libcGuy-Fleury Iteriteka2023-08-241-4/+0
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230716084414.107245-4-gfleury@disroot.org>
* htl: move pthread_getschedparam into libcGuy-Fleury Iteriteka2023-08-241-2/+0
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230716084414.107245-3-gfleury@disroot.org>
* htl: move pthread_equal into libcGuy-Fleury Iteriteka2023-08-241-2/+0
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230716084414.107245-2-gfleury@disroot.org>
* htl: Add support for static TSD dataSamuel Thibault2023-08-087-18/+97
| | | | | | When using jemalloc, malloc() needs to use TSD, while libpthread initialization needs malloc(). Supporting a static TSD area allows jemalloc and libpthread to initialize together.
* Fix misspellings in sysdeps/ -- BZ 25337Paul Pluzhnikov2023-05-308-13/+13
|
* htl: Use __hurd_fail () instead of assigning errnoSergey Bugaev2023-05-204-18/+9
| | | | | Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230520115531.3911877-2-bugaevc@gmail.com>
* hurd 64bit: Fix pthread_t/thread_t type to longSamuel Thibault2023-05-014-2/+50
| | | | So that they can be trivially cast to pointer type, like with nptl.
* hurd 64bit: Add missing libanlSamuel Thibault2023-05-011-0/+1
| | | | The move of libanl to libc was in glibc 2.34 for nptl only.
* htl: move pthread_self info libc.Guy-Fleury Iteriteka2023-04-052-2/+2
| | | | | Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230318095826.1125734-4-gfleury@disroot.org>
* htl: Remove ./sysdeps/htl/bits/types/struct___pthread_mutex.hSamuel Thibault2023-02-121-61/+0
| | | | This follows a99155555c21 ("htl: Remove unused files")
* htl: Fix semaphore referenceSergey Bugaev2023-02-121-5/+5
| | | | | | | 'sem' is the opaque 'sem_t', 'isem' is the actual 'struct new_sem'. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-6-bugaevc@gmail.com>
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-06113-113/+113
|
* htl: Fix sem_wait race between read and gsync_waitSamuel Thibault2022-12-301-2/+2
| | | | | | | | | If the value changes between sem_wait's read and the gsync_wait call, the kernel will return KERN_INVALID_ARGUMENT, which we have to interpret as the value having already changed. This fixes applications (e.g. libgo) seeing sem_wait erroneously return KERN_INVALID_ARGUMENT.
* htl: Make pthread*_cond_timedwait register wref before releasing mutexSamuel Thibault2022-08-221-4/+6
| | | | | Otherwise another thread could be rightly trying to destroy the condition, see e.g. tst-cond20.
* htl: Fix initializing the key lockSamuel Thibault2022-02-142-3/+5
| | | | | | The static pthread_once_t in the pt-key.h header was creating one pthread_once_t per includer. We have to use a shared common pthread_once_t instead.
* htl: Make pthread_[gs]etspecific not check for key validitySamuel Thibault2022-02-142-4/+2
| | | | | | | Since __pthread_key_create might be concurrently reallocating the __pthread_key_destructors array, it's not safe to access it without the mutex held. Posix explicitly says we are allowed to prefer performance over error detection.
* htl: Fix build error in annexcSamuel Thibault2022-01-171-2/+4
| | | | | | | | | | | We were getting ../scripts/evaluate-test.sh posix/annexc $? true false > /usr/src/glibc-upstream/build/posix/annexc.test-result In file included from ../include/pthread.h:1, from <stdin>:1: ../sysdeps/htl/include/pthread.h:7:62: error: missing binary operator before token "(" 7 | # if defined __USE_EXTERN_INLINES && defined _LIBC && !IS_IN (libsupport) | ^
* htl: Hide __pthread_attr's __schedparam type [BZ #23088]Samuel Thibault2022-01-155-9/+11
| | | | | | | | | | The content of the structure is only used internally, so we can make __pthread_attr_getschedparam and __pthread_attr_setschedparam convert between the public sched_param type and an internal __sched_param. This allows to avoid to spuriously expose the sched_param type. This fixes BZ #23088.
* Update copyright dates with scripts/update-copyrightsPaul Eggert2022-01-01113-113/+113
| | | | | | | | | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
* htl: Reimplement GSCOPESergey Bugaev2021-09-161-0/+55
| | | | | | | | | | | | | | | | This is a new implementation of GSCOPE which largely mirrors its NPTL counterpart. Same as in NPTL, instead of a global flag shared between threads, there is now a per-thread GSCOPE flag stored in each thread's TCB. This makes entering and exiting a GSCOPE faster at the expense of making THREAD_GSCOPE_WAIT () slower. The largest win is the elimination of many redundant gsync_wake () RPC calls; previously, even simplest programs would make dozens of fully redundant gsync_wake () calls. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20210915171110.226187-3-bugaevc@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* htl: Move thread table to ld.soSergey Bugaev2021-09-165-8/+40
| | | | | | | | | | | The next commit is going to introduce a new implementation of THREAD_GSCOPE_WAIT which needs to access the list of threads. Since it must be usable from the dynamic laoder, we have to move the symbols for the list of threads into the loader. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20210915171110.226187-2-bugaevc@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* Remove "Contributed by" linesSiddhesh Poyarekar2021-09-032-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | We stopped adding "Contributed by" or similar lines in sources in 2012 in favour of git logs and keeping the Contributors section of the glibc manual up to date. Removing these lines makes the license header a bit more consistent across files and also removes the possibility of error in attribution when license blocks or files are copied across since the contributed-by lines don't actually reflect reality in those cases. Move all "Contributed by" and similar lines (Written by, Test by, etc.) into a new file CONTRIBUTED-BY to retain record of these contributions. These contributors are also mentioned in manual/contrib.texi, so we just maintain this additional record as a courtesy to the earlier developers. The following scripts were used to filter a list of files to edit in place and to clean up the CONTRIBUTED-BY file respectively. These were not added to the glibc sources because they're not expected to be of any use in future given that this is a one time task: https://gist.github.com/siddhesh/b5ecac94eabfd72ed2916d6d8157e7dc https://gist.github.com/siddhesh/15ea1f5e435ace9774f485030695ee02 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* htl: Do not expose pthread hidden proto outside libpthreadSamuel Thibault2021-07-181-3/+3
| | | | Only libpthread.so can access them.
* htl: Fix linking static examples against libpthreadSamuel Thibault2021-07-131-1/+1
| | | | libpthread.a uses some mach and hurd RPCs so we need to link them in.
* htl: Let libc call __pthread_mutex_{,try,un}lockSamuel Thibault2021-07-131-0/+3
| | | | | Now that NPTL was moved to libc, libc makes internal __pthread calls, so htl has to expose them internally.
* Linux: Cleanups after librt moveFlorian Weimer2021-06-281-0/+6
| | | | | | | | | | | | librt.so is no longer installed for PTHREAD_IN_LIBC, and tests are not linked against it. $(librt) is introduced globally for shared tests that need to be linked for both PTHREAD_IN_LIBC and !PTHREAD_IN_LIBC. GLIBC_PRIVATE symbols that were needed during the transition are removed again. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Consolidate pthread_atforkAdhemerval Zanella2021-06-243-67/+4
| | | | | | | | | | | | The pthread_atfork is similar between Linux and Hurd, only the compat version bits differs. The generic version is place at sysdeps/pthread with a common name. It also fixes an issue with Hurd license, where the static-only object did not use LGPL + exception. Checked on x86_64-linux-gnu, i686-linux-gnu, and with a build for i686-gnu.
* rt: Move generic implementation from sysdeps/pthread to rtFlorian Weimer2021-06-221-0/+555
| | | | | | | | | | | | | | | | | | The pthread-based implementation is the generic one. Replacing the stubs makes it clear that they do not have to be adjusted for the libpthread move. Result of: git mv -f sysdeps/pthread/aio_misc.h sysdeps/generic/ git mv sysdeps/pthread/timer_routines.c sysdeps/htl/ git mv -f sysdeps/pthread/{aio,lio,timer}_*.c rt/ Followed by manual adjustment of the #include paths in sysdeps/unix/sysv/linux/wordsize-64, and a move of the version definitions formerly in sysdeps/pthread/Versions. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Implement raise in terms of pthread_killAdhemerval Zanella2021-06-091-2/+0
| | | | | | | | | | | | | | | | Now that pthread_kill is provided by libc.so it is possible to implement the generic POSIX implementation as 'pthread_kill(pthread_self(), sig)'. For Linux implementation, pthread_kill read the targeting TID from the TCB. For raise, this it not possible because it would make raise fail when issue after vfork (where creates the resulting process has a different TID from the parent, but its TCB is not updated as for pthread_create). To make raise use pthread_kill, it is make usable from vfork by getting the target thread id through gettid syscall. Checked on x86_64-linux-gnu and aarch64-linux-gnu.
* Hurd: Define ARCH_MIN_GUARD_SIZE in internal <pthread.h>Florian Weimer2021-05-201-0/+3
| | | | | | This macro is always defined on Linux. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* Add __attribute_access_none to disable GCC warnings [BZ #27714]Martin Sebor2021-04-271-1/+1
| | | | | | | | | | | | | | | | GCC 11 warns when a pointer to an uninitialized object is passed to a function that takes a const-qualified argument. This is done on the assumption that most such functions read from the object. For the rare case of a function that doesn't, GCC 11 extends attribute access to add a new mode called none. POSIX pthread_setspecific() is one such rare function that takes a const void* argument but that doesn't read from the object it points to. To suppress the -Wmaybe-uninitialized issued by GCC 11 when the address of an uninitialized object is passed to it (e.g., the result of malloc()), this change #defines __attr_access_none in cdefs.h and uses the macro on the function in sysdeps/htl/pthread.h and sysdeps/nptl/pthread.h.
* Remove pthread_key_create-related internals from libc-lock.hFlorian Weimer2021-04-211-13/+0
| | | | | And libc-lockP.h. This is no longer used because all internal TLS use goes directly to the thread descriptor/TCB or uses ELF TLS.
* fork.h: replace with register-atfork.hSamuel Thibault2021-03-292-21/+0
| | | | | | | | | | | | | UNREGISTER_ATFORK is now defined for all ports in register-atfork.h, so most previous includes of fork.h actually only need register-atfork.h now, and cxa_finalize.c does not need an ifdef UNREGISTER_ATFORK any more. The nptl-specific fork generation counters can then go to pthreadP.h, and fork.h be removed. Checked on x86_64-linux-gnu and i686-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* htl: Add missing fork.hSamuel Thibault2021-03-241-0/+20
| | | | | | | | 2b47727c68b6 ("posix: Consolidate register-atfork") introduced a fork.h header to declare the atfork unregister hook, but was missing adding it for htl. This fixes tst-atfork2.
* posix: Consolidate register-atforkAdhemerval Zanella2021-03-122-29/+1
| | | | | | | | | | | | | Both htl and nptl uses a different data structure to implement atfork handlers. The nptl one was refactored by 27761a1042d to use a dynarray which simplifies the code. This patch moves the nptl one to be the generic implementation and replace Hurd linked one. Different than previous NPTL, Hurd also uses a global lock, so performance should be similar. Checked on x86_64-linux-gnu, i686-linux-gnu, and with a build for i686-gnu.
* linux: Require /dev/shm as the shared memory file systemFlorian Weimer2021-02-081-30/+0
| | | | | | | | | | | | | | | | | | | | | Previously, glibc would pick an arbitrary tmpfs file system from /proc/mounts if /dev/shm was not available. This could lead to an unsuitable file system being picked for the backing storage for shm_open, sem_open, and related functions. This patch introduces a new function, __shm_get_name, which builds the file name under the appropriate (now hard-coded) directory. It is called from the various shm_* and sem_* function. Unlike the SHM_GET_NAME macro it replaces, the callers handle the return values and errno updates. shm-directory.c is moved directly into the posix subdirectory because it can be implemented directly using POSIX functionality. It resides in libc because it is needed by both librt and nptl/htl. In the sem_open implementation, tmpfname is initialized directly from a string constant. This happens to remove one alloca call. Checked on x86_64-linux-gnu.
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-02114-114/+114
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* htl: Get sem_open/sem_close/sem_unlink support [BZ #25524]Samuel Thibault2020-12-163-93/+0
| | | | | This just moves the existing nptl implementation to reuse as it is in htl.
* htl: Add pshared semaphore supportSamuel Thibault2020-12-168-184/+253
| | | | | | The implementation is extremely similar to the nptl implementation, but with slight differences in the futex interface. This fixes some of BZ 25521.
* htl: Add futex-internal.hSamuel Thibault2020-12-161-0/+39
| | | | That provides futex_supports_pshared