1993-06-12 14:58:17 +00:00
|
|
|
/*-
|
1994-06-06 14:54:41 +00:00
|
|
|
* Copyright (C) 1994, David Greenman
|
|
|
|
* Copyright (c) 1990, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-06-12 14:58:17 +00:00
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* the University of Utah, and William Jolitz.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
genassym.c:
Remove NKMEMCLUSTERS, it is no longer define or used.
locores.s:
Fix comment on PTDpde and APTDpde to be pde instead of pte
Add new equation for calculating location of Sysmap
Remove Bill's old #ifdef garbage for counting up memory,
that stuff will never be made to work and was just cluttering
up the file.
Add code that places the PTD, page table pages, and kernel
stack below the 640k ISA hole if there is room for it, otherwise
put this stuff all at 1MB. This fixes the 28K bogusity in
the boot blocks, that can now go away!
Fix the caclulation of where first is to be dependent on
NKPDE so that we can skip over the above mentioned areas.
The 28K thing is now 44K in size due to the increase in
kernel virtual memory space, but since we no longer have
to worry about that this is no big deal.
Use if NNPX > 0 instead of ifdef NPX for floating point code.
machdep.c
Change the calculation of for the buffer cache to be
20% of all memory above 2MB and add back the upper limit
of 2/5's of the VM_KMEM_SIZE so that we do not eat ALL
of the kernel memory space on large memory machines, note
that this will not even come into effect unless you have
more than 32MB. The current buffer cache limit is 6.7MB
due to this caclulation.
It seems that we where erroniously allocating bufpages pages
for buffer_map. buffer_map is UNUSED in this implementation
of the buffer cache, but since the map is referenced in
several if statements a quick fix was to simply allocate
1 vm page (but no real memory) to it.
pmap.h
Remove rcsid, don't want them in the kernel files!
Removed some cruft inside an #ifdef DEBUGx that caused
compiler errors if you where compiling this for debug.
Use the #defines for PD_SHIFT and PG_SHIFT in place of
constants.
trap.c:
Remove patch kit header and rcsid, fix $Id$.
Now include "npx.h" and use NNPX for controlling the
floating point code.
Remove a now completly invalid check for a maximum virtual
address, the virtual address now ends at 0xFFFFFFFF so
there is no more MAX!! (Thanks David, I completly missed
that one!)
vm_machdep.c
Remove patch kit header and rcsid, fix $Id$.
Now include "npx.h" and use NNPX for controlling the
floating point code.
Replace several 0xFE00000 constants with KERNBASE
1993-10-15 10:34:29 +00:00
|
|
|
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
|
1993-06-12 14:58:17 +00:00
|
|
|
*/
|
|
|
|
|
2003-06-11 00:56:59 +00:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
2003-07-31 01:36:24 +00:00
|
|
|
#include "opt_ktrace.h"
|
2002-10-02 02:42:38 +00:00
|
|
|
#include "opt_mac.h"
|
2001-06-29 19:51:37 +00:00
|
|
|
#ifdef __i386__
|
2001-01-19 13:19:02 +00:00
|
|
|
#include "opt_npx.h"
|
2001-06-29 19:51:37 +00:00
|
|
|
#endif
|
1996-01-03 21:42:35 +00:00
|
|
|
|
1994-05-25 09:21:21 +00:00
|
|
|
#include <sys/param.h>
|
2000-09-07 01:33:02 +00:00
|
|
|
#include <sys/bus.h>
|
1994-05-25 09:21:21 +00:00
|
|
|
#include <sys/kernel.h>
|
2001-06-29 19:51:37 +00:00
|
|
|
#include <sys/lock.h>
|
2002-10-02 02:42:38 +00:00
|
|
|
#include <sys/mac.h>
|
2000-10-20 07:58:15 +00:00
|
|
|
#include <sys/mutex.h>
|
2001-06-29 19:51:37 +00:00
|
|
|
#include <sys/proc.h>
|
Part 1 of KSE-III
The ability to schedule multiple threads per process
(one one cpu) by making ALL system calls optionally asynchronous.
to come: ia64 and power-pc patches, patches for gdb, test program (in tools)
Reviewed by: Almost everyone who counts
(at various times, peter, jhb, matt, alfred, mini, bernd,
and a cast of thousands)
NOTE: this is still Beta code, and contains lots of debugging stuff.
expect slight instability in signals..
2002-06-29 17:26:22 +00:00
|
|
|
#include <sys/ktr.h>
|
1997-11-24 13:25:37 +00:00
|
|
|
#include <sys/resourcevar.h>
|
2002-10-12 05:32:24 +00:00
|
|
|
#include <sys/sched.h>
|
1997-11-24 13:25:37 +00:00
|
|
|
#include <sys/signalvar.h>
|
2001-06-29 19:51:37 +00:00
|
|
|
#include <sys/systm.h>
|
1995-12-07 12:48:31 +00:00
|
|
|
#include <sys/vmmeter.h>
|
2003-07-31 01:36:24 +00:00
|
|
|
#ifdef KTRACE
|
|
|
|
#include <sys/uio.h>
|
|
|
|
#include <sys/ktrace.h>
|
|
|
|
#endif
|
|
|
|
|
1994-05-25 09:21:21 +00:00
|
|
|
#include <machine/cpu.h>
|
1997-11-24 13:25:37 +00:00
|
|
|
#include <machine/pcb.h>
|
2000-12-12 01:14:32 +00:00
|
|
|
|
2001-06-29 19:51:37 +00:00
|
|
|
/*
|
|
|
|
* Define the code needed before returning to user mode, for
|
|
|
|
* trap and syscall.
|
2001-08-30 18:50:57 +00:00
|
|
|
*
|
|
|
|
* MPSAFE
|
2001-06-29 19:51:37 +00:00
|
|
|
*/
|
2001-01-24 09:53:49 +00:00
|
|
|
void
|
2001-09-12 08:38:13 +00:00
|
|
|
userret(td, frame, oticks)
|
|
|
|
struct thread *td;
|
1994-06-06 14:54:41 +00:00
|
|
|
struct trapframe *frame;
|
2001-08-10 22:53:32 +00:00
|
|
|
u_int oticks;
|
1994-06-06 14:54:41 +00:00
|
|
|
{
|
2001-09-12 08:38:13 +00:00
|
|
|
struct proc *p = td->td_proc;
|
1994-06-06 14:54:41 +00:00
|
|
|
|
Part 1 of KSE-III
The ability to schedule multiple threads per process
(one one cpu) by making ALL system calls optionally asynchronous.
to come: ia64 and power-pc patches, patches for gdb, test program (in tools)
Reviewed by: Almost everyone who counts
(at various times, peter, jhb, matt, alfred, mini, bernd,
and a cast of thousands)
NOTE: this is still Beta code, and contains lots of debugging stuff.
expect slight instability in signals..
2002-06-29 17:26:22 +00:00
|
|
|
CTR3(KTR_SYSC, "userret: thread %p (pid %d, %s)", td, p->p_pid,
|
|
|
|
p->p_comm);
|
2004-03-05 17:35:28 +00:00
|
|
|
#ifdef DIAGNOSTIC
|
2003-02-01 12:17:09 +00:00
|
|
|
/* Check that we called signotify() enough. */
|
2001-06-22 23:05:11 +00:00
|
|
|
PROC_LOCK(p);
|
2002-04-04 17:49:48 +00:00
|
|
|
mtx_lock_spin(&sched_lock);
|
2003-03-31 22:49:17 +00:00
|
|
|
if (SIGPENDING(td) && ((td->td_flags & TDF_NEEDSIGCHK) == 0 ||
|
2003-02-17 09:55:10 +00:00
|
|
|
(td->td_flags & TDF_ASTPENDING) == 0))
|
2002-08-22 14:36:03 +00:00
|
|
|
printf("failed to set signal flags properly for ast()\n");
|
2002-04-04 17:49:48 +00:00
|
|
|
mtx_unlock_spin(&sched_lock);
|
2001-08-10 22:53:32 +00:00
|
|
|
PROC_UNLOCK(p);
|
2002-04-04 17:49:48 +00:00
|
|
|
#endif
|
2000-03-28 07:16:37 +00:00
|
|
|
|
2002-04-04 17:49:48 +00:00
|
|
|
/*
|
2002-10-12 05:32:24 +00:00
|
|
|
* Let the scheduler adjust our priority etc.
|
2002-04-04 17:49:48 +00:00
|
|
|
*/
|
2002-10-12 05:32:24 +00:00
|
|
|
sched_userret(td);
|
2001-01-24 09:53:49 +00:00
|
|
|
|
Part 1 of KSE-III
The ability to schedule multiple threads per process
(one one cpu) by making ALL system calls optionally asynchronous.
to come: ia64 and power-pc patches, patches for gdb, test program (in tools)
Reviewed by: Almost everyone who counts
(at various times, peter, jhb, matt, alfred, mini, bernd,
and a cast of thousands)
NOTE: this is still Beta code, and contains lots of debugging stuff.
expect slight instability in signals..
2002-06-29 17:26:22 +00:00
|
|
|
/*
|
2002-10-26 04:44:17 +00:00
|
|
|
* We need to check to see if we have to exit or wait due to a
|
|
|
|
* single threading requirement or some other STOP condition.
|
|
|
|
* Don't bother doing all the work if the stop bits are not set
|
|
|
|
* at this time.. If we miss it, we miss it.. no big deal.
|
|
|
|
*/
|
|
|
|
if (P_SHOULDSTOP(p)) {
|
|
|
|
PROC_LOCK(p);
|
|
|
|
thread_suspend_check(0); /* Can suspend or kill */
|
|
|
|
PROC_UNLOCK(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Do special thread processing, e.g. upcall tweaking and such.
|
Part 1 of KSE-III
The ability to schedule multiple threads per process
(one one cpu) by making ALL system calls optionally asynchronous.
to come: ia64 and power-pc patches, patches for gdb, test program (in tools)
Reviewed by: Almost everyone who counts
(at various times, peter, jhb, matt, alfred, mini, bernd,
and a cast of thousands)
NOTE: this is still Beta code, and contains lots of debugging stuff.
expect slight instability in signals..
2002-06-29 17:26:22 +00:00
|
|
|
*/
|
2004-03-13 22:31:39 +00:00
|
|
|
if (p->p_flag & P_SA)
|
2002-09-23 06:14:30 +00:00
|
|
|
thread_userret(td, frame);
|
2003-02-01 12:17:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Charge system time if profiling.
|
|
|
|
*/
|
2003-04-22 20:54:04 +00:00
|
|
|
if (p->p_flag & P_PROFIL) {
|
2003-02-01 12:17:09 +00:00
|
|
|
quad_t ticks;
|
|
|
|
|
|
|
|
mtx_lock_spin(&sched_lock);
|
2003-02-17 02:19:58 +00:00
|
|
|
ticks = td->td_sticks - oticks;
|
2003-02-01 12:17:09 +00:00
|
|
|
mtx_unlock_spin(&sched_lock);
|
2003-02-17 09:55:10 +00:00
|
|
|
addupc_task(td, TRAPF_PC(frame), (u_int)ticks * psratio);
|
2003-02-01 12:17:09 +00:00
|
|
|
}
|
1994-06-06 14:54:41 +00:00
|
|
|
}
|
1993-06-12 14:58:17 +00:00
|
|
|
|
|
|
|
/*
|
2001-06-29 19:51:37 +00:00
|
|
|
* Process an asynchronous software trap.
|
|
|
|
* This is relatively easy.
|
2001-08-10 22:53:32 +00:00
|
|
|
* This function will return with preemption disabled.
|
1993-06-12 14:58:17 +00:00
|
|
|
*/
|
2000-09-07 01:33:02 +00:00
|
|
|
void
|
Part 1 of KSE-III
The ability to schedule multiple threads per process
(one one cpu) by making ALL system calls optionally asynchronous.
to come: ia64 and power-pc patches, patches for gdb, test program (in tools)
Reviewed by: Almost everyone who counts
(at various times, peter, jhb, matt, alfred, mini, bernd,
and a cast of thousands)
NOTE: this is still Beta code, and contains lots of debugging stuff.
expect slight instability in signals..
2002-06-29 17:26:22 +00:00
|
|
|
ast(struct trapframe *framep)
|
2000-09-07 01:33:02 +00:00
|
|
|
{
|
2002-10-01 14:16:50 +00:00
|
|
|
struct thread *td;
|
|
|
|
struct proc *p;
|
|
|
|
struct ksegrp *kg;
|
2004-02-04 21:52:57 +00:00
|
|
|
struct rlimit rlim;
|
2004-07-02 03:50:48 +00:00
|
|
|
u_int sticks;
|
2001-08-10 22:53:32 +00:00
|
|
|
int sflag;
|
2001-09-12 08:38:13 +00:00
|
|
|
int flags;
|
2002-04-04 17:49:48 +00:00
|
|
|
int sig;
|
2001-05-22 21:20:49 +00:00
|
|
|
#if defined(DEV_NPX) && !defined(SMP)
|
|
|
|
int ucode;
|
|
|
|
#endif
|
2000-09-07 01:33:02 +00:00
|
|
|
|
2002-10-01 14:16:50 +00:00
|
|
|
td = curthread;
|
|
|
|
p = td->td_proc;
|
2002-10-02 16:39:39 +00:00
|
|
|
kg = td->td_ksegrp;
|
|
|
|
|
Part 1 of KSE-III
The ability to schedule multiple threads per process
(one one cpu) by making ALL system calls optionally asynchronous.
to come: ia64 and power-pc patches, patches for gdb, test program (in tools)
Reviewed by: Almost everyone who counts
(at various times, peter, jhb, matt, alfred, mini, bernd,
and a cast of thousands)
NOTE: this is still Beta code, and contains lots of debugging stuff.
expect slight instability in signals..
2002-06-29 17:26:22 +00:00
|
|
|
CTR3(KTR_SYSC, "ast: thread %p (pid %d, %s)", td, p->p_pid,
|
|
|
|
p->p_comm);
|
2001-02-22 18:05:15 +00:00
|
|
|
KASSERT(TRAPF_USERMODE(framep), ("ast in kernel mode"));
|
2003-03-04 21:03:05 +00:00
|
|
|
WITNESS_WARN(WARN_PANIC, NULL, "Returning to user mode");
|
2001-08-10 22:53:32 +00:00
|
|
|
mtx_assert(&Giant, MA_NOTOWNED);
|
2002-04-04 17:49:48 +00:00
|
|
|
mtx_assert(&sched_lock, MA_NOTOWNED);
|
2002-03-29 16:45:03 +00:00
|
|
|
td->td_frame = framep;
|
2002-10-01 14:16:50 +00:00
|
|
|
|
2002-03-29 16:45:03 +00:00
|
|
|
/*
|
|
|
|
* This updates the p_sflag's for the checks below in one
|
|
|
|
* "atomic" operation with turning off the astpending flag.
|
|
|
|
* If another AST is triggered while we are handling the
|
|
|
|
* AST's saved in sflag, the astpending flag will be set and
|
|
|
|
* ast() will be called again.
|
|
|
|
*/
|
|
|
|
mtx_lock_spin(&sched_lock);
|
2003-02-17 02:19:58 +00:00
|
|
|
sticks = td->td_sticks;
|
2003-02-17 09:55:10 +00:00
|
|
|
flags = td->td_flags;
|
2002-10-01 14:16:50 +00:00
|
|
|
sflag = p->p_sflag;
|
2003-03-31 22:49:17 +00:00
|
|
|
p->p_sflag &= ~(PS_ALRMPEND | PS_PROFPEND | PS_XCPU);
|
2002-11-08 19:00:17 +00:00
|
|
|
#ifdef MAC
|
|
|
|
p->p_sflag &= ~PS_MACPEND;
|
|
|
|
#endif
|
2003-03-31 22:49:17 +00:00
|
|
|
td->td_flags &= ~(TDF_ASTPENDING | TDF_NEEDSIGCHK |
|
2004-07-16 21:04:55 +00:00
|
|
|
TDF_NEEDRESCHED | TDF_INTERRUPT);
|
2002-03-29 16:45:03 +00:00
|
|
|
cnt.v_soft++;
|
|
|
|
mtx_unlock_spin(&sched_lock);
|
Part 1 of KSE-III
The ability to schedule multiple threads per process
(one one cpu) by making ALL system calls optionally asynchronous.
to come: ia64 and power-pc patches, patches for gdb, test program (in tools)
Reviewed by: Almost everyone who counts
(at various times, peter, jhb, matt, alfred, mini, bernd,
and a cast of thousands)
NOTE: this is still Beta code, and contains lots of debugging stuff.
expect slight instability in signals..
2002-06-29 17:26:22 +00:00
|
|
|
/*
|
|
|
|
* XXXKSE While the fact that we owe a user profiling
|
|
|
|
* tick is stored per KSE in this code, the statistics
|
|
|
|
* themselves are still stored per process.
|
|
|
|
* This should probably change, by which I mean that
|
|
|
|
* possibly the location of both might change.
|
|
|
|
*/
|
2002-02-22 23:58:22 +00:00
|
|
|
|
2002-03-29 16:45:03 +00:00
|
|
|
if (td->td_ucred != p->p_ucred)
|
|
|
|
cred_update_thread(td);
|
2004-07-16 21:04:55 +00:00
|
|
|
if (td->td_pflags & TDP_OWEUPC && p->p_flag & P_PROFIL) {
|
|
|
|
addupc_task(td, td->td_profil_addr, td->td_profil_ticks);
|
|
|
|
td->td_profil_ticks = 0;
|
|
|
|
td->td_pflags &= ~TDP_OWEUPC;
|
2004-07-02 03:50:48 +00:00
|
|
|
}
|
2002-03-29 16:45:03 +00:00
|
|
|
if (sflag & PS_ALRMPEND) {
|
|
|
|
PROC_LOCK(p);
|
|
|
|
psignal(p, SIGVTALRM);
|
|
|
|
PROC_UNLOCK(p);
|
|
|
|
}
|
2001-05-22 21:20:49 +00:00
|
|
|
#if defined(DEV_NPX) && !defined(SMP)
|
2002-03-29 16:45:03 +00:00
|
|
|
if (PCPU_GET(curpcb)->pcb_flags & PCB_NPXTRAP) {
|
|
|
|
atomic_clear_int(&PCPU_GET(curpcb)->pcb_flags,
|
|
|
|
PCB_NPXTRAP);
|
|
|
|
ucode = npxtrap();
|
|
|
|
if (ucode != -1) {
|
2003-03-31 22:02:38 +00:00
|
|
|
trapsignal(td, SIGFPE, ucode);
|
2001-05-22 21:20:49 +00:00
|
|
|
}
|
2002-03-29 16:45:03 +00:00
|
|
|
}
|
2001-05-22 21:20:49 +00:00
|
|
|
#endif
|
2002-03-29 16:45:03 +00:00
|
|
|
if (sflag & PS_PROFPEND) {
|
|
|
|
PROC_LOCK(p);
|
|
|
|
psignal(p, SIGPROF);
|
|
|
|
PROC_UNLOCK(p);
|
|
|
|
}
|
2002-09-30 21:13:54 +00:00
|
|
|
if (sflag & PS_XCPU) {
|
|
|
|
PROC_LOCK(p);
|
2004-02-04 21:52:57 +00:00
|
|
|
lim_rlimit(p, RLIMIT_CPU, &rlim);
|
2003-04-17 22:33:04 +00:00
|
|
|
mtx_lock_spin(&sched_lock);
|
2004-02-04 21:52:57 +00:00
|
|
|
if (p->p_runtime.sec >= rlim.rlim_max) {
|
2003-04-17 22:33:04 +00:00
|
|
|
mtx_unlock_spin(&sched_lock);
|
2002-09-30 21:13:54 +00:00
|
|
|
killproc(p, "exceeded maximum CPU limit");
|
2003-04-17 22:33:04 +00:00
|
|
|
} else {
|
2004-02-04 21:52:57 +00:00
|
|
|
if (p->p_cpulimit < rlim.rlim_max)
|
2002-10-09 17:17:24 +00:00
|
|
|
p->p_cpulimit += 5;
|
|
|
|
mtx_unlock_spin(&sched_lock);
|
2003-04-17 22:33:04 +00:00
|
|
|
psignal(p, SIGXCPU);
|
2002-09-30 21:13:54 +00:00
|
|
|
}
|
|
|
|
PROC_UNLOCK(p);
|
|
|
|
}
|
2002-11-08 19:00:17 +00:00
|
|
|
#ifdef MAC
|
|
|
|
if (sflag & PS_MACPEND)
|
|
|
|
mac_thread_userret(td);
|
|
|
|
#endif
|
2003-02-17 09:55:10 +00:00
|
|
|
if (flags & TDF_NEEDRESCHED) {
|
2003-07-31 01:36:24 +00:00
|
|
|
#ifdef KTRACE
|
|
|
|
if (KTRPOINT(td, KTR_CSW))
|
2003-09-05 22:15:26 +00:00
|
|
|
ktrcsw(1, 1);
|
2003-07-31 01:36:24 +00:00
|
|
|
#endif
|
2002-04-04 17:49:48 +00:00
|
|
|
mtx_lock_spin(&sched_lock);
|
2002-10-12 05:32:24 +00:00
|
|
|
sched_prio(td, kg->kg_user_pri);
|
2004-07-02 19:09:50 +00:00
|
|
|
mi_switch(SW_INVOL, NULL);
|
2002-04-04 17:49:48 +00:00
|
|
|
mtx_unlock_spin(&sched_lock);
|
2003-07-31 01:36:24 +00:00
|
|
|
#ifdef KTRACE
|
|
|
|
if (KTRPOINT(td, KTR_CSW))
|
2003-09-05 22:15:26 +00:00
|
|
|
ktrcsw(0, 1);
|
2003-07-31 01:36:24 +00:00
|
|
|
#endif
|
2002-04-04 17:49:48 +00:00
|
|
|
}
|
2003-03-31 22:49:17 +00:00
|
|
|
if (flags & TDF_NEEDSIGCHK) {
|
2002-04-04 17:49:48 +00:00
|
|
|
PROC_LOCK(p);
|
- Merge struct procsig with struct sigacts.
- Move struct sigacts out of the u-area and malloc() it using the
M_SUBPROC malloc bucket.
- Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(),
sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared().
- Remove the p_sigignore, p_sigacts, and p_sigcatch macros.
- Add a mutex to struct sigacts that protects all the members of the struct.
- Add sigacts locking.
- Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now
that sigacts is locked.
- Several in-kernel functions such as psignal(), tdsignal(), trapsignal(),
and thread_stopped() are now MP safe.
Reviewed by: arch@
Approved by: re (rwatson)
2003-05-13 20:36:02 +00:00
|
|
|
mtx_lock(&p->p_sigacts->ps_mtx);
|
o Change kse_thr_interrupt to allow send a signal to a specified thread,
or unblock a thread in kernel, and allow UTS to specify whether syscall
should be restarted.
o Add ability for UTS to monitor signal comes in and removed from process,
the flag PS_SIGEVENT is used to indicate the events.
o Add a KMF_WAITSIGEVENT for KSE mailbox flag, UTS call kse_release with
this flag set to wait for above signal event.
o For SA based thread, kernel masks all signal in its signal mask, let
UTS to use kse_thr_interrupt interrupt a thread, and install a signal
frame in userland for the thread.
o Add a tm_syncsig in thread mailbox, when a hardware trap occurs,
it is used to deliver synchronous signal to userland, and upcall
is schedule, so UTS can process the synchronous signal for the thread.
Reviewed by: julian (mentor)
2003-06-28 08:29:05 +00:00
|
|
|
while ((sig = cursig(td)) != 0)
|
2002-04-04 17:49:48 +00:00
|
|
|
postsig(sig);
|
- Merge struct procsig with struct sigacts.
- Move struct sigacts out of the u-area and malloc() it using the
M_SUBPROC malloc bucket.
- Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(),
sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared().
- Remove the p_sigignore, p_sigacts, and p_sigcatch macros.
- Add a mutex to struct sigacts that protects all the members of the struct.
- Add sigacts locking.
- Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now
that sigacts is locked.
- Several in-kernel functions such as psignal(), tdsignal(), trapsignal(),
and thread_stopped() are now MP safe.
Reviewed by: arch@
Approved by: re (rwatson)
2003-05-13 20:36:02 +00:00
|
|
|
mtx_unlock(&p->p_sigacts->ps_mtx);
|
2002-04-04 17:49:48 +00:00
|
|
|
PROC_UNLOCK(p);
|
|
|
|
}
|
1997-04-07 07:16:06 +00:00
|
|
|
|
2002-03-29 16:45:03 +00:00
|
|
|
userret(td, framep, sticks);
|
2002-07-11 02:18:33 +00:00
|
|
|
#ifdef DIAGNOSTIC
|
|
|
|
cred_free_thread(td);
|
|
|
|
#endif
|
2001-08-10 22:53:32 +00:00
|
|
|
mtx_assert(&Giant, MA_NOTOWNED);
|
1997-04-07 07:16:06 +00:00
|
|
|
}
|