summaryrefslogtreecommitdiffstats
path: root/lib/librthread (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* remove dead assignment as reported by llvm.fgsch2013-11-211-2/+2
|
* handle the fourth vararg value to sem_opentedu2013-11-211-3/+16
| | | | ok zhuk and presumably fgsch who just sent me a similar diff
* shared semaphore fixes. first, eliminate the sem inside a sem indirection.tedu2013-11-202-44/+55
| | | | | | | it's not needed (mindless holdover from earlier prototype). everything is simpler and sem_init shared semaphores even work now (confirmed by sthen). correct the einval checks to not deref a pointer before the null check. in sem_open, if we created the semaphore, we need to initialize the spinlock.
* oops, forgot about unnamed shared semstedu2013-11-201-1/+4
|
* zhuk and i have slightly different styles. unify and consistifytedu2013-11-201-23/+14
|
* interprocess semaphores ala sem_open. mostly following in the patterntedu2013-11-182-24/+170
| | | | of shm_open. with some additions and fixes from zhuk.
* use sysctl vm.psstrings to calculate stack bounds, rather than USRSTACK.deraadt2013-11-131-18/+31
| | | | long discussions with guenther, kurt, kettenis etc etc etc
* remove unnecessary spinlock that slowed down pthread_getspecific.tedu2013-11-021-4/+2
| | | | original report and fix provided by John Carr. ok guenther kettenis
* In pthread_kill()/pthread_cancel(), hold the target thread's flagsguenther2013-10-231-5/+42
| | | | | | | lock across the kill, so that it can't exit (and its tid be reused!) before the kill() discussed with tedu@ marc@
* _thread_sys_tcdrain() doesn't exist and isn't usedguenther2013-10-041-2/+1
|
* Following the ARM manuals and cookbooks, ldrex/strex don't have implicitpatrick2013-08-281-1/+2
| | | | | | | barriers. Therefore it is required to add a memory berrier, so that it is ensured that all observers observed the change. ok rapha@
* Use %r27 as the thread control block pointer, allowing for __get_tcb() callsmiod2013-08-261-6/+18
| | | | | | | | | | | | | | | | | | | | in libpthread to be optimized away. While there, follow DG/UX's example of using more than one register for thread purposes (after all, the ABI reserves four of them), and also use %r26 to store a pointer to the current thread's errno. Since it is not possible to initialize %r26 at thread creation without intrusive and potentially race-prone changes, have __tfork() reset %r26 to zero, and libpthread's __cerror lazy initialize it. As soon as %r26 is nonzero, it will be used instead of calling __errno(). This means that binaries linked against HEAD libpthread need to run on HEAD kernels, and we are belatedly jumping on the 64-bit time_t bump (since there are no 64-bit time_t m88k snapshots yet). Joint work with guenther@; "Your love of asm is sick and wrong, and yet beautiful." and ok guenther@
* Switch time_t, ino_t, clock_t, and struct kevent's ident and dataguenther2013-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
* Remove support for COMPILER_VERSION == gcc2.miod2013-08-061-8/+2
| | | | | | | | Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4 is the norm and to explicitely test for gcc3 when a different behaviour is required. No functional change intended. Be sure to `make install' in share/mk before attempting to do anything.
* Free the list used for tracking the pthread_{get,set}specific()guenther2013-07-301-1/+5
| | | | | | | data after calling all the destructors. noted by kettenis@ diff by tedu@
* Stop overwriting the dying thread's struct thread as its tid member mayguenther2013-07-301-11/+5
| | | | | | | be concurrently updated by __threxit() prompted by a report from Alf Schlichting (a.schlichting (at) lemarit.com) ok kettenis@
* ELF_TOOLCHAIN bye bye.miod2013-07-051-4/+3
|
* VAX ELF userland bits. Consists mostly of register prefix additions.miod2013-07-052-7/+7
|
* nmask and omask only used on ELF. Noted by todd@guenther2013-06-251-1/+3
|
* The bind lock must only be grabbed with all signals masked.guenther2013-06-211-3/+10
| | | | | backtrace of example case from sthen@ ok kettenis@ millert@
* Move the declaration of _thread_sys_sigprocmask() to rthread.hguenther2013-06-212-4/+4
|
* Add support for the _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME options,guenther2013-06-173-2/+31
| | | | | | | | including CLOCK_{PROCESS,THREAD}_CPUTIME_ID constants and {clock,pthread}_getcpuclockid() functions. Worked out at t2k13 with help from tedu@ and matthew@ and testing by aja@ ok matthew@
* fix typo in commentmiod2013-06-041-2/+2
|
* unbreakmiod2013-06-031-2/+2
|
* Despite tedu's efforts, fix ERRNOPTR_OFFSET which has changed due to recentmiod2013-06-032-4/+4
| | | | struct pthread layout change.
* THE MACHINE DEPENDENT CERROR CODE HAS HARD CODED OFFSETS INTO PTHREAD_T!tedu2013-06-031-8/+8
| | | | | found the hard way by miod. resize and realign all the locks and semaphores back to the way they were. sometimes i just can't win.
* Make arm compile again. -mojmaja2013-06-021-1/+2
|
* something's not quite right yet. ticket locks result in more CPU usagetedu2013-06-016-52/+40
| | | | | | and spinning in kernel. partially back out, but in a way that makes going forward again easy. seen by ajacoutot
* cleanup and consolidate the spinlock_lock (what a name!) code.tedu2013-06-0125-166/+189
| | | | | | | | | | it's now atomic_lock to better reflect its usage, and librthread now features a new spinlock that's really a ticket lock. thrlseep can handle both types of lock via a flag in the clock arg. (temp back compat hack) remove some old stuff that's accumulated along the way and no longer used. some feedback from dlg, who is concerned with all things ticket lock. (you need to boot a new kernel before installing librthread)
* fix wrong fn name in debugtedu2013-06-011-2/+2
|
* Add utrace(2), a system call allowing for userland to send its own ktracemiod2013-06-011-1/+1
| | | | | | records. From FreeBSD via otto@, with tweaks suggested by guenther@. Commite on behalf of otto@ who is not around, to ride the libc minor bump. Causes a librthread minor bump as well (new syscall).
* If the lock is contended, such that the 'sc' fails, then we need toguenther2013-05-061-4/+7
| | | | | | | reset the %2 register with _SPINLOCK_LOCKED before retrying. tobiasu@ hit the problem and figured out that ".set noreorder" is needed in the ASM
* Extend P_SIGSUSPEND handling in userret() to properly restore thematthew2013-04-292-4/+48
| | | | | | | | | | | | | | | sigmask even if there are no pending signals under the temporary sigmask. Refactor existing select() and poll() system calls to introduce the pselect() and ppoll() system calls. Add rthread wrappers for pselect() and ppoll(). While there, update cancellation point comments to reflect recent fdatasync() addition. Minor bumps for libc and librthread due to new symbols. ok guenther, millert, deraadt, jmc
* remove more references to kern.rthreads sysctl.tedu2013-04-061-4/+2
| | | | many thanks to jmc for noticing
* fix race when exiting a detached thread. observed by and ok guenthertedu2013-04-061-4/+7
|
* - Don't include guard pages in the stack size.kurt2013-03-311-7/+4
| | | | | | From Christian Schulte (cs at schulte.it) - Use stack->sp instead of recalculating it. From guenther@ okay guenther@
* SEM_VALUE_MAX belongs in <limits.h> (via sys/syslimits.h)guenther2013-03-241-3/+3
| | | | | | | struct sem --> struct __sem (doesn't belong in public namespace) Zap pointless _KERNEL tests ok deraadt@
* Do not need machine/param.hderaadt2013-03-211-4/+2
|
* Revert previous diff: sparc and sparc64 don't set the TCB to NULL in exec, yet,guenther2013-02-152-47/+19
| | | | | | and vax doesn't support symbols that are both weak and undefined (yet?). sparc issue diagnosed by kettenis@, vax problem found by todd@
* Make libpthread compatible with an ld.so that does TCB allocation:guenther2013-02-142-19/+47
| | | | | | | | if the initial thread already has a TCB then don't override it, and if the _dl_allocate_tls() and _dl_free_tls() symbols exist then use them instead of malloc/free ok kettenis@
* Userland bits for m68k/ELF. Mostly addition of register prefixes to themiod2013-02-021-12/+11
| | | | | assembler instructions, and cope with the few changes in return values location.
* Make this PIC-aware.miod2013-01-271-2/+6
|
* ARMv7 doesn't support the atomic SWP instruction anymore. Use the atomicpatrick2013-01-231-1/+12
| | | | | | load and store instructions instead. ok miod@
* Add END() directives to the various functions.miod2013-01-111-1/+2
| | | | | | Make the code PIC-aware when necessary (i.e. invoke other functions through the PLT, and access global data through the GOT). No change for non-PIC compilation.
* Switch m88k ports to ELF.miod2013-01-052-14/+14
|
* Do not pass -Wmissing-prototypes when building on a non-ELF platform withmiod2012-11-221-3/+4
| | | | | gcc 3 as the compiler. The way constructors are built triggers this warning, which is fatal because of -Werror. ok espie@ guenther@
* raise() is now correctly defined in libcguenther2012-11-101-9/+1
|
* Define empty CDIAGFLAGS for programs that use Werror.haesbaert2012-09-121-1/+2
| | | | | | Makes "make build" build with WARNINGS=Yes on amd64. ok espie
* We want to check that the dynamic linker is available at run-time, somatthew2012-08-223-26/+42
| | | | | | | | we should actually check for _DYNAMIC at run-time rather than checking for __PIC__ at compile time, since the two are actually independent. Problem and solution identified by guenther; minor tweaks by me. ok guenther
* Test for __PIC__ instead of PIC in preparation for eliminating -DPICmatthew2012-08-222-8/+8
| | | | | | from bsd.lib.mk for C source files. ok deraadt, pascal