freebsd_amp_hwpstate/lib
Daniel Eischen fbeb36e4bf Implement zero system call thread switching. Performance of
thread switches should be on par with that under scheduler
activations.

  o Timing is achieved through the use of a fixed interval
    timer (ITIMER_PROF) to count scheduling ticks instead
    of retrieving the time-of-day upon every thread switch
    and calculating elapsed real time.

  o Polling for I/O readiness is performed once for each
    scheduling tick instead of every thread switch.

  o The non-signal saving/restoring versions of setjmp/longjmp
    are used to save and restore thread contexts.  This may
    allow the removal of _THREAD_SAFE macros from setjmp()
    and longjmp() - needs more investigation.

Change signal handling so that signals are handled in the
context of the thread that is receiving the signal.  When
signals are dispatched to a thread, a special signal handling
frame is created on top of the target threads stack.  The
frame contains the threads saved state information and a new
context in which the thread can run.  The applications signal
handler is invoked through a wrapper routine that knows how
to restore the threads saved state and unwind to previous
frames.

Fix interruption of threads due to signals.  Some states
were being improperly interrupted while other states were
not being interrupted.  This should fix several PRs.

Signal handlers, which are invoked as a result of a process
signal (not by pthread_kill()), are now called with the
code (or siginfo_t if SA_SIGINFO was set in sa_flags) and
sigcontext_t as received from the process signal handler.

Modify the search for a thread to which a signal is delivered.
The search algorithm is now:

  o First thread found in sigwait() with signal in wait mask.
  o First thread found sigsuspend()'d on the signal.
  o Current thread if signal is unmasked.
  o First thread found with signal unmasked.

Collapse machine dependent support into macros defined in
pthread_private.h.  These should probably eventually be moved
into separate MD files.

Change the range of settable priorities to be compliant with
POSIX (0-31).  The threads library uses higher priorities
internally for real-time threads (not yet implemented) and
threads executing signal handlers.  Real-time threads and
threads running signal handlers add 64 and 32, respectively,
to a threads base priority.

Some other small changes and cleanups.

PR:		17757 18559 21943
Reviewed by:	jasone
2000-10-13 22:12:32 +00:00
..
compat add libxpg4 2000-06-14 14:38:11 +00:00
csu Use the new machine-independent versions of crtbegin and crtend 2000-05-24 02:17:12 +00:00
libalias A bit of indentation reformatting. 2000-10-02 13:13:24 +00:00
libatm
libbind
libc o Introduce cap_from_text() and cap_to_text() implementations. 2000-10-13 18:24:58 +00:00
libc_r Implement zero system call thread switching. Performance of 2000-10-13 22:12:32 +00:00
libcalendar Introduce .Lb macro to libcalendar manpage. 2000-04-22 15:51:37 +00:00
libcam This is an overhaul of the mode page handling in camcontrol as well as 2000-08-08 06:24:17 +00:00
libcom_err
libcompat Return an error instead of overflowing the buffer in the case of a long 2000-08-04 11:15:48 +00:00
libcrypt Still have to support libscrypt for now :( Add #defines to take DES 2000-08-24 17:51:16 +00:00
libdevstat Introduce .Lb macro to libdevstat library manpage 2000-04-22 15:58:01 +00:00
libdisk Turn dkcksum() into an __inline function. 2000-09-16 13:43:00 +00:00
libedit Include fcntl.h 2000-10-02 22:07:53 +00:00
libfetch Use the right user name 2000-10-13 09:36:46 +00:00
libform Update for ncurses 5.1-20001009 import 2000-10-11 08:19:56 +00:00
libftpio Fix two bugs: 2000-08-17 23:46:13 +00:00
libgnumalloc
libio Add functions which allow i/o memory to be accessed without forcing a 2000-02-12 14:57:01 +00:00
libipsec synchronize with latest kame tree. 2000-07-04 16:22:05 +00:00
libipx Introduce .Lb macro to libipx library manpage 2000-04-22 16:01:01 +00:00
libkse Implement zero system call thread switching. Performance of 2000-10-13 22:12:32 +00:00
libkvm Good, fixing the header showed incorrect usage of it! #define _KERNEL 2000-08-06 17:03:09 +00:00
libm Disconnect libm from the build tree. It's broken, not being 2000-05-02 14:16:19 +00:00
libmd Introduce .Lb macro to libmd manpages 2000-04-22 16:11:30 +00:00
libmenu Oops, beforedepend isn't needed. The build problem I had was due to 2000-10-11 08:20:37 +00:00
libncp Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
libncurses Fix a buildworld hiccup with build-tools that wasn't present in standalone 2000-10-11 11:25:47 +00:00
libnetgraph - Make sure the message token returned by NgSendMsg() is non-negative 2000-06-21 23:01:07 +00:00
libopie Add some extra functions adapted from OpenBSD, in preparation for 2000-05-15 04:20:54 +00:00
libpam Update to the version of pam_ssh corresponding to OpenSSH 2.1 (taken 2000-05-30 09:03:15 +00:00
libpanel Update for ncurses 20001009 import 2000-10-11 08:17:19 +00:00
libpcap Don't try to compile in INET6 support when NOINET6 is defined. 2000-04-15 20:45:52 +00:00
libposix1e o Introduce cap_from_text() and cap_to_text() implementations. 2000-10-13 18:24:58 +00:00
libpthread Implement zero system call thread switching. Performance of 2000-10-13 22:12:32 +00:00
libradius strtok -> strsep (no strtok allowed in libraries) 2000-08-29 21:49:11 +00:00
libresolv
librpcsvc
libskey Fix problem where original author thought `unsigned long' was the best 2000-07-20 20:11:36 +00:00
libsmdb Give users a way to alter the sendmail (and related utilities) build 2000-09-17 00:41:33 +00:00
libsmutil Give users a way to alter the sendmail (and related utilities) build 2000-09-17 00:41:33 +00:00
libss Get errno from <errno.h>, not from extern int. 2000-09-04 03:54:23 +00:00
libstand Inital PowerPC loader build support. 2000-10-10 13:22:41 +00:00
libtacplus strtok -> strsep (no strtok allowed in libraries) 2000-08-29 21:49:11 +00:00
libtelnet
libusb Sync with NetBSD: 2000-08-26 13:53:27 +00:00
libusbhid Sync with NetBSD: 2000-08-26 13:53:27 +00:00
libutil Correct uu_lock_txfr. I don't think this ever worked correctly. 2000-10-02 17:32:00 +00:00
libvgl Initiate deorbit burn sequence for <machine/console.h>. 2000-10-08 21:34:00 +00:00
libwrap Replace strtok with strsep (strtok is not allowed in libraries) 2000-08-30 06:26:42 +00:00
libxpg4 Bump major to preserve 3.x binaries compatibility 2000-06-13 00:41:38 +00:00
liby
libz Prevent buffer overflows. 2000-08-04 06:25:30 +00:00
msun Removed bogus 'l' suffixes in FP register to register instructions. 2000-06-06 12:12:36 +00:00
ncurses Fix a buildworld hiccup with build-tools that wasn't present in standalone 2000-10-11 11:25:47 +00:00
Makefile Fix alphabetical ordering for libsmutil 2000-10-10 18:32:38 +00:00
Makefile.inc