kernels/linux-2.4.0/arch/mips/cobalt/cobaltscc.c
/*
 * These two functions abstract the actual communications with the
 * debug port.  This is so we can change the underlying communications
 * mechanism without modifying the rest of the code.
 */
These two functions abstract the actual communications with the
debug port.  This is so we can change the underlying communications
mechanism without modifying the rest of the code.
These two functions abstract the actual communications with the debug port . This is so we can change the underlying communications mechanism without modifying the rest of the code .
int
serial_echo_print(const char *s)
{
        int     lsr, ier;
        int     i;
        if (!serial_echo_port)
		return 0;
        ier = serial_echo_inb(UART_IER);
        serial_echo_outb(0x00, UART_IER);
        for (i = 0; *s; i++, s++) {
                WAIT_FOR_XMITR;
                serial_echo_outb(*s, UART_TX);
                if (*s == 10) {
                        WAIT_FOR_XMITR;
                        serial_echo_outb(13, UART_TX);
                }
        }
        do {
                lsr = serial_echo_inb(UART_LSR);
        } while ((lsr & BOTH_EMPTY) != BOTH_EMPTY);
        serial_echo_outb(ier, UART_IER);
        return 0;
}
int serial_echo_print ( const char * s ) { int lsr , ier ; int i ; if ( ! serial_echo_port ) return 0 ; ier = serial_echo_inb ( UART_IER ) ; serial_echo_outb ( 0x00 , UART_IER ) ; for ( i = 0 ; * s ; i ++ , s ++ ) { WAIT_FOR_XMITR ; serial_echo_outb ( * s , UART_TX ) ; if ( * s == 10 ) { WAIT_FOR_XMITR ; serial_echo_outb ( 13 , UART_TX ) ; } } do { lsr = serial_echo_inb ( UART_LSR ) ; } while ( ( lsr & BOTH_EMPTY ) != BOTH_EMPTY ) ; serial_echo_outb ( ier , UART_IER ) ; return 0 ; }
These two functions abstract the actual communications with the
 debug port.
These two functions abstract the actual communications with the debug port .
/*
         * First save the IER then disable the interrupts
         */ /*
         * Now, do each character
         */ /* Send the character out. */ /* if a LF, also do CR... */ /*
         * Finally, Wait for transmitter & holding register to empty
         *  and restore the IER
         */