Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | #include |
2 | #include |
||
3 | #include |
||
4 | #include |
||
5 | |||
6 | static inline int vdprintf_help(char c) |
||
7 | { |
||
8 | int d0; |
||
9 | if(c=='\n') |
||
10 | { |
||
11 | c='\r'; |
||
12 | __asm__ __volatile__("int $0x40":"=&a"(d0):"0"(63),"b"(1),"c"(c)); |
||
13 | c='\n'; |
||
14 | __asm__ __volatile__("int $0x40":"=&a"(d0):"0"(63),"b"(1),"c"(c)); |
||
15 | return 0; |
||
16 | } |
||
17 | __asm__ __volatile__("int $0x40":"=&a"(d0):"0"(63),"b"(1),"c"(c)); |
||
18 | return 0 ; |
||
19 | } |
||
20 | |||
21 | static char log_buf[1024]; |
||
22 | |||
23 | static char xputs(char * s) |
||
24 | { |
||
25 | for(;*s;s++) vdprintf_help(*s); |
||
26 | } |
||
27 | |||
28 | int __libclog_vprintf(const char *fmt, va_list args) |
||
29 | { |
||
30 | int ret_val; |
||
31 | ret_val = vsprintf(log_buf,fmt,args); |
||
32 | xputs(log_buf); |
||
33 | __menuet__delay100(1); |
||
34 | return ret_val; |
||
35 | } |
||
36 | |||
37 | int __libclog_printf(const char * fmt,...) |
||
38 | { |
||
39 | int v; |
||
40 | va_list ap; |
||
41 | va_start(ap,fmt); |
||
42 | v=__libclog_vprintf(fmt,ap); |
||
43 | __menuet__delay100(1); |
||
44 | return v; |
||
45 | } |