freebsd-nq/sys/dev/syscons
Bruce Evans e866ca565f Flesh out the state and flags args to sccnopen(). Set state flags to
indicate (potentially partial) success of the open.  Use these to
decide what to close in sccnclose().  Only grab/ungrab use open/close
so far.

Add a per-sc variable to count successful keyboard opens and use
this instead of the grab count to decide if the keyboad state has
been switched.

Start fixing the locking by using atomic ops for the most important
counter -- the grab level one.  Other racy counting will eventually
be fixed by normal mutex or kdb locking in most cases.

Use a 2-entry per-sc stack of states for grabbing.  2 is just enough
to debug grabbing, e.g., for gets().  gets() grabs once and might not
be able to do a full (or any) state switch.  ddb grabs again and has
a better chance of doing a full state switch and needs a place to
stack the previous state.  For more than 3 levels, grabbing just
changes the count.  Console drivers should try to switch on every i/o
in case lower levels of nesting failed to switch but the current level
succeeds, but then the switch (back) must be completed on every i/o
and this flaps the state unless the switch is null.  The main point
of grabbing is to make it null quite often.  Syscons grabbing also
does a carefully chosen screen focus that is not done on every i/o.

Add a large comment about grabbing.

Restore some small lost comments.
2016-08-24 18:59:24 +00:00
..
apm
blank
daemon
dragon
fade
fire
green
logo
plasma
rain
snake
star
warp
scgfbrndr.c
schistory.c
scmouse.c sys: Make use of our rounddown() macro when sys/param.h is available. 2016-04-30 14:41:18 +00:00
scterm-teken.c
scterm.c
scvesactl.c
scvgarndr.c sys: Make use of our rounddown() macro when sys/param.h is available. 2016-04-30 14:41:18 +00:00
scvidctl.c
scvtb.c
syscons.c Flesh out the state and flags args to sccnopen(). Set state flags to 2016-08-24 18:59:24 +00:00
syscons.h Flesh out the state and flags args to sccnopen(). Set state flags to 2016-08-24 18:59:24 +00:00
sysmouse.c