Index: com.c =================================================================== RCS file: /cvs/src/sys/dev/ic/com.c,v retrieving revision 1.158 diff -u -p -r1.158 com.c --- com.c 14 Sep 2014 14:17:24 -0000 1.158 +++ com.c 5 Jan 2016 23:36:27 -0000 @@ -79,6 +79,7 @@ #endif #include +#include #if !defined(__sparc__) || defined(__sparc64__) #include #endif @@ -146,6 +147,32 @@ void com_kgdb_putc(void *, int); #define DEVUNIT(x) (minor(x) & 0x7f) #define DEVCUA(x) (minor(x) & 0x80) +void +disp_reg(char *identifier, bus_space_tag_t iot, bus_space_handle_t ioh) +{ + int i; + unsigned char reg[16]; + unsigned char lcr; + + disable_intr(); + + lcr = bus_space_read_1(iot, ioh, com_lcr); + + bus_space_write_1(iot, ioh, com_lcr, lcr | LCR_DLAB); + for (i = 0; i < 8; i++) reg[i + 8] = bus_space_read_1(iot, ioh, i); + + bus_space_write_1(iot, ioh, com_lcr, lcr); + for (i = 1; i < 8; i++) reg[i] = bus_space_read_1(iot, ioh, i); + + reg[0] = 0xff; + + enable_intr(); + + printf("%s: ", identifier); + for (i = 0; i < 16; i++) printf("%02x ", reg[i]); + printf("\n"); +} + int comspeed(long freq, long speed) { @@ -431,6 +458,7 @@ comopen(dev_t dev, int flag, int mode, s #endif } #endif +disp_reg("comopen", iot, ioh); } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p, 0) != 0) return EBUSY; else @@ -681,6 +709,7 @@ com_resume(struct com_softc *sc) #endif } #endif +disp_reg("com_resume", iot, ioh); } void @@ -981,6 +1010,7 @@ comparam(struct tty *tp, struct termios bus_space_write_1(iot, ioh, com_mcr, sc->sc_mcr); } +disp_reg("comparam", iot, ioh); /* Just to be sure... */ comstart(tp); return 0; @@ -1403,6 +1433,7 @@ cominit(bus_space_tag_t iot, bus_space_h FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER_1); stat = bus_space_read_1(iot, ioh, com_iir); splx(s); +disp_reg("cominit", iot, ioh); } #ifdef COM_CONSOLE