DragonFly BSD

CVS log for src/sys/sys/msgport.h

[BACK] Up to [DragonFly] / src / sys / sys

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Nov 26 15:05:42 2008 UTC (5 years, 9 months ago) by sephe
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.31: preferred, unified
Changes since revision 1.31: +2 -0 lines
Resurrect priority message support; there is always +/-5~10K measurement error.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sat Nov 22 11:03:35 2008 UTC (5 years, 9 months ago) by sephe
Branches: MAIN
Diff to: previous 1.30: preferred, unified
Changes since revision 1.30: +0 -2 lines
Remove MSGF_PRIORITY support.  The flag testing and message queue selection
on the hot code path introduce noticeable performance regression during ip
forwarding (from 667Kpps to 655Kpps w/ 64bytes packet and fastforwarding
enabled on Phenom 9550).

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sun Nov 9 09:20:09 2008 UTC (5 years, 9 months ago) by sephe
Branches: MAIN
Diff to: previous 1.29: preferred, unified
Changes since revision 1.29: +4 -0 lines
- Add priority message queue to msgport.  Send a message with MSGF_PRIORITY
  flag will queue the message into the priority message queue of the target
  port.  The priority message queue takes precendence over normal message
  queue, so the messages with MSGF_PRIORITY flag will be processed before
  other messages on the same target port.  This could be used by defering
  callout or operation that should not be delayed too long on the target
  port.
- Add dropmsg function to msgport.  Message must be marked with MSGF_DROPABLE,
  else dropmsg operation is not allowed.  Message marked with MSGF_DROPABLE
  is not waitable, i.e. you could not call domsg on this kind of message.
  Currently only thread msgport supports this operation and this operation
  must be performed in the same thread of the msgport's owner thread.

Discussed-with: dillon@

Revision 1.29: download - view: text, markup, annotated - select for diffs
Tue Sep 9 07:21:57 2008 UTC (5 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.28: preferred, unified
Changes since revision 1.28: +1 -0 lines
Add a MSGF_NORESCHED feature for lwkt thread-based message ports.  The
idea is to use it to allow certain async messages to be queued to higher
priority system threads and schedule those threads without forcing an
immediate reschedule.

The feature will be used by the new socket code to prevent cavitation
between a user process and system protocol thread when the user process
is write()ing a lot of data over the network.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Aug 25 23:34:34 2008 UTC (6 years ago) by dillon
Branches: MAIN
Diff to: previous 1.27: preferred, unified
Changes since revision 1.27: +7 -0 lines
AMD64 Support:

* Move amd64-specific signal.h defs to machine/signal.h

* Change size field in tls_info from 'int' to 'long' to accomodate
  64 bit architectures.

Submitted-by: Matthew Dillon
Obtained-from: FreeBSD, Jordan Gordeev <jgordeev@dir.bg>, and Matt

Revision 1.27: download - view: text, markup, annotated - select for diffs
Wed Mar 5 13:03:29 2008 UTC (6 years, 6 months ago) by sephe
Branches: MAIN
CVS tags: DragonFly_RELEASE_2_0_Slip, DragonFly_RELEASE_2_0, DragonFly_Preview
Diff to: previous 1.26: preferred, unified
Changes since revision 1.26: +4 -0 lines
Add serializer port backend.  Implementation is mainly based on spin
port backend, but unlike spin port backend: users of this port backend
are assumed to have the port's serializer held.

Proper function name is suggested by corecode@, aggelos@, tgen@ and
dillon@

Reviewed-by: tgen@, dillon@

Revision 1.26: download - view: text, markup, annotated - select for diffs
Thu May 24 20:51:19 2007 UTC (7 years, 3 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12, DragonFly_RELEASE_1_10_Slip, DragonFly_RELEASE_1_10
Diff to: previous 1.25: preferred, unified
Changes since revision 1.25: +7 -12 lines
Add lwkt_sleep() to formalize a shortcut numerous bits of code have been
using for a while, which is to directly deschedule oneself and switch away.
This method of blocking requires a direct lwkt_schedule() call to reschedule
the thread and is primarily used by the message port abstraction.

Change the psignal code to check TDF_SINTR in the thread flags instead
of checking MSGPORTF_WAITING in the thread's private message port.

The lwkt_waitmsg() and lwkt_waitport() functions use the same msgport
backend function (mp_waitport).  Separate the backend into two functions,
mp_waitport and mp_waitmsg, and allow tsleep flags to be passed in instead
of flagging interruptability in the lwkt_msg flags.

Optimize the lwkt_waitmsg() backends - in the fully synchronous critical
path case no critical sections or spinlocks are required at all.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Thu May 24 05:51:28 2007 UTC (7 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.24: preferred, unified
Changes since revision 1.24: +36 -13 lines
LWKT message ports contain a number of function pointers which abstract
their backend operation.

* Add a new function, mp_getport(), which takes over the functionality
  of lwkt_getport().

* Formalize the default backend and rename it the 'thread' port backend, used
  when a message port will only be drained by a single thread.  This backend
  is able to use critical sections and IPI messages to handle races.

* Fix a small timing window in the thread port backend where replying a
  synchronous message request from a different cpu may fail to wake up
  the originator who is waiting for the message completion.

* Abstract-out the message port initialization code and clean up related
  code pollution.

* Add a new backend called the 'spin' port backend.  This backend can be
  used if a message port might be drained by several different threads.
  For example, this would allow us to use a message port as part of a
  file pointer / file descriptor construct.

* Add a boot-time tunable, lwkt.use_spin_port (defaults to off) which
  forces spin ports to be used instead of thread ports for the per-thread
  message port.  This is used only for debugging.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Wed May 23 08:56:59 2007 UTC (7 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.23: preferred, unified
Changes since revision 1.23: +32 -55 lines
* Greatly reduce the complexity of the LWKT messaging and port abstraction.
  Significantly reduce the overhead of the subsystem.

* The message abort algorithm has been rewritten.  It now sends a
  separate message to issue the abort instead of trying to requeue
  the original message.  This also means the TAILQ embedded in the
  lwkt_msg structure can be used by unrelated code during processing
  of the message.

* Numerous MSGF_ flags have been removed, and all the LWKT msg/port
  algorithms have been rewritten and simplified.  The message structure
  is now only touched by the current owner in all situations.

* Numerous structural fields have been removed.  In particular, the
  fields used for message abort sequencing have been simplified and
  we do not try to embed a 'command' field in the base LWKT message
  any more.

* Clean up the netmsg abstraction, which is used all over the network stack.
  Instead of trying to overload fields in lwkt_msg we now simply extend
  the base lwkt_msg into struct netmsg.  The function dispatch now takes
  a netmsg and returns void (before we had to return EASYNC), and we no
  longer need weird casts.

  Accept/connect message aborts are now greatly simplified.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Wed May 23 02:09:41 2007 UTC (7 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.22: preferred, unified
Changes since revision 1.22: +0 -10 lines
Simplify the lwkt_msg structure by removing two unused fields and a number
of obsolete preprocessor defines.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sat May 20 06:32:41 2006 UTC (8 years, 3 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_8_Slip, DragonFly_RELEASE_1_8, DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.21: preferred, unified
Changes since revision 1.21: +8 -2 lines
Embed the netmsg in the mbuf itself rather than allocating one for
each received packet.  This greatly reduces the overhead in the
network receive path (removing a malloc() and free()).

Revision 1.21: download - view: text, markup, annotated - select for diffs
Tue Dec 21 19:41:36 2004 UTC (9 years, 8 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Stable, DragonFly_RELEASE_1_4_Slip, DragonFly_RELEASE_1_4, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +1 -1 lines
Remove confusing comment.

Reported-by: Dion Blazakis <dion.blazakis@gmail.com>

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri Sep 10 18:23:54 2004 UTC (9 years, 11 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +2 -0 lines
Implement a convenient lwkt_initport_null_rport() call which initializes
a message port with a non-queueing sink-null replyport rather then a default
replyport, rather then rolling our own in the net code and other places where
we may need it.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Mon Jun 7 07:01:36 2004 UTC (10 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_1_0_REL, DragonFly_1_0_RC1, DragonFly_1_0A_REL
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +38 -0 lines
Recent accept() changes started depending on the protosw->pr_mport field
being non-NULL, but unix domain sockets still used a NULL pr_mport field.
This was causing e.g. XFree86 to panic the system.

Unix domain socket calls must still be executed synchronously in the context
of the originating process in order to access the proc structure (for ucred
and other things).

Implement a special synchronous port (netisr_sync_port) and hook function
for the protosw called sync_soport() and hook it into the unix domain
socket protosw.  This port executes netmsg's synchronously and also supports
aborts for predicate messages (used by connect and accept).

The atm protosw also specified NULL which we change to the standard
cpu0_soport().

Remove previous workaround code for NULL mports, since we no longer have
any NULL mports.  Remove an assertion in connect2() that was designed to
detect mis-programmed use of the UNIX DOMAIN socket protosw structure.

Original-problem-reported-by: David Rhodus

Revision 1.18: download - view: text, markup, annotated - select for diffs
Fri Jun 4 20:35:39 2004 UTC (10 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +1 -1 lines
async syscall work: The async syscall code got dated by recent LWKT
changes, set mp_abort_port and clear MSGF_DONE as appropriate.

If a system call returns EASYNC, record the message in p->p_sysmsgq so we
can run them down in exit1().

In exit1(), run down any asynch system calls that are still running.  Note
that this commit does not implement abort support (yet).

Get rid of lwkt_port->mp_refs, it was not being used and it is likely never
going to be used (reference counting LWKT is hazzardous anyway since it
doesn't really fit the access model).

Add lwkt_checkmsg() to support some of the rearranged async syscall code.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Tue Apr 20 01:52:24 2004 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +25 -7 lines
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

Revision 1.16: download - view: text, markup, annotated - select for diffs
Thu Apr 15 00:50:05 2004 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +27 -4 lines
Implement lwkt_abortmsg() support.  This function chases down a message and
marks it MSGF_ABORTED, requeuing it to its target port for abort reprocessing.
The chasedown may run through multiple message forwardings and even chase the
message all the way back to the reply port (in which case the abort becomes a
NOP).  The queueing of a replied message is delayed if there is an abort
chasing it down until the abort chasedown has caught up to the message.

Support MSGF_PCATCH in the default waitport function.  If a signal is pending,
lwkt_default_waitport() (the default assigned to mp_waitport) will request
a message abort.  Note that we still have to wait for the message to be
returned after requesting a message abort.

Also do some minor performance tuning and adjust or move some of the inlines
from msgport2.h into lwkt_msgport.c.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Mon Apr 5 18:49:17 2004 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +9 -4 lines
Export the lwkt_default_*() message port default functions so other
code (e.g. networking) can call them.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sat Mar 6 19:40:32 2004 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +0 -1 lines
Simplify LWKT message initialization semantics to reduce API confusion.

Cleanup netisr messaging to provide more uniform error handling and to use
lwkt_replymsg() unconditionally for both async/auto-free and sync messages
as the abstraction intended.  This also fixes a reply/free race.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat Mar 6 01:58:57 2004 UTC (10 years, 6 months ago) by hsu
Branches: MAIN
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +6 -0 lines
Dispatch upper-half protocol request handling.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sun Jan 18 12:29:50 2004 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +2 -2 lines
CAPS IPC library stage 1/3: The core CAPS IPC code, providing system calls
to create and connect to named rendezvous points.  The CAPS interface
implements a many-to-1 (client:server) capability and is totally self
contained.  The messaging is designed to support single and multi-threading,
synchronous or asynchronous (as of this commit: polling and synchronous only).

Message data is 100% opaque and so while the intention is to integrate it into
a userland LWKT messaging subsystem, the actual system calls do not depend
on any LWKT structures.

Since these system calls are experiemental and may contain root holes,
they must be enabled via the sysctl kern.caps_enabled.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Nov 24 20:46:05 2003 UTC (10 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.10: preferred, unified
Changes since revision 1.10: +1 -6 lines
More LWKT messaging cleanups.  Isolate the default port functions by making
them static and rename lwkt_init_port() to lwkt_initport() to conform with
lwkt_initmsg().

Revision 1.10: download - view: text, markup, annotated - select for diffs
Fri Nov 21 22:46:13 2003 UTC (10 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +6 -3 lines
Do some fairly major include file cleanups to further separate kernelland
from userland.

    * Do not allow userland to include sys/proc.h directly, it must use
      sys/user.h instead.   This is because sys/proc.h has a huge number
      of kernel header file dependancies.

    * Do cleanups and work in lwkt_thread.c and lwkt_msgport.c to allow
      these files to be directly compiled in an upcoming userland thread
      support library.

    * sys/lock.h is inappropriately included by a number of third party
      programs so we can't disallow its inclusion, but do not include
      any kernel structures unless _KERNEL or _KERNEL_STRUCTURES are
      defined.

    * <ufs/ufs/inode.h> is often included by userland to get at the
      on-disk inode structure.  Only include the on-disk components and do
      not include kernel structural components unless _KERNEL or
      _KERNEL_STRUCTURES is defined

    * Various usr.bin programs include sys/proc.h unnecessarily.

    * The slab allocator has no concept of malloc buckets.  Remove malloc
      buckets structures and VMSTAT support from the system.

    * Make adjustments to sys/thread.h and sys/msgport.h such that the
      upcoming userland thread support library can include these files
      directly rather then copy them.

    * Use low level __int types in sys/globaldata.h, sys/msgport.h,
      sys/slaballoc.h, sys/thread.h, and sys/malloc.h, instead of
      high level sys/types.h types, reducing include dependancies.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Thu Nov 20 06:05:31 2003 UTC (10 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +28 -30 lines
This is a major cleanup of the LWKT message port code.  The messaging code
is getting closer to being directly useable by userland.  With these changes
message/port operations are now far better abstracted then they were before.

    * Stale fields have been removed from struct lwkt_msg.
    * lwkt_abortmsg() has been revamped to make it easier to support.
    * lwkt_waitmsg has been converted to a port function.
    * mp_*port() function fields have been renamed for better readability.
    * ms_cleanupmsg has been removed from struct lwkt_msg.
    * Union sysmsg is now struct sysmsg.
    * A copyout function has been added to struct sysmsg.
    * The system calls have been regenerated.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Nov 8 07:57:43 2003 UTC (10 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +1 -0 lines
Network threading stage 1/3: netisrs are already software interrupts,
which means they alraedy run in their own thread.  This commit creates
multiple supporting threads for netisrs rather then just one and code
has been added to begin routing packets to particular threads based on
their content.  Eventually this will lead to us being able to isolate and
serialize PCBs in particular threads.  The tail end of the ip_input path's
protocol dispatch, the UIPC (user entry) code, and listen socket have not
been covered yet and still need to be serialized.

A new debugging sysctl, net.inet.ip.mthread_enable, has been added.  It
defaults to 1.  If you set this sysctl 0 netisr processing will revert to
the prior single-threaded behavior.

Submitted-by: Jeffrey Hsu <hsu@FreeBSD.org>
Additional-work-by: dillon

Revision 1.7: download - view: text, markup, annotated - select for diffs
Tue Aug 12 02:36:15 2003 UTC (11 years ago) by dillon
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +12 -1 lines
Syscall messaging 4: Further expand the kernel-version of the syscall message.
The (in-kernel) syscall message is now arranged:

    struct blah_args {
	sysmsg
	usrmsg
	... syscall arguments ...
    }

Original system calls copyin() just the arguments and then initialize sysmsg
and go.  Syscall messages copyin() usrmsg+arguments and then initialize sysmsg
as appropriate and go.

Further detail work for EASYNC support.  Implement td_msgport as a reply port
and start working on an async capability for the nanosleep() system call.

NOTE: Preliminary system call messaging can be tested using the suite of
programs in /usr/src/test/sysmsg.

NOTE: Work is still in progress  and you can crash the system, so use of
MSGF_ASYNC for messaging system calls is currently restricted to root.

Also fixed a bug in the syscall module helper code in sys/sysent.h, which
might have been causing the linux problems (or might not have).

All system call headers had to be regenerated to deal with the structural
changes.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Wed Jul 30 00:19:16 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +3 -3 lines
syscall messaging 3: Expand the 'header' that goes in front of the syscall
arguments in the kernel copy.  The header was previously just an lwkt_msg.
The header is now a 'union sysmsg'.  'union sysmsg' contains an lwkt_msg
plus space for the additional meta data required to asynchronize various
system calls.   We haven't actually asynchronized anything yet and will not
be able to until the reply port and abort processing infrastructure is
in place.  See sys/sysmsg.h for more information on the new header.

Also cleanup syscall generation somewhat and add some ibcs2 stuff I missed.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sat Jul 26 18:12:46 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +7 -3 lines
syscall messaging 2: Change the standard return value storage for system
calls from proc->p_retval[] to the message structure embedded in the syscall.
System calls used to set their non-error return value in p_retval[] but
must now set it in the message structure.  This is a necessary precursor to
any sort of asynchronizatino, for obvious reasons.

This work was particularly annoying because all the emualtion code declares
and manually fills in syscall argument structures.

This commit could potentially destabilize some of the emulation code but I
went through the most important Linux emulation code three times and tested it
with linux-mozilla, so I am fairly confident that I got it right.

Note: proper linux emulation requires setting the fallback elf brand to 3 or
it will default to SVR4.  It really ought to default to linux (3), not SVR4.

    sysctl -w kern.fallback_elf_brand=3

Revision 1.4: download - view: text, markup, annotated - select for diffs
Thu Jul 24 23:52:39 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +6 -0 lines
Syscall messaging work 2: Continue with the implementation of sendsys(),
using int 0x81.  This entry point will be responsible for sending system
call messages or waiting for messages / port activity.

With this commit system call messages can be run through 0x81 but at the
moment they will always run synchronously. Here's the core interface
code for IA32:

    static __inline int
    sendsys(void *port, void *msg, int msgsize)
    {
	int error;
	__asm __volatile("int $0x81" : "=a"(error) :
			"a"(port), "c"(msg), "d"(msgsize) : "memory");
	return(error);
    }

Performance verses a direct system call is currently excellent considering
that this is my initial attempt.

		600MHzC3	1.2GHzP3x2(SMP)

getuid()	1300 ns		 909 ns
getuid_msg()	1700 ns		1077 ns

Revision 1.3: download - view: text, markup, annotated - select for diffs
Thu Jul 24 01:41:27 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.2: preferred, unified
Changes since revision 1.2: +8 -0 lines
Preliminary syscall messaging work.  Adjust all <syscall>_args structures
to include an lwkt_msg at their base which will eventually allow syscalls
to run asynch.  Note that this is for the kernel copy of the arguments, the
userland argument format has not changed for the standard syscall entry
point.

Begin abstracting a messaging syscall interface (#if 0'd out at the moment).

Change the syscall2 entry point to take the new expanded argument structure
into account.  Change sysent argument calculation (AS macro) to take the
new expanded argument structure into account.

Note: existing linux, svr4, and ibcs2 emulation may break with this commit,
though it is not intentional.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Jul 22 17:03:34 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.1: preferred, unified
Changes since revision 1.1: +10 -2 lines
DEV messaging stage 2/4: In this stage all DEV commands are now being
funneled through the message port for action by the port's beginmsg function.
CONSOLE and DISK device shims replace the port with their own and then
forward to the original.  FB (Frame Buffer) shims supposedly do the same
thing but I haven't been able to test it.   I don't expect instability
in mainline code but there might be easy-to-fix, and some drivers still need
to be converted.  See primarily: kern/kern_device.c (new dev_*() functions and
inherits cdevsw code from kern/kern_conf.c), sys/device.h, and kern/subr_disk.c
for the high points.

In this stage all DEV messages are still acted upon synchronously in the
context of the caller.  We cannot create a separate handler thread until
the copyin's (primarily in ioctl functions) are made thread-aware.

Note that the messaging shims are going to look rather messy in these early
days but as more subsystems are converted over we will begin to use
pre-initialized messages and message forwarding to avoid having to constantly
rebuild messages prior to use.

Note that DEV itself is a mess oweing to its 4.x roots and will be cleaned
up in subsequent passes.  e.g. the way sub-devices inherit the main device's
cdevsw was always a bad hack and it still is, and several functions
(mmap, kqfilter, psize, poll) return results rather then error codes, which
will be fixed since now we have a message to store the result in :-)

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sun Jul 20 01:37:22 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
This is the initial implmentation of the LWKT messaging infrastructure.
Messages are sent to message ports and typically replied to a message port
embedded in the originating thread's thread structure (td_msgport).
The port functions match up and optimization client sync/asynch requests
verses target synch/asynch responses.

In this initial implementation a port must be owned by a particular thread,
and we use *asynch* IPI messaging to forward queueing and dequeueing operations
to the correct cpu.  Most of the IPI overhead will be absorbed by the fact
that these same IPIs also tend to schedule the threads in question, which on
the correct cpu (which is the one it will be on) costs nothing.

Message ports have in-context dispatch functions for initiating, aborting,
and replying to a message which can be overriden and will queue by default.

This code compiles but is as yet unreferenced, and almost certainly needs more
work.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options