Commit Graph

88396 Commits

Author SHA1 Message Date
jeff
cd171afef0 - Adjust the makefiles so we have a per architecture makefile. 2003-04-01 07:07:38 +00:00
jake
329a89282d - Add a flags field to struct pcb. Use this to keep track of wether or
not the pcb has floating point registers saved in it.
- Implement get_mcontext and set_mcontext.
2003-04-01 04:58:50 +00:00
jeff
edf5e63de2 - Spell SIGSETOR correctly. 2003-04-01 04:49:12 +00:00
jake
7ec3850aac - Don't allow tf_wstate to be set in set_regs.
- Clear FPRS_FEF in set_fpregs so the new registers will be reloaded.
2003-04-01 04:29:03 +00:00
jake
6e1e9ecfad Implement cpu_set_upcall. 2003-04-01 04:19:29 +00:00
jake
1d9451a9fb - Rename pcb_fpstate to pcb_ufp (user floating point), and change it to
a simple array of 64 ints.
- Use a critical section when saving floating point state in cpu_fork
  instead of sched_lock.
2003-04-01 04:02:45 +00:00
jeff
aafdd4b74e - Commit the forgotten libthr/sys bits. 2003-04-01 03:51:08 +00:00
jeff
d84b08bd16 - Add libthr but don't hook it up to the regular build yet. This is an
adaptation of libc_r for the thr system call interface.  This is beta
   quality code.
2003-04-01 03:46:29 +00:00
jake
78ab616ff8 Rename pcb_fp to pcb_sp, so as to not be confused with floating point
state.
2003-04-01 03:05:46 +00:00
tjr
8e32b2c3c5 Specify the M_WAITOK flag explicitly in the MALLOC call to silence a
runtime warning ("Bad malloc flags: 0").
2003-04-01 02:47:09 +00:00
tjr
9f0203c956 Give the M_WAITOK flag explicitly to the MALLOC call to silence a runtime
warning ("Bad malloc flags: 0").
2003-04-01 02:42:02 +00:00
jake
43aeb37e66 Implement casuptr. 2003-04-01 02:37:04 +00:00
jeff
f1c114be2c - Regen. 2003-04-01 02:34:21 +00:00
jeff
d74616f2df - thr_exit() should no longer be called with Giant held. 2003-04-01 02:32:53 +00:00
jeff
1e491c2622 - Mark the various thr syscalls as MP safe. Previously there was a bug if
this was not done since thr_exit() unwinds giant.
2003-04-01 02:32:07 +00:00
jeff
5538fc3a38 - Borrow the KSE single threading code for exec and exit. We use the check
if (p->p_numthreads > 1) and not a flag because action is only necessary
   if there are other threads.  The rest of the system has no need to
   identify thr threaded processes.
 - In kern_thread.c use thr_exit1() instead of thread_exit() if P_THREADED
   is not set.
2003-04-01 01:26:20 +00:00
jeff
e259269483 - Regen for umtx. 2003-04-01 01:22:18 +00:00
jeff
c44b6b488c - Add thr and umtx system calls. 2003-04-01 01:15:56 +00:00
jeff
e22c573e54 - Add the kern_umtx.c file to the build. 2003-04-01 01:13:29 +00:00
jeff
270e401265 - Include umtx.h in files generated by makesyscalls.sh
- Add system calls for umtx.
2003-04-01 01:12:24 +00:00
jeff
1fd2e76d43 - Add an entry and a head for the queue of threads blocked on a umtx.
- Add a prototype for thr_exit1().
2003-04-01 01:11:22 +00:00
jeff
21bb9a0eb7 - Add an api for doing smp safe locks in userland.
- umtx_lock() is defined as an inline in umtx.h.  It tries to do an
   uncontested acquire of a lock which falls back to the _umtx_lock()
   system-call if that fails.
 - umtx_unlock() is also an inline which falls back to _umtx_unlock() if the
   uncontested unlock fails.
 - Locks are keyed off of the thr_id_t of the currently running thread which
   is currently just the pointer to the 'struct thread' in kernel.
 - _umtx_lock() uses the proc pointer to synchronize access to blocked thread
   queues which are stored in the first blocked thread.
2003-04-01 01:10:42 +00:00
jeff
66c64b006b - We now have to include umtx.h and ucontext.h in the system call related
headers.
2003-04-01 00:35:12 +00:00
jeff
d151028043 - Regen for thr related system calls. 2003-04-01 00:34:29 +00:00
jeff
2f8da4b3fb - Add the four thr related system calls. 2003-04-01 00:31:37 +00:00
jeff
55a903a070 - Add kern_thr.c 2003-04-01 00:30:54 +00:00
jeff
81893c1fc4 - Add two files to support the thr threading interface.
- sys/thr.h contains the user space visible api that is intended only for
   use in threading library packages.
 - kern/kern_thr.c contains thr system calls and other thr specific code.
2003-04-01 00:30:30 +00:00
jeff
fde71359bc - Define a new md function 'casuptr'. This atomically compares and sets
a pointer that is in user space.  It will be used as the basic primitive
   for a kernel supported user space lock implementation.
 - Implement this function in x86's support.s
 - Provide stubs that return -1 in all other architectures.  Implementations
   will follow along shortly.

Reviewed by:	jake
2003-04-01 00:18:55 +00:00
jeff
456e72c5b2 - In npxgetregs() use the td argument to save the fpu state from and not
curthread.  Nothing currently depends on this behavior.
 - Clean up an extra newline.

Obtained from:	bde
2003-04-01 00:16:32 +00:00
jeff
3e36051ca6 - Add a placeholder for sigwait 2003-03-31 23:36:40 +00:00
jeff
a153dd8158 - Regen for the sig*wait* system calls. 2003-03-31 23:33:45 +00:00
jeff
3a325d610d - According to mike@FreeBSD.org SIGTHR should be hiden by
#ifdef __BSD_VISIBLE
2003-03-31 23:31:50 +00:00
jeff
9edf10dc50 - Define sigwait, sigtimedwait, and sigwaitinfo in terms of
kern_sigtimedwait() which is capable of supporting all of their semantics.
 - These should be POSIX compliant but more careful review is needed before
   we announce this.
2003-03-31 23:30:41 +00:00
thomas
b7a8b36545 Revert change 1.201 (removing mapping of VAPPEND to VWRITE).
Instead, use the generic vaccess() operation to determine whether
an operation is permitted. This avoids embedding knowledge on
vnode permission bits such as VAPPEND in the NFS client.

PR:		kern/46515
vaccess() patch submitted by:	"Peter Edwards" <pmedwards@eircom.net>
Approved by:	tjr, roberto (mentor)
2003-03-31 23:26:10 +00:00
jeff
7257186867 - Catch up with kernel signal changes. 2003-03-31 22:57:55 +00:00
jeff
e50192aa97 - The siglist in the proc holds signals that were blocked by all threads
when they were delivered.  In signotify() check to see if we have
   unblocked any of those signals and post them to the thread.
 - Use td_sigmask instead of p_sigmask in all cases.
 - In sigpending return both signals pending on the thread and proc.
 - Define a function, sigtd(), that finds the appropriate thread to deliver
   the signal to if psignal() has been called instead of tdsignal().
 - Define a function, tdsignal(), that delivers a signal to a specific thread
   or if that thread has the signal blocked it may deliver it to the process
   where it will wait for a thread to unblock it.
 - Since we are delivering signals to a specific thread we do not need to
   abort the sleep of all threads.
 - Rename the old tdsignal() to tdsigwakeup().
 - Save and restore the old signal mask to and from the thread.
2003-03-31 22:57:01 +00:00
jeff
630e903135 - Move the NEEDSIGCHK and OLDMASK flags from proc to thread.
- Move the signal mask to the thread.
 - Adjust a few comments.
2003-03-31 22:51:19 +00:00
jeff
3946316f71 - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with
a follow on commit to kern_sig.c
 - signotify() now operates on a thread since unmasked pending signals are
   stored in the thread.
 - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
2003-03-31 22:49:17 +00:00
julian
43524ee154 Do NOT return from an non-interruptable cv_wait, falsely
claiming to have timed out. I don't know what I was thinking..
2003-03-31 22:41:47 +00:00
jeff
37639846db - Fix two calls to trapsignal() that were still passing in 'struct proc'.
These were missed in my last commit.
2003-03-31 22:41:32 +00:00
jeff
aaa09e0147 - Add a signal for thread synchronization. Add an XXX so that maybe
someone more knowledgeable on standards defined namespaces may ifdef
   this out.
2003-03-31 22:30:08 +00:00
jeff
9ad87043c2 - Mark signals which may be delivered to any thread in the process with
SA_PROC.  Signals without this flag should be directed to a particular
   thread if this is possible.
2003-03-31 22:12:09 +00:00
jeff
e81bb84595 - Change trapsignal() to accept a thread and not a proc.
- Change all consumers to pass in a thread.

Right now this does not cause any functional changes but it will be important
later when signals can be delivered to specific threads.
2003-03-31 22:02:38 +00:00
jeff
ff354db2d8 - Use sigexit() instead of twiddling the signal mask, catch, ignore, and
action bits to allow SIGILL to work as expected.  This brings this file in
   line with other architectures.
2003-03-31 21:40:47 +00:00
wes
991520c0b0 Add a facility allowing processes to inform the VM subsystem they are
critical and should not be killed when pageout is looking for more
memory pages in all the wrong places.

Reviewed by:	arch@
Sponsored by:	St. Bernard Software
2003-03-31 21:09:57 +00:00
jhb
cafa967981 Add missing ()'s so that these drivers all compile again.
Noticed by:	jake
Tested on:	i386 (compile)
2003-03-31 20:22:00 +00:00
jake
d0dddcf7e4 - Allow the physical memory size that will be actually used by the kernel to
be overridden by setting hw.physmem.
- Fix a vm_map_find arg, we don't want to find space.
- Add tracing and statistics for off colored pages.
- Detect "stupid" pmap_kenters (same virtual and physical as existing
  mapping), and do nothing in that case.
2003-03-31 19:56:55 +00:00
jhb
8322c0f515 If we fail to find our PCI ID in attach (this should never happen), then
just return ENXIO directly instead of calling tl_detach() since that would
panic since the softc mutex isn't initialized until after this check.
2003-03-31 19:24:37 +00:00
phk
5fe0db30de Use new GEOM OAM. Kernels have supported this for a number of days, so
people should be OK.
2003-03-31 18:38:31 +00:00
phk
475cec9193 Remove some debugging in the new OAM[*] and add a debug flag for other
parts of it.

[*] I've been asked what "OAM" means:  It's an acronym used in the
telecom industry, "Operations And Maintenance", and there it covers
anything from a single unlabeled led on the frontpanel the the full
nightmare of CMIP for SS7.
2003-03-31 18:35:37 +00:00