aboutsummaryrefslogtreecommitdiff
path: root/lib/libpthread/arch
Commit message (Collapse)AuthorAgeFilesLines
* Fix compile, s/tp_dtv/tp_tdv/g.David Xu2004-08-164-4/+4
| | | | Notes: svn path=/head/; revision=133857
* Bring PPC up to date with latest TLS changes.Peter Grehan2004-08-162-3/+3
| | | | Notes: svn path=/head/; revision=133806
* 1. Add macro DTV_OFFSET to calculate dtv offset in tcb.David Xu2004-08-167-0/+9
| | | | | | | 2. Export symbols needed by debugger. Notes: svn path=/head/; revision=133801
* Add TLS support for i386 and amd64.Doug Rabson2004-08-1510-33/+42
| | | | Notes: svn path=/head/; revision=133756
* Save context in kernel fashion, so it can be restored byDavid Xu2004-07-311-2/+5
| | | | | | | kse_switchin syscall. Notes: svn path=/head/; revision=132928
* Remove unused field.David Xu2004-07-311-1/+0
| | | | Notes: svn path=/head/; revision=132927
* Macro optimize, this increases context switch speed about 2% on myDavid Xu2004-07-311-2/+2
| | | | | | | athlon64 machine. Notes: svn path=/head/; revision=132913
* PPC MD bits for KSE. Runs test cases OK. Crippled to 1:1 mode forPeter Grehan2004-07-198-0/+820
| | | | | | | the time being. Notes: svn path=/head/; revision=132400
* Copy lwp id to thread mailbox.David Xu2004-07-141-0/+1
| | | | Notes: svn path=/head/; revision=132128
* Call kse_switchin to switch context when being debugged.David Xu2004-07-135-31/+89
| | | | Notes: svn path=/head/; revision=132125
* kse_switchin ABI was changed in kernel.David Xu2004-07-121-3/+2
| | | | Notes: svn path=/head/; revision=132021
* Avoid clobbering the red zone when running on the new context's stack inTim J. Robbins2004-06-071-0/+5
| | | | | | | _amd64_restore_context(). Notes: svn path=/head/; revision=130206
* Arm bits for libpthread. It has no chances to work and should be consideredOlivier Houchard2004-05-145-0/+471
| | | | | | | as stubs. Notes: svn path=/head/; revision=129206
* style cleanup: Remove duplicate $FreeBSD$ tags.Colin Percival2004-02-101-2/+0
| | | | | | | | | | | These files had tags after teh copyright notice, inside the comment block (incorrect, removed), and outside the comment block (correct). Approved by: rwatson (mentor) Notes: svn path=/head/; revision=125669
* Simplify the contexts created by the kernel and remove the relatedMarcel Moolenaar2003-12-071-0/+6
| | | | | | | | | | | | flags. We now create asynchronous contexts or syscall contexts only. Syscall contexts differ from the minimal ABI dictated contexts by having the scratch registers saved and restored because that's where we keep the syscall arguments and syscall return values. Since this change affects KSE, have it use kse_switchin(2) for the "new" syscall context. Notes: svn path=/head/; revision=123255
* Apply a second fix for stack alignment with libkse. This time, enter thePeter Wemm2003-12-051-2/+2
| | | | | | | | | | | | | | UTS with the stack correctly aligned. Also, while here, use an indirect jump rather than the pushq/ret hack. This fixes threaded apps that use floating point for me, although it hasn't solved all the problems. It is an improvement though. Preservation of the 128 byte red zone hasn't been resolved yet. Approved by: re (scottl) Notes: svn path=/head/; revision=123155
* Eliminate two pushl by using call instruction directly, this reallyDavid Xu2003-11-291-2/+1
| | | | | | | | | helps branch predict a lot for INTEL P4. Approved by: re (scottl) Notes: svn path=/head/; revision=123049
* Use amd64_set_fsbase() instead of calling sysarch() directly.Peter Wemm2003-10-231-6/+1
| | | | Notes: svn path=/head/; revision=121409
* Update context code for my last ABI breakage of mcontext. I'm worriedPeter Wemm2003-10-171-7/+8
| | | | | | | | | | about the fpu code here. It should be using fxsave/fxrstor instead of saving/restoring the control word. The SSE registers are used a lot in gcc generated code on amd64. I'm not sure how this all fits together though. Notes: svn path=/head/; revision=121163
* Don't forget to initialize the fake tcb when the kcb is allocated.Daniel Eischen2003-10-121-0/+3
| | | | Notes: svn path=/head/; revision=121043
* Reverse the order of the first two arguments to _sparc64_enter_uts().Daniel Eischen2003-10-091-2/+2
| | | | | | | | The first argument is the UTS function, the second argument is the first argument to the UTS function. Who's on first. Notes: svn path=/head/; revision=120956
* Convert a couple of hardcoded values to constants. Make thr_getcontext()Daniel Eischen2003-10-092-3/+7
| | | | | | | | return 0 when called the first time, and return 1 when resumed by thr_setcontext(). Notes: svn path=/head/; revision=120939
* Add preliminary sparc64 support to libpthread. This does notDaniel Eischen2003-10-096-0/+509
| | | | | | | | | | | yet work, but hopefully someone familiar with the sparc64 port can pick up the reins. Submitted by: jake With mods by: deischen Notes: svn path=/head/; revision=120924
* Fix a logic error; use beq to check for a register being NULL, not bne.Daniel Eischen2003-10-021-1/+1
| | | | Notes: svn path=/head/; revision=120675
* Add __volatile keyword.David Xu2003-09-261-2/+4
| | | | Notes: svn path=/head/; revision=120469
* s/ia64/alpha/gMarcel Moolenaar2003-09-261-5/+4
| | | | Notes: svn path=/head/; revision=120454
* Fix FPU state restoring bug by jumping to right position.David Xu2003-09-221-2/+2
| | | | Notes: svn path=/head/; revision=120337
* Make KSE_STACKSIZE machine dependent by moving it from thr_kern.c toMarcel Moolenaar2003-09-194-1/+8
| | | | | | | | | pthread_md.h. This commit only moves the definition; it does not change it for any of the platforms. This more easily allows 64-bit architectures (in particular) to pick a slightly larger stack size. Notes: svn path=/head/; revision=120263
* _ia64_break_setcontext() now takes a mcontext_t. While here, defineMarcel Moolenaar2003-09-191-10/+3
| | | | | | | | | | | | | | | THR_SETCONTEXT as PANIC(). The THR_SETCONTEXT macro is currently not used, which means that the definition we had could be wrong, overly pessimistic or unknowingly right. I don't like the odds... The new _ia64_break_setcontext() and corresponding kernel fixes make KSE mostly usable. There's still a case where we don't properly restore a context and end up with a NaT consumption fault (typically an indication for not handling NaT collection points correctly), but at least now mutex_d works... Notes: svn path=/head/; revision=120254
* Stop using the setcontext() syscall to restore an async context.Marcel Moolenaar2003-09-191-5/+5
| | | | | | | | Instead use the break instruction with an immediate specially created for us. Notes: svn path=/head/; revision=120253
* Remove a comment that questioned why the size of the FPUDaniel Eischen2003-09-161-10/+1
| | | | | | | | | | | | | | state for amd64 was twice as large as necessary. Peter recently fixed this, so the comment no longer applies. Also, since the size of struct mcontext changed, adjust the threads library version of get&set context to match. FYI, any change layout/size change to any arch's struct mcontext will likely need some minor changes in libpthread. Notes: svn path=/head/; revision=120108
* Don't assume sizeof(long) = sizeof(int) on x86; use intDaniel Eischen2003-09-033-9/+34
| | | | | | | | | | | | | | | instead of long types for low-level locks. Add prototypes for some internal libc functions that are wrapped by the library as cancellation points. Add memory barriers to alpha atomic swap functions (submitted by davidxu). Requested by: bde Notes: svn path=/head/; revision=119723
* Don't forget to set kcb_self.David Xu2003-08-121-0/+1
| | | | Notes: svn path=/head/; revision=118844
* Add alpha support to libpthread. It compiles but hasn't been tested;Daniel Eischen2003-08-096-1/+761
| | | | | | | | | there is still some missing kernel support. Reviewed by: marcel Notes: svn path=/head/; revision=118689
* Grok async contexts. When a thread is interrupted and an upcallMarcel Moolenaar2003-08-072-9/+41
| | | | | | | | | | | | | | | | | | | | | | | | happens, the context of the interrupted thread is exported to userland. Unlike most contexts, it will be an async context and we cannot easily use our existing functions to set such a context. To avoid a lot of complexity that may possibly interfere with the common case, we simply let the kernel deal with it. However, we don't use the EPC based syscall path to invoke setcontext(2). No, we use the break-based syscall path. That way the trapframe will be compatible with the context we're trying to restore and we save the kernel a lot of trouble. The kind of trouble we did not want to go though ourselves... However, we also need to set the threads mailbox and there's no syscall to help us out. To avoid creating a new syscall, we use the context itself to pass the information to the kernel so that the kernel can update the mailbox. This involves setting a flag (_MC_FLAGS_KSE_SET_MBOX) and setting ifa (the address) and isr (the value). Notes: svn path=/head/; revision=118592
* Fix a typo. s/Line/Like/Daniel Eischen2003-08-061-1/+1
| | | | Notes: svn path=/head/; revision=118519
* Avoid a level of indirection to get from the thread pointer to theMarcel Moolenaar2003-08-062-39/+27
| | | | | | | | | | | | | | TCB. We know that the thread pointer points to &tcb->tcb_tp, so all we have to do is subtract offsetof(struct tcb, tcb_tp) from the thread pointer to get to the TCB. Any reasonably smart compiler will translate accesses to fields in the TCB as negative offsets from TP. In _tcb_set() make sure the fake TCB gets a pointer to the current KCB, just like any other TCB. This fixes a NULL-pointer dereference in _thr_ref_add() when it tried to get the current KSE. Notes: svn path=/head/; revision=118518
* Define the static TLS as an array of long double. This will guaranteeMarcel Moolenaar2003-08-061-2/+6
| | | | | | | | | | that the TLS is 16-byte aligned, as well as guarantee that the thread pointer is 16-byte aligned as it points to struct ia64_tp. Likewise, struct tcb and struct ksd are also guaranteed to be 16-byte aligned (if they weren't already). Notes: svn path=/head/; revision=118513
* Use auto LDT allocation for i386.Daniel Eischen2003-08-051-63/+6
| | | | Notes: svn path=/head/; revision=118512
* Rethink the MD interfaces for libpthread to account forDaniel Eischen2003-08-0513-466/+786
| | | | | | | | | | | | archs that can (or are required to) have per-thread registers. Tested on i386, amd64; marcel is testing on ia64 and will have some follow-up commits. Reviewed by: davidxu Notes: svn path=/head/; revision=118510
* Define THR_GETCONTEXT and THR_SETCONTEXT in terms of the userlandMarcel Moolenaar2003-08-051-4/+5
| | | | | | | | | | | | context functions. We don't need to enter the kernel anymore. The contexts are compatible (ie a context created by getcontext() can be restored by _ia64_restore_context()). While here, make the use of THR_ALIGNBYTES and THR_ALIGN a no-op. They are going to be removed anyway. Notes: svn path=/head/; revision=118507
* o In _ia64_save_context() clear the return registers except for r8.Marcel Moolenaar2003-08-051-13/+25
| | | | | | | | | | | | | We write 1 for r8 in the context so that _ia64_restore_context() will return with a non-zero value. _ia64_save_context() always return 0. o In _ia64_restore_context(), don't restore the thread pointer. It is not normally part of the context. Also, restore the return registers. We get called for contexts created by getcontext(), which means we have to restore all the syscall return values. Notes: svn path=/head/; revision=118504
* -15 is incorrect to be used to align stack to 16 bytes, use ~15 instead.David Xu2003-08-021-1/+1
| | | | Notes: svn path=/head/; revision=118368
* Use FSBase to map kse, GCC generates code which uses %fs to access TLS data.David Xu2003-07-311-4/+4
| | | | | | | Reminded by: marcel Notes: svn path=/head/; revision=118285
* This file hasn't been used for some time; nuke it.Daniel Eischen2003-07-311-42/+0
| | | | Notes: svn path=/head/; revision=118279
* Take the same approach for i386 as that for ia64 and amd64. UseDaniel Eischen2003-07-315-226/+75
| | | | | | | | | | | | the userland version of [gs]etcontext to switch between a thread and the UTS scheduler (and back again). This also fixes a bug in i386 _thr_setcontext() which wasn't properly restoring the context. Reviewed by: davidxu Notes: svn path=/head/; revision=118277
* Set GSBASE for kse. Finally make libkse work on AMD64.David Xu2003-07-311-6/+3
| | | | Notes: svn path=/head/; revision=118257
* Fix some typos, correctly jump into UTS.David Xu2003-07-311-2/+2
| | | | Notes: svn path=/head/; revision=118256
* Fix typo.David Xu2003-07-261-5/+5
| | | | Notes: svn path=/head/; revision=118037
* Add missing arguments to _amd64_restore_context() when called fromDaniel Eischen2003-07-201-2/+4
| | | | | | | THR_SETCONTEXT(). Notes: svn path=/head/; revision=117807