<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>kgdb8250 API</title><meta name="generator" content="DocBook XSL Stylesheets V1.72.0" /><link rel="start" href="index.html" title="Using kgdb and the kgdb Internals" /><link rel="up" href="ch06.html" title="Chapter 6. KGDB Internals" /><link rel="prev" href="ch06s02.html" title="kgdboc internals" /><link rel="next" href="re14.html" title="kgdb8250_early_debug_ready" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">kgdb8250 API</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch06s02.html">Prev</a> </td><th width="60%" align="center">Chapter 6. KGDB Internals</th><td width="20%" align="right"> <a accesskey="n" href="re14.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="kgdb8250Internals"></a>kgdb8250 API</h2></div></div></div><div class="toc"><dl><dt><span class="refentrytitle"><a href="re14.html"><span>kgdb8250_early_debug_ready</span></a></span><span class="refpurpose"> — 
  indicates when it safe to issue uart I/O
 </span></dt><dt><span class="refentrytitle"><a href="re15.html"><span>kgdb8250_arch_init</span></a></span><span class="refpurpose"> — 
     active early debugging, if configured
 </span></dt></dl></div><p>
  The kgdb8250 driver essentially hijacks a uart for use with kgdb.
  The aim of the implementation is to provide debugging as early as
  possible after the exception processing and uarts are initialized.
  </p><p>
  On some architectures or specific boards the kgdb8250 driver's
  registration needs to be delayed beyond the kernel argument
  processing time.  With the kgdb8250 driver it is possible to
  override the default implementation so as to provide a hook to delay
  the I/O driver registration for kgdb.
  </p><p>
  The following is and example of code that would go into the
  architecture or board specific implementation to delay the kgdb8250
  final initialization to the correct time.
  </p><pre class="programlisting">
#include &lt;linux/kgdb8250.h&gt;

/* ... other arch or board specific functions ... */

#ifdef CONFIG_KGDB_8250
static int kgdb8250_ready;
int kgdb8250_early_debug_ready(void)
{
	return kgdb8250_ready;
}
#endif

/* This is an example uart init function, the important part is
 * adding in the part inclusive of the #ifdef
 */
void example_uart_init(void)
{

/* ... uart and exceptions are finally setup ... */
#ifdef CONFIG_KGDB_8250
	kgdb8250_ready = 1;
	kgdb8250_arch_init();
#endif

/* Note, that if kgdbwait was specified on the
 * kernel command line the board will stop at this
 * point and wait for the debugger
 */

}
  </pre><p>
  </p><p>
  The API function descriptions follow for kgdb8250_early_debug_ready() and
  kgdb8250_arch_init().
  </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch06s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch06.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="re14.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">kgdboc internals </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span>kgdb8250_early_debug_ready</span></td></tr></table></div></body></html>
