Revamp the initial lwkt_abortmsg() support to normalize the abstraction. Now
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 20 Apr 2004 01:52:28 +0000 (01:52 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 20 Apr 2004 01:52:28 +0000 (01:52 +0000)
commitb44419cb4460c6e8d4e16a260372e9965b77eecf
treee4398343a0fb087b7668676eca2c92f3af8ec891
parente4ba78180bd466faadda7470d5311b492fd19dc7
Revamp the initial lwkt_abortmsg() support to normalize the abstraction.  Now
a message's primary command is always processed by the target even if an
abort is requested before the target has retrieved the message from the
message port.  The message will then be requeued and the abort command copied
into lwkt_msg_t->ms_cmd.  Thus the target is always guarenteed to see the
original message and then a second, abort message (the same message with
ms_cmd = ms_abort) regardless of whether the abort was requested before
or after the target retrieved the original message.

ms_cmd is now an opaque union.  LWKT makes no assumptions as to its contents.
The NET code now stores nm_handler in ms_cmd as a function vector, and
nm_handler has been removed from all netmsg structures.

The ms_cmd function vector support nominally returns an integer error code
which is intended to support synchronous/asynchronous optimizations in the
future (to bypass messaging queueing and dequeueing in those situations
where they can be bypassed, without messing up the messaging abstraction).

The connect() predicate for which signal/abort support was added in the last
commit now uses the new abort mechanism.  Instead of having the handler
function check whether a message represents an abort or not, a different
handler vector is stored in ms_abort and run when an abort is processed
(making for an easy separation of function).

The large netmsg switch has been replaced by individual function vectors
using the new ms_cmd function vector support.  This will soon be removed
entirely in favor of direct assignment of LWKT-aware PRU vectors to the
messages command vector.

NOTE ADDITIONAL: eventually the SYSCALL, VFS, and DEV interfaces will use
the new message opaque ms_cmd 'function vector' support instead of a
command index.

Work by: Matthew Dillon and Jeffrey Hsu
18 files changed:
sys/i386/i386/trap.c
sys/kern/kern_device.c
sys/kern/lwkt_msgport.c
sys/kern/subr_disk.c
sys/kern/tty_cons.c
sys/kern/uipc_msg.c
sys/kern/uipc_socket2.c
sys/kern/uipc_syscalls.c
sys/net/netisr.c
sys/net/netisr.h
sys/net/netmsg.h
sys/netinet/ip_demux.c
sys/netinet/ip_input.c
sys/netinet/tcp_subr.c
sys/netinet/tcp_usrreq.c
sys/platform/pc32/i386/trap.c
sys/sys/msgport.h
sys/sys/msgport2.h