OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [i960/] [rxgen960/] [startup/] [kkprintf.c] - Blame information for rev 30

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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: kkprintf.c,v 1.2 2001-09-27 11:59:59 chris Exp $
6
 */
7
 
8
#include <_ansi.h>
9
#ifdef _HAVE_STDC
10
#include <stdarg.h>
11
#else
12
#include <varargs.h>
13
#endif
14
char   kkBuf[1024];
15
/* Routine to do "console" in fully polled mode */
16
void static kkputs( const char *);
17
format_string(char * fmt, va_list ap, char * kkBuf);
18
#ifdef _HAVE_STDC
19
void
20
kkprintf (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
}
29
void mkvisable()
30
{
31
 kkputs("Hello");
32
}
33
#else
34
void
35
kkprintf(fmt, va_alist)
36
char * fmt;
37
va_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
46
extern int DBGConsole_make_sync;
47
void
48
kkputs( 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
}
59
 
60
 
61
/* we have got an error during build for 'isatty()' wo/ good reason
62
   we temporarily use this fix....
63
*/
64
isatty(int fd)
65
{
66
        return 1;
67
}
68
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.