4.104.114.84.95
Last change
on this file since 8ac4213 was
702c5f5,
checked in by Joel Sherrill <joel.sherrill@…>, on 10/27/99 at 15:29:18
|
The rxgen960 BSP and i960 RPM support was submitted by Mark Bronson
<mark@…> of RAMIX.
|
-
Property mode set to
100644
|
File size:
1.2 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 | #include <_ansi.h> |
---|
6 | #ifdef _HAVE_STDC |
---|
7 | #include <stdarg.h> |
---|
8 | #else |
---|
9 | #include <varargs.h> |
---|
10 | #endif |
---|
11 | char kkBuf[1024]; |
---|
12 | /* Routine to do "console" in fully polled mode */ |
---|
13 | void static kkputs( const char *); |
---|
14 | format_string(char * fmt, va_list ap, char * kkBuf); |
---|
15 | #ifdef _HAVE_STDC |
---|
16 | void |
---|
17 | kkprintf (const char *fmt, ...) |
---|
18 | { |
---|
19 | va_list ap; |
---|
20 | |
---|
21 | va_start (ap, fmt); |
---|
22 | format_string (fmt, *ap+4, kkBuf); |
---|
23 | kkputs(kkBuf); |
---|
24 | va_end (ap); |
---|
25 | } |
---|
26 | void mkvisable() |
---|
27 | { |
---|
28 | kkputs("Hello"); |
---|
29 | } |
---|
30 | #else |
---|
31 | void |
---|
32 | kkprintf(fmt, va_alist) |
---|
33 | char * fmt; |
---|
34 | va_dcl |
---|
35 | { |
---|
36 | va_list ap; |
---|
37 | va_start(ap); |
---|
38 | format_string(fmt, ap, kkBuf); |
---|
39 | kkputs(kkBuf); |
---|
40 | va_end(ap); |
---|
41 | } |
---|
42 | #endif |
---|
43 | extern int DBGConsole_make_sync; |
---|
44 | void |
---|
45 | kkputs( const char * buf) |
---|
46 | { |
---|
47 | volatile unsigned int * consoleOP; |
---|
48 | unsigned char c; |
---|
49 | consoleOP = (unsigned int *) 0x1318; /* Outbound Message 0 */ |
---|
50 | while (( c = *buf++) != 0){ |
---|
51 | while( DBGConsole_make_sync && (*consoleOP != 0)) |
---|
52 | ; |
---|
53 | *consoleOP = (unsigned int)c; |
---|
54 | } |
---|
55 | } |
---|
56 | |
---|
57 | |
---|
58 | /* we have got an error during build for 'isatty()' wo/ good reason |
---|
59 | we temporarily use this fix.... |
---|
60 | */ |
---|
61 | isatty(int fd) |
---|
62 | { |
---|
63 | return 1; |
---|
64 | } |
---|
65 | |
---|
Note: See
TracBrowser
for help on using the repository browser.