Subject: Please review: cnmagic(9) for com(4)
To: None <>
From: Valeriy E. Ushakov <>
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).

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.


SY, Uwe
--                         |       Zu Grunde kommen            |       Ist zu Grunde gehen