summaryrefslogtreecommitdiffstats
path: root/lib/libkse/arch
Commit message (Collapse)AuthorAgeFilesLines
* For un-prototyped static inline functions declared in pthread_md.h onrwatson2007-12-012-3/+3
| | | | | | ia64, powerpc, and sparc64, use ANSI function headers and specifically indicate the lack of arguments with 'void'. Otherwise, warnings are generated at WARNS=3, leading to a compile failure with -Werror.
* WARNS=3'ify.deischen2007-11-3010-22/+22
|
* Stylize:marcel2006-09-012-35/+51
| | | | | | | o avoid using a global register variable. o redefine struct ia64_tp as a union. We don't have to get to the fields themselves. We just need it to be of the right size with the right alignment.
* The ucontext is 16-byte aligned, which means that struct tcb ismarcel2006-09-011-0/+1
| | | | | | | 16-byte aligned. Consequently, struct tcb is a multiple of 16 bytes in size. We need to make sure there's no padding after struct ppc32_tp. We do this by explicitly adding the necessary padding in front of it.
* Stylize. Introduce ppc_{get|set}_tp() and ppc_{get|set}_tcb() tomarcel2006-09-012-29/+59
| | | | abstract the magic that happens when deriving one or the other.
* Implement TLS.marcel2006-09-014-50/+61
|
* In order to let new binutils can compile it, replace movl withdavidxu2006-05-071-9/+9
| | | | | | movw for segment saving and restoring. Submitted by: Diego 'Flameeyes' Petteno flameeyes at gentoo dot org
* Fix a race condition introduced when redzones were added. Use andeischen2006-02-241-5/+4
| | | | | | atomic operation to return and adjust the stack. Submitted by: luoqi
* Remove an unused variable.deischen2005-07-291-1/+0
|
* Clean out the leftovers from the i386_set_gsbase() TLS conversion.peter2005-06-292-51/+8
| | | | | | | | Like on libthr, there is an i386_set_gsbase() stub implementation here to avoid libc.so.5 issues. This should likely be a weak symbol and I expect this will be fixed soon. Approved by: re
* Remove the special _amd64_set_gsbase() code for #ifdef COMPAT_32BIT, nowpeter2005-04-262-10/+0
| | | | | that the amd64 kernel implements i386_get/set_gsbase(). All the rest of the ldt backwards compat code should go away soon.
* Use the i386_set_gsbase() syscall if it is implemented in the kernel.peter2005-04-142-16/+41
| | | | | This is a little hairy here because the allocation and usage of this functionality is split into two places in libpthread.
* Use the new atomic_cmpset_32().cognet2005-04-071-15/+0
|
* Bring in a more healthy version of the libpthread for arm, which usescognet2005-02-264-4/+12
| | | | ARM_TP_ADDRESS.
* i386_set_ldt() is not available when running 32 bit binaries on amd64peter2004-11-062-0/+13
| | | | | kernels. Use the recently exposed direct-set routines instead. This is only activated for when we compile i386 support libraries on amd64.
* Cosmetic tweaks to reduce diffs to the i386 counterpart.peter2004-11-061-2/+3
|
* Partial support of KSE for arm.cognet2004-11-054-59/+66
|
* _tcb_ctor takes two args.cognet2004-09-242-2/+2
|
* Add missing brackets. It was committed from wrong tree.davidxu2004-08-261-1/+1
|
* gcc -O2 cleanup. tested for a long time.davidxu2004-08-252-4/+4
| | | | Reviewed by: deischen
* Fix compile, s/tp_dtv/tp_tdv/g.davidxu2004-08-163-3/+3
|
* Bring PPC up to date with latest TLS changes.grehan2004-08-162-3/+3
|
* 1. Add macro DTV_OFFSET to calculate dtv offset in tcb.davidxu2004-08-166-0/+8
| | | | 2. Export symbols needed by debugger.
* Add TLS support for i386 and amd64.dfr2004-08-158-31/+40
|
* Save context in kernel fashion, so it can be restored bydavidxu2004-07-311-2/+5
| | | | kse_switchin syscall.
* Remove unused field.davidxu2004-07-311-1/+0
|
* Macro optimize, this increases context switch speed about 2% on mydavidxu2004-07-311-2/+2
| | | | athlon64 machine.
* PPC MD bits for KSE. Runs test cases OK. Crippled to 1:1 mode forgrehan2004-07-198-0/+820
| | | | the time being.
* Copy lwp id to thread mailbox.davidxu2004-07-141-0/+1
|
* Call kse_switchin to switch context when being debugged.davidxu2004-07-134-24/+69
|
* kse_switchin ABI was changed in kernel.davidxu2004-07-121-3/+2
|
* Avoid clobbering the red zone when running on the new context's stack intjr2004-06-071-0/+5
| | | | _amd64_restore_context().
* Arm bits for libpthread. It has no chances to work and should be consideredcognet2004-05-145-0/+471
| | | | as stubs.
* Simplify the contexts created by the kernel and remove the relatedmarcel2003-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.
* Apply a second fix for stack alignment with libkse. This time, enter thepeter2003-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)
* Eliminate two pushl by using call instruction directly, this reallydavidxu2003-11-291-2/+1
| | | | | | helps branch predict a lot for INTEL P4. Approved by: re (scottl)
* Use amd64_set_fsbase() instead of calling sysarch() directly.peter2003-10-231-6/+1
|
* Update context code for my last ABI breakage of mcontext. I'm worriedpeter2003-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.
* Don't forget to initialize the fake tcb when the kcb is allocated.deischen2003-10-121-0/+3
|
* Reverse the order of the first two arguments to _sparc64_enter_uts().deischen2003-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.
* Convert a couple of hardcoded values to constants. Make thr_getcontext()deischen2003-10-092-3/+7
| | | | | return 0 when called the first time, and return 1 when resumed by thr_setcontext().
* Add preliminary sparc64 support to libpthread. This does notdeischen2003-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
* Fix FPU state restoring bug by jumping to right position.davidxu2003-09-221-2/+2
|
* Make KSE_STACKSIZE machine dependent by moving it from thr_kern.c tomarcel2003-09-193-1/+6
| | | | | | 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.
* _ia64_break_setcontext() now takes a mcontext_t. While here, definemarcel2003-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...
* Stop using the setcontext() syscall to restore an async context.marcel2003-09-191-5/+5
| | | | | Instead use the break instruction with an immediate specially created for us.
* Remove a comment that questioned why the size of the FPUdeischen2003-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.
* Don't assume sizeof(long) = sizeof(int) on x86; use intdeischen2003-09-032-9/+17
| | | | | | | | | | | | 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
* Don't forget to set kcb_self.davidxu2003-08-121-0/+1
|
* Grok async contexts. When a thread is interrupted and an upcallmarcel2003-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).
OpenPOWER on IntegriCloud