Commit Graph

19 Commits

Author SHA1 Message Date
Daniel Eischen
d143dde438 Move the mailbox to the beginning of the thread and align the
thread so that the context (SSE FPU state) is also aligned.
2003-04-30 15:05:17 +00:00
Daniel Eischen
a8b5a9cd12 Jump to the correct label upon detecting an error. 2003-04-29 21:05:17 +00:00
Daniel Eischen
55613576f5 o Don't add a scope system thread's KSE to the list of available
KSEs when it's thread exits; allow the GC handler to do that.

o Make spinlock/spinlock critical regions.

The following were submitted by davidxu

  o Alow thr_switch() to take a null mailbox argument.

  o Better protect cancellation checks.

  o Don't set KSE specific data when creating new KSEs; rely on the
    first upcall of the KSE to set it.

  o Add the ability to set the maximum concurrency level and do this
    automatically.  We should have a way to enable/disable this with
    some sort of tunable because some applications may not want this
    to be the default.

  o Hold the scheduling lock across thread switch calls.

  o If scheduling of a thread fails, make sure to remove it from the list
    of active threads.

  o Better protect accesses to a joining threads when the target thread is
    exited and detached.

  o Remove some macro definitions that are now provided by <sys/kse.h>.

  o Don't leave the library in threaded mode if creation of the initial
    KSE fails.

  o Wakeup idle KSEs when there are threads ready to run.

  o Maintain the number of threads active in the priority queue.
2003-04-28 23:56:12 +00:00
Daniel Eischen
10629b6587 Add a macro to get the current thread mailbox pointer. 2003-04-23 21:49:34 +00:00
Daniel Eischen
6c2a22923c Use popfl to get the flags off the stack instead of popf.
Submitted by:	davidxu
2003-04-21 03:59:07 +00:00
Daniel Eischen
e4c2ac1637 Sorry folks; I accidentally committed a patch from what I was working
on a couple of days ago.  This should be the most recent changes.

Noticed by:	davidxu
2003-04-18 07:09:43 +00:00
Daniel Eischen
27f625a036 Add architecture dependent atomic ops (atomic_swap only), KSE specific
data, and userland versions of [gs]etcontext().

Modify the UTS entry and exit functions to account of FPU validity
and format.
2003-04-18 05:00:52 +00:00
David Xu
2442bdd81b Directly load %edx from mailbox 2002-11-23 04:39:52 +00:00
David Xu
4949943c48 In _thread_enter_uts, fix eflags saving bug.
In _thread_switch, set current thread pointer in kse mailbox
only after all registers copied out of thread mailbox, kernel will do
upcall at trap time, if set current thread pointer before loading all
registers from thread mailbox, at trap time, the thread mailbox data
will be overwritten by kernel, result is junk data is loaded into CPU.
2002-11-22 11:43:06 +00:00
David Xu
4ab365e720 Adjust code for new mailbox format.
Reviewed by: deischen, mini
2002-11-18 02:02:08 +00:00
Jonathan Mini
2d9a293b4e Use KSE to schedule threads. 2002-10-30 06:07:18 +00:00
Peter Wemm
7657553c76 Add an ia64 atomic lock primitive for libc_r. This is mostly for
completeness and doesn't get us a working libc_r there because libc_r
uses setjmp() and setjmp() cannot be used for context switches on ia64
as-is (or sparc64).  Rather than making setjmp/longjmp behave like
the *context() calls, it would be far better to make libc_r use *context()
directly which is what they are for.

Obtained from:  marcel
2002-07-20 19:22:10 +00:00
Peter Wemm
9d91d74d2b Change #include "DEFS.h" to <machine/asm.h>. 2001-10-25 01:30:54 +00:00
Ruslan Ermilov
8af1452cf8 Removed duplicate VCS ID tags, as per style(9). 2001-08-13 14:06:34 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Doug Rabson
1624bd7303 Change to a code sequence which is more likely to work on SMP systems.
Now all I need is an alpha SMP box to port FreeBSD to :-)
1998-09-16 09:27:05 +00:00
John Birrell
7d24d0302f Delete the atomic unlock function since it is no longer required.
Simplify the atomic lock to just write a value of 1 to the lock instead
of taking the value passed by the caller (which just confused things).
1998-06-09 08:25:41 +00:00
John Birrell
3dcb4f7556 Atomic lock asm code for the alpha version of libc_r. 1998-06-09 08:21:55 +00:00
John Birrell
1ce8c4dc49 Atomic lock source. 1998-04-29 09:36:03 +00:00