Feat: lab 3 w/o adv 2

This commit is contained in:
2025-03-26 15:30:57 +08:00
parent 98327b148a
commit e2ebb6cc34
25 changed files with 618 additions and 113 deletions

View File

@@ -34,6 +34,13 @@ static inline char *_logger_pointer(char *dest, void *x)
return _logger_hex(dest, (uint64_t)x);
}
static inline
void _uart_puts_sync(const char *s)
{
while (*s != '\0')
uart_putb_sync((const uint8_t *)s++, 1);
}
#define _I_HATE_C_LANG(msg) \
logger_cur = _Generic((msg), \
char * : _do_nothing, \
@@ -54,9 +61,9 @@ logger_cur = _Generic((msg), \
}
#define FLUSH(prefix) { \
uart_puts(prefix); \
uart_puts(logger_buf); \
uart_puts(ENDL); \
_uart_puts_sync(prefix); \
_uart_puts_sync(logger_buf); \
_uart_puts_sync(ENDL); \
logger_cur = logger_buf; \
}