Home | History | Annotate | Download | only in wscons
History log of /src/sys/dev/wscons/wsevent.c
RevisionDateAuthorComments
 1.47  26-Sep-2021  thorpej Change the kqueue filterops::f_isfd field to filterops::f_flags, and
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.

This does not constitute a functional or ABI change, as the field location
and size, and the value placed in that field, are the same as the previous
code, but we're bumping __NetBSD_Version__ so 3rd-party module source code
can adapt, as needed.

NetBSD 9.99.89
 1.46  18-Dec-2020  thorpej Use sel{record,remove}_knote().
 1.45  23-May-2020  ad branches: 1.45.2;
Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.44  04-Apr-2020  pgoyette KNF (Format block comment)

NFCI
 1.43  04-Apr-2020  mlelstv Make default protocol version used by wscons selectable and default
to the current version.

Fixes PR 55103.
 1.42  01-Mar-2019  pgoyette branches: 1.42.4;
Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as briefly
discussed on irc.

NFCI intended.

Ride the earlier kernel bump - it;s getting crowded.
 1.41  29-Jan-2019  pgoyette Normalize all the compat hooks' names to the form

<subsystem>_<function>_<version>_hook

NFCI

XXX Note that although this introduces a change in the kernel-to-
XXX module interface, we are NOT bumping the kernel version number.
XXX We will bump the version number once the interface stabilizes.
 1.40  27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.39  14-Jun-2018  uwe branches: 1.39.2;
timespec_to_timespec50 - don't leak kernel memory in struct padding.

On 64-bit machines struct timespec50 has padding between 32-bit tv_sec
and long tv_nsec that is not affected by normal assignment. Scrub it.
The result is most likely about to be passed to the user space by the
caller, so do it here to take care of them all.
 1.38  13-Jun-2018  uwe wsevent_copyout_events50 - don't leak garbage from the kernel stack.

On 64-bit machines struct timespec50 has padding between 32-bit tv_sec
and long tv_nsec that is not affected by normal assignment. Scrub it
before we uiomove struct owscons_event.
 1.37  25-Oct-2017  maya branches: 1.37.2;
Use C99 initializer for filterops

Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- { a, b, c, d
+ {
+ .f_isfd = a,
+ .f_attach = b,
+ .f_detach = c,
+ .f_event = d,
};
 1.36  24-Aug-2015  pooka to garnish, dust with _KERNEL_OPT
 1.35  24-May-2012  abs branches: 1.35.2; 1.35.16;
Add the following above the version = 0 line, just to provide a hint...
/* For binary compat. New code must call WSxxxIO_SETVERSION */
 1.34  18-Feb-2009  yamt branches: 1.34.12; 1.34.16;
wsevent_copyout_events50: fix a bogus panic.
 1.33  13-Feb-2009  apb Use "defopt MODULAR" in sys/conf/files, and #include "opt_modular.h"
in all kernel sources that use the MODULAR option.
Proposed in tech-kern on 18 Jan 2009.
 1.32  16-Jan-2009  yamt branches: 1.32.2;
always use the new version of wscons_event for in-kernel.
 1.31  16-Jan-2009  yamt wsevent_init: always initialize version. pointed out by christos.
 1.30  15-Jan-2009  yamt - reduce the number of #ifdefs.
- build compat glues if MODULAR.
 1.29  14-Jan-2009  christos Allocate the max size needed so that we don't need to realloc in setversion.
Problem pointed out by yamt.
 1.28  13-Jan-2009  christos provide wscons_event compatibility with 5.0.
 1.27  28-Apr-2008  martin branches: 1.27.8;
Remove clause 3 and 4 from TNF licenses
 1.26  24-Apr-2008  ad branches: 1.26.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
 1.25  01-Mar-2008  rmind branches: 1.25.2;
Welcome to 4.99.55:

- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call. It will
indicate which event (POLL_IN, POLL_OUT, etc) happen. If unknown,
zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.24  05-Dec-2007  pooka branches: 1.24.8; 1.24.12;
Do not "return 1" from kqfilter for errors. That value is passed
directly to the userland caller and results in a mysterious EPERM.
Instead, return EINVAL or something else sensible depending on the
case.
 1.23  09-Feb-2007  ad branches: 1.23.18; 1.23.20; 1.23.26; 1.23.28;
Merge newlock2 to head.
 1.22  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.21  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.20  08-Sep-2006  uebayasi branches: 1.20.2;
Typo.
 1.19  07-Jun-2006  kardel branches: 1.19.6;
merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
 1.18  07-Feb-2006  jmmv branches: 1.18.2; 1.18.8;
wsevent cleanup:

- Add a wsevent_inject function that atomically adds a set of events to an
event queue and change all code that directly messed with a queue to use it.
- Replace the WSEVENT_WAKEUP macro with a regular function.
- Make WSEVENT_QSIZE, PWSEVENT and splwsevent private definitions to
wsevent.c, instead of exposing them in the header file.
- Make the wsevent_init function take a process to attach to the queue,
instead of leaving this task to the caller (which always did it).

Reviewed in tech-kern@.
 1.17  11-Dec-2005  christos branches: 1.17.2; 1.17.4; 1.17.6;
merge ktrace-lwp.
 1.16  07-Aug-2003  agc branches: 1.16.16;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.15  29-Jun-2003  fvdl branches: 1.15.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.14  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.13  26-Dec-2002  christos Don't leak memory on double init, and don't panic on double fini. Emit
a message when diagnostic.
 1.12  26-Nov-2002  christos si_ -> sel_
 1.11  23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.10  12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.9  13-Nov-2001  lukem add/cleanup RCSIDs
 1.8  25-Oct-2001  augustss Change back to have a wseventvar in the softc for event sources. This
way the effect of FIOASYNC survives close()/open(). Later versions
of XFree86 relies on this bug/feature.
Also add some more debug stuff.
 1.7  24-Oct-2001  augustss Major rototilling of the wsmux code. No user visible changes (except that
many bugs have been fixed).
Changes:
The wskbd, wsmouse, and wsmux are now "sub-classes" of wsevsrc, which is
a source of ws events. This make the structure of those drivers a little
more uniform.
Many bug fixes involving adding and removing devices from muxes.
When a kernel is configured without wsmux there will now be none (unlike
before where you got a console mux anyway).
The kernel now compiles with all combinations of ws devices present.
 1.6  13-Oct-2001  augustss branches: 1.6.2;
ANSIfy.
 1.5  30-Mar-2000  augustss branches: 1.5.6; 1.5.8;
Remove register declarations.
 1.4  05-Jan-2000  drochner replace embedded _rcsid[] string by __KERNEL_RCSID(), remove _copyright[]
 1.3  10-Jan-1999  augustss branches: 1.3.8;
Change from bcopy/bzero to memxxx. From PR 6778 by
Erik Bertelsen <erik@q610.ebe.uni-c.dk>.
 1.2  18-Aug-1998  thorpej Add some braces to make egcs happy.
 1.1  22-Mar-1998  drochner Initial import of cgd's new wscons code.
 1.3.8.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.5.8.4  02-Oct-2002  jdolecek do not need the (void *) cast for kn_hook anymore
 1.5.8.3  11-Feb-2002  jdolecek Sync w/ -current.
 1.5.8.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.8.1  08-Sep-2001  thorpej Add kqueue support to wscons events.
 1.5.6.6  29-Dec-2002  thorpej Sync with HEAD.
 1.5.6.5  11-Dec-2002  thorpej Sync with HEAD.
 1.5.6.4  11-Nov-2002  nathanw Catch up to -current
 1.5.6.3  28-Feb-2002  nathanw Catch up to -current.
 1.5.6.2  14-Nov-2001  nathanw Catch up to -current.
 1.5.6.1  22-Oct-2001  nathanw Catch up to -current.
 1.6.2.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.15.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.15.2.2  03-Aug-2004  skrll Sync with HEAD
 1.15.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.16.16.5  17-Mar-2008  yamt sync with head.
 1.16.16.4  07-Dec-2007  yamt sync with head
 1.16.16.3  26-Feb-2007  yamt sync with head.
 1.16.16.2  30-Dec-2006  yamt sync with head.
 1.16.16.1  21-Jun-2006  yamt sync with head.
 1.17.6.2  22-Apr-2006  simonb Update for timecounters - use getnanotime() and time_second variable.
 1.17.6.1  22-Apr-2006  simonb Sync with head.
 1.17.4.1  09-Sep-2006  rpaulo sync with head
 1.17.2.1  18-Feb-2006  yamt sync with head.
 1.18.8.1  19-Jun-2006  chap Sync with head.
 1.18.2.2  14-Sep-2006  yamt sync with head.
 1.18.2.1  26-Jun-2006  yamt sync with head.
 1.19.6.2  19-Jan-2007  ad Acquire proclist_mutex before sending signals.
 1.19.6.1  18-Nov-2006  ad Sync with head.
 1.20.2.2  10-Dec-2006  yamt sync with head.
 1.20.2.1  22-Oct-2006  yamt sync with head
 1.23.28.1  08-Dec-2007  ad Sync with head.
 1.23.26.1  08-Dec-2007  mjf Sync with HEAD.
 1.23.20.2  23-Mar-2008  matt sync with HEAD
 1.23.20.1  09-Jan-2008  matt sync with HEAD
 1.23.18.1  09-Dec-2007  jmcneill Sync with HEAD.
 1.24.12.3  17-Jan-2009  mjf Sync with HEAD.
 1.24.12.2  02-Jun-2008  mjf Sync with HEAD.
 1.24.12.1  03-Apr-2008  mjf Sync with HEAD.
 1.24.8.1  24-Mar-2008  keiichi sync with head.
 1.25.2.1  18-May-2008  yamt sync with head.
 1.26.2.2  04-May-2009  yamt sync with head.
 1.26.2.1  16-May-2008  yamt sync with head.
 1.27.8.2  03-Mar-2009  skrll Sync with HEAD.
 1.27.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.32.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.34.16.1  02-Jun-2012  mrg sync to latest -current.
 1.34.12.1  30-Oct-2012  yamt sync with head
 1.35.16.1  22-Sep-2015  skrll Sync with HEAD
 1.35.2.1  03-Dec-2017  jdolecek update from HEAD
 1.37.2.10  22-Jan-2019  pgoyette Convert the MODULE_{,VOID_}HOOK_CALL macros to do everything in-line
rather than defining an intermediate hook##call function. Almost
all of the hooks are called only once, and although we lose the
ability of doing things like

if (MODULE_HOOK_CALL(...) == 0) ...

we simplify things quite a bit. With this change, we no longer need
to have both declaration and definition macros, and the definition
no longer needs to have both prototype argument list and a "real"
argument list.

FWIW, the above if now needs to written as

int ret;

MODULE_HOOK_CALL(..., ret);
if (ret == 0) ...

with appropriate use of braces {}.
 1.37.2.9  18-Jan-2019  pgoyette Don't restrict hooks to having only int or void types. Pass the hook's
type to the various macros, as needed.

Allows us to reduce diffs to original in at least one or two places (we
no longer have to provide an additional parameter to the hook routine
for returning a non-int return value).
 1.37.2.8  14-Jan-2019  pgoyette Create a variant of the HOOK macros that handles hook routines of
type void, and use them where appropriate.
 1.37.2.7  13-Jan-2019  pgoyette Remove the HOOK2 versions of the MODULE_HOOK macros. There were
only a few uses, and using them led to some lack of clarity in the
code. Instead, we now use two separate hooks, with names that
make it clear(er) what we're doing.

This also positions us to start unraveling some of the rtsock_50
mess, which will need (at least) five hooks.
 1.37.2.6  29-Sep-2018  pgoyette In MODULE_HOOK_CALL_DECL we don't need to provide the actual argument
list for calling the hook function, nor do we need to provide the
default value (for when the hook has not been set).
 1.37.2.5  18-Sep-2018  pgoyette The COMPAT_HOOK macros were renamed to MODULE_HOOK, adjust all callers
 1.37.2.4  18-Sep-2018  pgoyette Split the COMPAT_CALL_HOOK to separate the declaration from the
implementation. Some hooks are called from multiple source files,
and the old method resulted in duplicate implementations.

Implement MP-safe hooks for the usb_subr_30 code. Pass the helper
functions as arguments to the compat code so it does not have to
determine if the kernel contains usb code.
 1.37.2.3  17-Sep-2018  pgoyette Adapt (most of) the indirect function pointers to the new MP-safe
mechanism. Still remaining are the compat_netbsd32 stuff, and
some usb subroutines.
 1.37.2.2  25-Jun-2018  pgoyette Sync with HEAD
 1.37.2.1  24-Mar-2018  pgoyette Move the compat_50-specific code out of wscons/wsevent.c into its own
source file, which is now part of the compat_50 module.
 1.39.2.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.39.2.1  10-Jun-2019  christos Sync with HEAD
 1.42.4.1  06-Apr-2020  martin Pull up following revision(s) (requested by pgoyette in ticket #820):

sys/dev/wscons/wsevent.c: revision 1.43
sys/dev/wscons/wsevent.c: revision 1.44

Make default protocol version used by wscons selectable and default
to the current version.

Fixes PR 55103.

KNF (Format block comment)
NFCI
 1.45.2.1  03-Jan-2021  thorpej Sync w/ HEAD.

RSS XML Feed