source: rtems/c/src/lib/libbsp/i960/rxgen960/startup/kkprintf.c @ c8f3e82

Last change on this file since c8f3e82 was 80e24f1f, checked in by Joel Sherrill <joel.sherrill@…>, on 06/15/00 at 22:22:00

rxgen960 compiles and links.

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/*
2 *  a safe version of printf that might be useful for debugging parts that
3 *  are known to have problems e.g. with printf() e.t.c.
4 *
5 *  $Id$
6 */
7
8#include <_ansi.h>
9#ifdef _HAVE_STDC
10#include <stdarg.h>
11#else
12#include <varargs.h>
13#endif
14char   kkBuf[1024];
15/* Routine to do "console" in fully polled mode */
16void static kkputs( const char *);
17format_string(char * fmt, va_list ap, char * kkBuf);
18#ifdef _HAVE_STDC
19void
20kkprintf (const char *fmt, ...)
21{
22  va_list ap;
23
24  va_start (ap, fmt);
25  format_string (fmt, *ap+4, kkBuf);
26  kkputs(kkBuf);
27  va_end (ap);
28}
29void mkvisable()
30{
31 kkputs("Hello");
32}
33#else
34void
35kkprintf(fmt, va_alist)
36char * fmt;
37va_dcl
38{
39        va_list ap;
40        va_start(ap);
41        format_string(fmt, ap, kkBuf);
42        kkputs(kkBuf);
43        va_end(ap);
44}
45#endif
46extern int DBGConsole_make_sync;
47void
48kkputs( const char * buf)
49{
50        volatile unsigned int * consoleOP;
51        unsigned char c;
52        consoleOP = (unsigned int *) 0x1318;    /* Outbound Message 0 */
53        while (( c = *buf++) != 0){
54                while( DBGConsole_make_sync && (*consoleOP != 0))
55                        ;
56                *consoleOP = (unsigned int)c;
57        }
58}
Note: See TracBrowser for help on using the repository browser.