From d592abd8ccc4026c51e196777031eb65c4acc4de Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 7 Jul 2024 14:34:39 +0300 Subject: misc fixes + Align kernel to 2MiB boundary in u-boot + Optimize alignment functions a little bit, should still have to check on real hardware but 'feels' more clean + Add early boot debugging + Put extra cores we aren't ready to account for to sleep if/when they boot. + Make BASE_PAGE_SIZE constant on riscv64/32, helps the compiler with some alignment checks among other things. --- src/debug.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/debug.c') diff --git a/src/debug.c b/src/debug.c index 15640b4..9573bbc 100644 --- a/src/debug.c +++ b/src/debug.c @@ -364,6 +364,12 @@ static size_t __integral_val(ssize_t value, size_t base, size_t flags, return ret + 1; } +/** + * Print out a string. + * + * @param s String to print out. + * @return Bytes printed. + */ static size_t __puts(const char *s) { size_t i = 0; @@ -747,10 +753,7 @@ void dbg(const char *fmt, ...) if (is_set(flags, PRECS_FLAG)) i = precision; - for (; *s && i--;) { - __putchar(*s++); - chars_written++; - } + chars_written += __puts(s); fmt++; break; -- cgit v1.3