summaryrefslogtreecommitdiff
path: root/lib/librthread/arch
AgeCommit message (Collapse)Author
2016-09-01retire sparcTed Unangst
2016-05-11remove hppa64 port, which we never got going beyond broken single users.Theo de Raadt
hppa reverse-stack gives us a valuable test case, but most developers don't have a 2nd one to proceed further with this. ok kettenis
2016-05-07Use a Thread Information Block in both single and multi-threaded programs.Philip Guenther
This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable! Make libpthread dlopen'able by moving the cancelation wrappers into libc and doing locking and fork/errno handling via callbacks that libpthread registers when it first initializes. 'errno' *must* be declared via <errno.h> now! Clean up libpthread's symbol exports like libc. On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec. Testing by various, particularly sthen@ and patrick@ ok kettenis@
2016-04-09replace 0xf57ff05f with dmb syJonathan Gray
spotted by guenther
2016-03-10No point in keeping the threading support for vax, I guessPhilip Guenther
2015-05-12Put the right number of leading underscores in ___cerror and __cerror, forMiod Vallat
the sake of libpthread. Probably missed during the a.out->ELF switch, I can't believe this went unnoticed for so long.
2014-04-18It's been a quarter century: we can assume volatile is present with that name.Philip Guenther
2014-03-18Retire hp300, mvme68k and mvme88k ports. These ports have no users, keepingMiod Vallat
this hardware alive is becoming increasingly difficult, and I should heed the message sent by the three disks which have died on me over the last few days. Noone sane will mourn these ports anyway. So long, and thanks for the fish.
2013-08-28Following the ARM manuals and cookbooks, ldrex/strex don't have implicitPatrick Wildt
barriers. Therefore it is required to add a memory berrier, so that it is ensured that all observers observed the change. ok rapha@
2013-08-26Use %r27 as the thread control block pointer, allowing for __get_tcb() callsMiod Vallat
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@
2013-07-05VAX ELF userland bits. Consists mostly of register prefix additions.Miod Vallat
2013-06-04fix typo in commentMiod Vallat
2013-06-03unbreakMiod Vallat
2013-06-03Despite tedu's efforts, fix ERRNOPTR_OFFSET which has changed due to recentMiod Vallat
struct pthread layout change.
2013-06-02Make arm compile again. -mojMats O Jansson
2013-06-01cleanup and consolidate the spinlock_lock (what a name!) code.Ted Unangst
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)
2013-05-06If the lock is contended, such that the 'sc' fails, then we need toPhilip Guenther
reset the %2 register with _SPINLOCK_LOCKED before retrying. tobiasu@ hit the problem and figured out that ".set noreorder" is needed in the ASM
2013-02-02Userland bits for m68k/ELF. Mostly addition of register prefixes to theMiod Vallat
assembler instructions, and cope with the few changes in return values location.
2013-01-27Make this PIC-aware.Miod Vallat
2013-01-23ARMv7 doesn't support the atomic SWP instruction anymore. Use the atomicPatrick Wildt
load and store instructions instead. ok miod@
2013-01-11Add END() directives to the various functions.Miod Vallat
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.
2013-01-05Switch m88k ports to ELF.Miod Vallat
2012-08-22Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure ccPascal Stumpf
invocations. This allows us to use the compiler builtin define __PIC__ to check for PIC/PIEness rather than passing -DPIC. Simplifies PIE work a lot. ok matthew@, conceptually ok kurt@
2012-04-13Provide _atomic_lock() and __cerror() for hppa64. Makes hppa64 build again.Joel Sing
2012-03-22tfork_thread has been moved to libcPhilip Guenthe
2012-03-03Sync the assembly statements with <machine/lock.h> for consistency.Miod Vallat
2012-02-27fix __errno symbol nameMiod Vallat
2012-02-26Fix buglets.Miod Vallat
2012-02-26__cerror gets invoked with errno in v0, not a0.Miod Vallat
2012-02-26Fix label for threaded binaries to link.Miod Vallat
2012-02-18Missing cerror bits.Miod Vallat
2012-02-17Allow librthread to build on mips64.Miod Vallat
2012-01-17Reimplement mutexes, condvars, and rwlocks to eliminate bugs,Philip Guenthe
particularly the "consume the signal you just sent" hang, and putting the wait queues in userspace. Do cancellation handling in pthread_cond_*wait(), pthread_join(), and sem_wait(). Add __ prefix to thr{sleep,wakeup,exit,sigdivert}() syscalls; add 'abort" argument to thrsleep to close cancellation race; make thr{sleep,wakeup} return errno values via *retval to avoid touching userspace errno.
2011-11-09Add the __cerror asm bits for per-thread errno support for powerpc.Mark Kettenis
ok guenther@
2011-11-08Add the __cerror asm bits for per-thread errno support for hppa.Mark Kettenis
ok guenther@
2011-10-17Use __tfork, __get_tcb, and __set_tcb to have a real TCB and per-threadPhilip Guenthe
errno. The ASM bits for _cerror are sketchy or missing for some archs but that can be corrected in-tree.
2011-10-13Deal with the horror that is gcc asm constraints by copying thePhilip Guenthe
known good version of ldstub in the kernel. (It's finally in, aja!) ok kettenis@
2011-10-13Increase the stack offset for the new rthread from (BIAS+128) toPhilip Guenthe
(BIAD+CC64FSZ) so that there's sufficient space even when _rthread_start is compiled without optimization. Also, clear the frame pointer to help make gdb happier. ok kettenis@
2011-10-13Convert rfork_thread() from int$80 to syscall.Philip Guenthe
Tune the asm slightly to avoid using the stack and use smaller instructions. Pass threxit() a NULL pointer. seemed okay to kettenis@
2010-12-03Sync with amd64, to allow this to compile without warnings with gcc4:Miod Vallat
``Correct the _atomic_lock() asm so that gcc accepts the constraints when compiling without optimization; fix copied from the kernel's atomic.h'' spotted by jim@
2009-09-27rfork_thread() lacked PIC handling for CERROR, resulting in a text relocationPhilip Guenthe
pointed out by brad, ok djm@
2009-09-24rfork_thread() lacked PIC handling for CERROR, resulting in a text relocationPhilip Guenthe
ok kettenis@, art@
2009-06-01A much better atomic lock routine.Miod Vallat
2009-06-01Correct the _atomic_lock() asm so that gcc accepts the constraintsPhilip Guenthe
when compiling without optimization; fix copied from the kernel's atomic.h ok miod@
2009-02-15these are public domain, verified with author; spotted by jjTheo de Raadt
2008-10-02the license on this is PD; david leonard says soTheo de Raadt
2008-10-01Assert my copyright on files I gave to d@ back in 1998.Dale Rahn
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2008-05-21Use _C_LABEL when appropriate.Miod Vallat
2007-03-24rfork sh bits.Miod Vallat