[BACK]Return to com.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / dev / ic

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/dev/ic/com.c between version 1.173 and 1.174

version 1.173, 2000/07/06 01:47:36 version 1.174, 2000/08/03 00:30:47
Line 77 
Line 77 
  */   */
   
 #include "opt_ddb.h"  #include "opt_ddb.h"
   #include "opt_ddbparam.h"
 #include "opt_com.h"  #include "opt_com.h"
   
 #include "rnd.h"  #include "rnd.h"
Line 1942  comintr(arg)
Line 1943  comintr(arg)
                 lsr = bus_space_read_1(iot, ioh, com_lsr);                  lsr = bus_space_read_1(iot, ioh, com_lsr);
 #if defined(DDB) || defined(KGDB)  #if defined(DDB) || defined(KGDB)
                 if (ISSET(lsr, LSR_BI)) {                  if (ISSET(lsr, LSR_BI)) {
   #ifndef DDB_BREAK_CHAR
 #ifdef DDB  #ifdef DDB
                         if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {                          if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
                                 console_debugger();                                  console_debugger();
Line 1954  comintr(arg)
Line 1956  comintr(arg)
                                 continue;                                  continue;
                         }                          }
 #endif  #endif
   #endif
                 }                  }
 #endif /* DDB || KGDB */  #endif /* DDB || KGDB */
   
Line 1962  comintr(arg)
Line 1965  comintr(arg)
                         while (cc > 0) {                          while (cc > 0) {
                                 put[0] = bus_space_read_1(iot, ioh, com_data);                                  put[0] = bus_space_read_1(iot, ioh, com_data);
                                 put[1] = lsr;                                  put[1] = lsr;
   #if defined(DDB) && defined(DDB_BREAKCHAR)
                                   if (put[0] == DDB_BREAK_CHAR &&
                                       ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
                                           console_debugger();
   
                                           lsr = bus_space_read_1(iot, ioh, com_lsr);
                                           if (!ISSET(lsr, LSR_RCV_MASK))
                                                   break;
   
                                           continue;
                                   }
   #endif
                                 put += 2;                                  put += 2;
                                 if (put >= end)                                  if (put >= end)
                                         put = sc->sc_rbuf;                                          put = sc->sc_rbuf;
Line 2148  comintr(arg)
Line 2163  comintr(arg)
  * by the console and kgdb glue.   * by the console and kgdb glue.
  */   */
   
   #if defined(DDB) && defined(DDB_BREAK_CHAR)
   #define MAX_UNGETC      20
   static int com_ungetc[MAX_UNGETC];
   static int com_ungetccount = 0;
   #endif
   
 int  int
 com_common_getc(iot, ioh)  com_common_getc(iot, ioh)
         bus_space_tag_t iot;          bus_space_tag_t iot;
Line 2156  com_common_getc(iot, ioh)
Line 2177  com_common_getc(iot, ioh)
         int s = splserial();          int s = splserial();
         u_char stat, c;          u_char stat, c;
   
   #if defined(DDB) && defined(DDB_BREAK_CHAR)
           /* got a character from reading things earlier */
           if (com_ungetccount > 0) {
                   int i;
   
                   c = com_ungetc[0];
                   for (i = 1; i < com_ungetccount; i++) {
                           com_ungetc[i -1] = com_ungetc[i];
                   }
                   com_ungetccount--;
                   splx(s);
                   return (c);
           }
   #endif
   
         /* block until a character becomes available */          /* block until a character becomes available */
         while (!ISSET(stat = bus_space_read_1(iot, ioh, com_lsr), LSR_RXRDY))          while (!ISSET(stat = bus_space_read_1(iot, ioh, com_lsr), LSR_RXRDY))
                 ;                  ;
   
         c = bus_space_read_1(iot, ioh, com_data);          c = bus_space_read_1(iot, ioh, com_data);
         stat = bus_space_read_1(iot, ioh, com_iir);          stat = bus_space_read_1(iot, ioh, com_iir);
   #if defined(DDB) && defined(DDB_BREAK_CHAR)
           if (c == DDB_BREAK_CHAR) {
                   extern int db_active;
   
                   if (db_active == 0) {
                           console_debugger();
                   }
           }
   #endif
         splx(s);          splx(s);
         return (c);          return (c);
 }  }
Line 2175  com_common_putc(iot, ioh, c)
Line 2220  com_common_putc(iot, ioh, c)
         int s = splserial();          int s = splserial();
         int timo;          int timo;
   
   #if defined(DDB) && defined(DDB_BREAK_CHAR)
           int cin, stat;
           if (com_ungetccount < MAX_UNGETC
                && ISSET(stat = bus_space_read_1(iot, ioh, com_lsr), LSR_RXRDY)) {
                   cin = bus_space_read_1(iot, ioh, com_data);
                   stat = bus_space_read_1(iot, ioh, com_iir);
                   if (cin == DDB_BREAK_CHAR) {
                           console_debugger();
                   }
                   com_ungetc[com_ungetccount++] = cin;
           }
   #endif
   
         /* wait for any pending transmission to finish */          /* wait for any pending transmission to finish */
         timo = 150000;          timo = 150000;
         while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY) && --timo)          while (!ISSET(bus_space_read_1(iot, ioh, com_lsr), LSR_TXRDY) && --timo)

Legend:
Removed from v.1.173  
changed lines
  Added in v.1.174

CVSweb <webmaster@jp.NetBSD.org>