1 #ifndef LIB_SYS_VESA_DEBUG_H 2 #define LIB_SYS_VESA_DEBUG_H 3 4 #if 0 5 6 #include <stdio.h> 7 #include <unistd.h> 8 9 ssize_t __serial_write(void *fp, const void *buf, size_t count); 10 11 static void debug(const char *str, ...) 12 { 13 va_list va; 14 char buf[65536]; 15 size_t len; 16 17 va_start(va, str); 18 len = vsnprintf(buf, sizeof buf, str, va); 19 va_end(va); 20 21 if (len >= sizeof buf) 22 len = sizeof buf - 1; 23 24 __serial_write(NULL, buf, len); 25 } 26 27 #else 28 29 static inline void debug(const char *str, ...) 30 { 31 (void)str; 32 } 33 34 #endif 35 36 #endif /* LIB_SYS_VESA_DEBUG_H */ 37