feat(kernel): 🎨 always include the uptime in KPrint output

This commit is contained in:
EnderIce2 2025-05-13 15:54:05 +00:00
parent 6592db3f4e
commit 83a7f83f81
Signed by: enderice2
GPG Key ID: FEB6B8A8507BA62E

View File

@ -76,23 +76,15 @@ EXTERNC void _KPrint(const char *Format, va_list Args)
{
SmartLock(KernelLock);
if (TimeManager)
{
uint64_t Nanoseconds = TimeManager->GetNanosecondsSinceClassCreation();
if (Nanoseconds != 0)
{
uint64_t nano = TimeManager ? TimeManager->GetNanosecondsSinceClassCreation() : 0;
#if defined(__amd64__)
printf("\x1b[1;30m[\x1b[1;34m%lu.%07lu\x1b[1;30m]\x1b[0m ",
Nanoseconds / 10000000, Nanoseconds % 10000000);
printf("\x1b[1;30m[\x1b[1;34m%lu.%07lu\x1b[1;30m]\x1b[0m ", nano / 10000000, nano % 10000000);
#elif defined(__i386__)
printf("\x1b[1;30m[\x1b[1;34m%llu.%07llu\x1b[1;30m]\x1b[0m ",
Nanoseconds / 10000000, Nanoseconds % 10000000);
printf("\x1b[1;30m[\x1b[1;34m%llu.%07llu\x1b[1;30m]\x1b[0m ", nano / 10000000, nano % 10000000);
#elif defined(__aarch64__)
printf("\x1b[1;30m[\x1b[1;34m%lu.%07lu\x1b[1;30m]\x1b[0m ",
Nanoseconds / 10000000, Nanoseconds % 10000000);
printf("\x1b[1;30m[\x1b[1;34m%lu.%07lu\x1b[1;30m]\x1b[0m ", nano / 10000000, nano % 10000000);
#endif
}
}
vprintf(Format, Args);
printf("\x1b[0m\n");