Rev 6399 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6391 | ashmew2 | 1 | #ifndef KOLIBRI_DEBUG_H |
2 | #define KOLIBRI_DEBUG_H |
||
3 | |||
6398 | punk_joker | 4 | #include <_ansi.h> |
5 | #include |
||
6 | #include |
||
7 | #include |
||
8 | |||
6395 | siemargl | 9 | /* Write a printf() like function (variable argument list) for |
6391 | ashmew2 | 10 | writing to debug board */ |
11 | |||
12 | inline void debug_board_write_byte(const char ch){ |
||
13 | __asm__ __volatile__( |
||
14 | "int $0x40" |
||
15 | : |
||
16 | :"a"(63), "b"(1), "c"(ch)); |
||
17 | } |
||
6395 | siemargl | 18 | |
19 | //added noninline because incofortabre stepping in in debugger |
||
20 | void __attribute__ ((noinline)) debug_board_write_str(const char* str){ |
||
6391 | ashmew2 | 21 | while(*str) |
22 | debug_board_write_byte(*str++); |
||
23 | } |
||
24 | |||
6399 | punk_joker | 25 | void debug_board_printf(const char *format,...) |
6398 | punk_joker | 26 | { |
27 | va_list ap; |
||
28 | char log_board[300]; |
||
29 | |||
30 | va_start (ap, format); |
||
31 | vsprintf(log_board, format, ap); |
||
32 | va_end(ap); |
||
33 | debug_board_write_str(log_board); |
||
34 | } |
||
6391 | ashmew2 | 35 | |
36 | #endif /* KOLIBRI_DEBUG_H */ |