Subject: Please review: cnmagic(9) for com(4)
To: None <tech-kern@netbsd.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: tech-kern
Date: 06/16/2001 05:07:20
Here's a first cut at converting sys/dev/ic/com.c to use cnmagic(9).
http://snark.ptc.spbu.ru/~uwe/com.c-cnmagic.diff

comcnattach sets magic to BREAK by default.  Interested clients
(e.g. sparc64 with kbd off com) can override upon successful return
from comcnattach.

Some notes:

* some archs (e.g. sun[23]) can drop to PROM (if DDB is not enabled),
  so code checks magic uncoditionally (unifdef DDB).

** Is this ok (see next item)?  Should this be conditionalizde on, say

    #if defined(DDB) || defined(__HAVE_PROM_DEBUGGER)

** If magic is in-band (e.g. +++++), and debugger is not enabled, the
   last char of in-band magic will be consumed by cn_check_magic,
   which is bad, I guess.

* Is -1 a good dummy for dev_t?  (in com_kgdb_{get,put}c).

* s/ungetc/readahead/ in com_common_* since that's what it really is
  The 'ungetc' is a _very_ confusing name for this.


Thanks.

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen