K 10 svn:author V 6 eadler K 8 svn:date V 27 2018-03-14T07:39:28.506341Z K 7 svn:log V 2227 MFC r315003,r315065,r315066: Rename scteken_revattr() to scteken_sc_to_te_attr(). scteken_revattr() looked like it might handle reverse attributes, but it actually handles conversion of attributes in the direction indicated by the new name. Reverse attributes are just broken. Rename scteken_attr() to scteken_te_to_sc_attr(). scteken_attr() looked like it might give teken attributes, but it actually gives sc attributes. Change scteken_te_to_sc_attr() to return int instead of unsigned int. u_char would be enough, and it promotes to int, and syscons uses int or u_short for its attributes everywhere else (u_short holds a shifted form and it promotes to int too). Add a scteken_set_cursor() (sc to teken) method and use it to fix some cases of initialization and resetting of the teken cursor position. (This bad name is consistent with others, but it is too easy to confuse with scteken_cursor() which goes in the opposite direction.) The following cases were broken: - for booting without a syscons console, the teken and sc positions for ttyv0 were (0, 0), but are supposed to be somewhere in the middle of the screen (after carefully preserved BIOS and loader messages) (at least if there is no mode switch that loses the messages). - after mode switches, the screen is cleared and the cursor is supposed to be moved to (0, 0), but it was only moved there for sc. The following case was hacked to work: - for booting with a syscons console, it was arranged that scteken_init() for the console could see a nonzero cursor position and adjust, although this broke the sc seeing it in the non-console case above. Fix the attribute for scteken_clear() (change it back from the user user default normal attribute to the current attribute). This change only fixes a logic error. scterm_clear() used to be used for terminal reset, but teken uses a general fill function for that, leaving scterm_clear() only used for initialization and mode change, when using the user default attribute is correct. It is not really a terminal function, but needs to sync its changes with the terminal layer. Syncing of the attribute is currently broken for terminal reset, but works for initialization and mode change. END