kernel - Fix live lock in vfs_conf.c mountroot>
* The mountroot> prompt calls cngetc() to process user input. However, this
function hard loops and can prevent other kernel threads from running on
the current cpu.
* Rearrange the code to use cncheckc() and a 1/25 second tsleep().
* Fix a bug in the syscons code where NOKEY was not being properly returned
as documented. Modify all use cases to handle NOKEY. This allows us to
differentiate between a keyboard present but not key pressed and a keyboard
not present.
* Pull the automatic polling mode code out of cncheckc() (or more precisely,
out of sccncheckc()) and add a new cnpoll() API function to set it manually.
This fixes issues in vfs_conf when normal keyboard processing interrupts
are operational and cncheckc() is used with a tsleep() delay. The normal
processing interrupt wound up eating the keystrokes so the cncheckc()
basically always failed.
cncheckc() in general also always had a small window of opportunity where
a keystroke could be lost due loops on it.
* Call cnpoll() in various places, such as when entering the debugger,
asking for input in vfs_conf, and a few other places.
14 files changed: