freebsd-skq/sys
marcel b4eb6c7533 Use get_mcontext() to construct the signal context in sendsig() and
use set_mcontext() to restore the context in sigreturn(). Since we
put the syscall number and the syscall arguments in the trapframe
(we don't save the scratch registers for syscalls, which allows us
to reuse the space to our advantage), create a MD specific flag so
that we save the scratch registers even for syscalls. We would not
be able to restart a syscall otherwise.

The signal trampoline does not need to flush the regiters anymore,
because get_mcontext() already handles that. In fact, if we set up
the context correctly, we do not need to have a trampoline at all.
This change however only minimally changes the trampoline code. In
follow-up commits this can be further optimized.

Note that normally we preserve cfm and iip in the trapframe created
by the EPC syscall path when we restore a context in set_mcontext()
because those fields are not normally set for a synchronuous context.
The kernel puts the return address and frame info of the syscall
stub in there. By preserving these fields we hide this detail from
userland which allows us to use setcontext(2) for user created
contexts. However, sigreturn() is commonly called from the trampoline,
which means that if we preserve cfm and iip in all cases, we would
return to the trampoline after the sigreturn(), which means we hit
the safety net: we call exit(2). So, we do not preserve cfm and iip
when we have a synchronous context that also has scratch registers
(the uncommon context created by sendsig() only), under the assumption
that if such a context is created in userland, something special is
going on and the use of cfm and iip is then just another quirk. All
this is invisible in the common case.
2003-11-09 22:17:36 +00:00
..
alpha Change the clear_ret argument of get_mcontext() to be a flags argument. 2003-11-09 20:31:04 +00:00
amd64 Change the clear_ret argument of get_mcontext() to be a flags argument. 2003-11-09 20:31:04 +00:00
arm Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bit 2003-09-25 01:10:26 +00:00
boot Implement PAL_HALT_LIGHT now that the kernel halts the processor 2003-11-09 07:42:16 +00:00
cam - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
coda - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
compat Use kern_sendit rather than sendit for the Linux send* syscalls. 2003-11-09 17:04:04 +00:00
conf Rename npx.c to fpu.c (it isn't an extension, its part of the core 2003-11-08 02:40:40 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r122208, 2003-11-07 08:54:27 +00:00
crypto Add a testcase which validates that the same buffer can be passed to 2003-10-19 22:12:23 +00:00
ddb Reworked rev.1.14. Use the ELF symbol type again to summarily reject 2003-09-28 06:02:33 +00:00
dev Free the ata_request struct after we are done using it. This should stop 2003-11-09 20:46:08 +00:00
fs - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
geom Close the right consumers if we run into trouble opening them all. 2003-10-24 18:47:31 +00:00
gnu Fixed a reference to a nonexistent variable in previous commit. Renaming 2003-11-05 11:56:58 +00:00
i4b - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
i386 Change the clear_ret argument of get_mcontext() to be a flags argument. 2003-11-09 20:31:04 +00:00
ia64 Use get_mcontext() to construct the signal context in sendsig() and 2003-11-09 22:17:36 +00:00
isa - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
isofs/cd9660 DuH! 2003-10-18 14:10:28 +00:00
kern Change the clear_ret argument of get_mcontext() to be a flags argument. 2003-11-09 20:31:04 +00:00
libkern - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
modules Add the Makefile glue for the udf_iconv module. 2003-11-07 09:38:05 +00:00
net - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
net80211 Fix a reversed suser(9) in SIOCG80211:IEEE80211_IOC_WEPKEY which prevents 2003-11-05 04:16:48 +00:00
netatalk o add a flags parameter to netisr_register that is used to specify 2003-11-08 22:28:40 +00:00
netatm o add a flags parameter to netisr_register that is used to specify 2003-11-08 22:28:40 +00:00
netgraph o add a flags parameter to netisr_register that is used to specify 2003-11-08 22:28:40 +00:00
netinet replace explicit changes to rt_refcnt by RT_ADDREF and RT_REMREF 2003-11-08 23:36:32 +00:00
netinet6 replace explicit changes to rt_refcnt by RT_ADDREF and RT_REMREF 2003-11-08 23:36:32 +00:00
netipsec MFp4: portability work, general cleanup, locking fixes 2003-09-29 22:57:43 +00:00
netipx o add a flags parameter to netisr_register that is used to specify 2003-11-08 22:28:40 +00:00
netkey - cleanup SP refcnt issue. 2003-11-04 16:02:05 +00:00
netnatm o add a flags parameter to netisr_register that is used to specify 2003-11-08 22:28:40 +00:00
netncp The present defaults for the open and close for device drivers which 2003-09-27 12:01:01 +00:00
netsmb - Support for multibyte charsets in LIBICONV. 2003-09-26 20:26:25 +00:00
nfs
nfsclient Assert GIANT_REQUIRED where sockets are manipulated. This is 2003-11-07 22:57:09 +00:00
nfsserver Assert GIANT_REQUIRED where sockets are manipulated. This is 2003-11-07 22:57:09 +00:00
opencrypto falloc allocates a file structure and adds it to the file descriptor 2003-10-19 20:41:07 +00:00
pc98 Change the clear_ret argument of get_mcontext() to be a flags argument. 2003-11-09 20:31:04 +00:00
pccard - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
pci Ahh, the joys of badge engineering. Tell the sk driver that the 2003-11-07 22:04:26 +00:00
posix4 sched_setscheduler: Return EINVAL when a invalid policy is specified, 2003-09-13 18:46:24 +00:00
powerpc Change the clear_ret argument of get_mcontext() to be a flags argument. 2003-11-09 20:31:04 +00:00
rpc
security Replace a '-' with a ')'. Update copyright. 2003-11-08 00:21:20 +00:00
sparc64 Change the clear_ret argument of get_mcontext() to be a flags argument. 2003-11-09 20:31:04 +00:00
sys Change the clear_ret argument of get_mcontext() to be a flags argument. 2003-11-09 20:31:04 +00:00
tools Changes for new SMP-safe kobj method dispatch algorithm. 2003-10-16 13:29:26 +00:00
ufs Remove mntvnode_mtx and replace it with per-mountpoint mutex. 2003-11-05 04:30:08 +00:00
vm - Remove Giant from msync(2). Giant is still acquired by the lower layers 2003-11-09 22:09:04 +00:00
Makefile Revert exclusion for amd64 that stopped boot/ being built. 2003-06-26 03:52:48 +00:00