From 54b308af97b91ceabb0a482f325d3a8595b01aa3 Mon Sep 17 00:00:00 2001 From: turret Date: Mon, 18 Dec 2023 16:13:36 -0600 Subject: *: enforce 78 char line limit --- init/log.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'init/log.c') diff --git a/init/log.c b/init/log.c index aba141d..75840a2 100644 --- a/init/log.c +++ b/init/log.c @@ -8,7 +8,6 @@ #include #include #include - #include #include @@ -72,7 +71,8 @@ static int vaprint(const char *fmt, va_list ap) char tsbuf[64] = "\0"; struct timeval time; gettimeofday(&time, NULL); - snprintf(tsbuf, sizeof(tsbuf), "[%5ld.%06ld] ", (long)time.tv_sec % 100000, (long)time.tv_usec); + snprintf(tsbuf, sizeof(tsbuf), "[%5ld.%06ld] ", + (long)time.tv_sec % 100000, (long)time.tv_usec); /* spin lock, at the cost of architecture portability concurrency is something that we need to adjust for, and the @@ -112,7 +112,9 @@ static int vaprint(const char *fmt, va_list ap) return 0; } -void _panic(const char *fileorigin, const int lineorigin, const char *fmt, ...) +void _panic(const char *fileorigin, + const int lineorigin, + const char *fmt, ...) { char mode = PANICMODE_DIE; int pid = getpid(); @@ -132,7 +134,8 @@ void _panic(const char *fileorigin, const int lineorigin, const char *fmt, ...) void **backtrace_addresses = malloc(sizeof(void*) * 32); int backtrace_count = backtrace(backtrace_addresses, 32); - char **backtrace_symbolnames = backtrace_symbols(backtrace_addresses, backtrace_count); + char **backtrace_symbolnames = + backtrace_symbols(backtrace_addresses, backtrace_count); __asm__("_panic.spin_lock:"); __asm__("mov rax, 1"); @@ -141,16 +144,19 @@ void _panic(const char *fileorigin, const int lineorigin, const char *fmt, ...) __asm__("jnz .spin_lock"); print(NOLOCK("5") "------------[ cut here ]------------"); - print(LOG_SOH "\7""0" "%s at %s:%d", mode_to_string[(int)mode], fileorigin, lineorigin); + print(LOG_SOH "\7""0" "%s at %s:%d", mode_to_string[(int)mode], + fileorigin, lineorigin); vaprint(_fmt, ap); print(LOG_SOH "\7""7" "Call Trace:"); for(int i = 0; i < backtrace_count; ++i) { - print(NOLOCK("7") " [0x%016x] %s", backtrace_addresses[i], backtrace_symbolnames[i]); + print(NOLOCK("7") " [0x%016x] %s", backtrace_addresses[i], + backtrace_symbolnames[i]); } if(mainpid == pid){ print(NOLOCK("7") " "); } else { - print(NOLOCK("7") " ", subsystem_get_name(pid), pid); + print(NOLOCK("7") " ", + subsystem_get_name(pid), pid); } /* if we are going to die, we dont really need to clean up */ -- cgit v1.2.3