Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Michael Pruznick <michael_pruznick@mvista.com>
To: Justin Carlson <justinca@cs.cmu.edu>
Cc: "Avinash S." <avinash.s@inspiretech.com>,
	linux <linux-mips@linux-mips.org>
Subject: Re: printk problems
Date: Tue, 08 Apr 2003 12:24:45 -0600	[thread overview]
Message-ID: <3E9313ED.53DCC96E@mvista.com> (raw)
In-Reply-To: 1049816267.17005.25.camel@gs256.sp.cs.cmu.edu


> Until this point, printk() calls are buffered in memory. 

This is what I like to use to bypass the buffering for
non-standard serial hardware.  

The raw_output() function needs to be specific to
your serial driver.  The one below is just an example
from a board I'm currently working on (that is not in
the linux-mips tree yet).  Basically, raw_output() needs
to put the char in the serial hardware output register
and then wait for the serial hardware to indicate that
it put the char on the wire to prevent over-run.


Changes to kernel/printk.c
#define RAW_OUTPUT
static void emit_log_char(char c)
{
#ifdef RAW_OUTPUT
        void raw_output(char c);
        raw_output(c);
#else
        LOG_BUF(log_end) = c;
        log_end++;
        if (log_end - log_start > LOG_BUF_LEN)
                log_start = log_end - LOG_BUF_LEN;
        if (log_end - con_start > LOG_BUF_LEN)
                con_start = log_end - LOG_BUF_LEN;
        if (logged_chars < LOG_BUF_LEN)
                logged_chars++;
#endif
}


What I added to my serial driver.  You will need to
do the similar for your specific serial hardware.
#ifdef RAW_OUTPUT
void raw_output(char c)
{
        struct rs_port *port = &rs_ports[0];
        if ( c == '\n' )
        {
          sio_out(port, TXX9_SITFIFO, '\r');
          wait_for_xmitr(port);
        }
        sio_out(port, TXX9_SITFIFO, c);
        wait_for_xmitr(port);
        return;
}
#endif


-- 
Michael Pruznick, michael_pruznick@mvista.com, www.mvista.com
MontaVista Software, 1237 East Arques Ave, Sunnyvale, CA 94085

  reply	other threads:[~2003-04-08 18:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-08 11:57 printk problems Avinash S.
2003-04-08 15:37 ` Justin Carlson
2003-04-08 18:24   ` Michael Pruznick [this message]
2003-04-08 17:07 ` Jun Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E9313ED.53DCC96E@mvista.com \
    --to=michael_pruznick@mvista.com \
    --cc=avinash.s@inspiretech.com \
    --cc=justinca@cs.cmu.edu \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox