Update kernel

This commit is contained in:
EnderIce2
2024-01-19 06:47:42 +02:00
parent fd15592608
commit 96daa43d38
282 changed files with 25486 additions and 15700 deletions

View File

@ -30,84 +30,84 @@ UART com2(COM2);
static inline SafeFunction NIF void profiler_uart_wrapper(char c, void *unused)
{
bool renable = EnableProfiler;
EnableProfiler = false;
com2.Write(c);
UNUSED(unused);
if (renable)
EnableProfiler = true;
bool renable = EnableProfiler;
EnableProfiler = false;
com2.Write(c);
UNUSED(unused);
if (renable)
EnableProfiler = true;
}
EXTERNC SafeFunction NIF void __cyg_profile_func_enter(void *Function, void *CallSite)
{
if (!EnableProfiler)
return;
if (!EnableProfiler)
return;
while (Wait)
while (Wait)
#if defined(a86)
asmv("pause");
asmv("pause");
#elif defined(aa64)
asmv("yield");
asmv("yield");
#endif
Wait = true;
Wait = true;
if (Level > 40)
Level--;
if (Level > 40)
Level--;
Level++;
Level++;
if (!KernelSymbolTable)
fctprintf(profiler_uart_wrapper, nullptr, "%lld [%02d]: \033[42m->\033[0m%*c \033[33m%p\033[0m - \033[33m%p\033[0m\n",
LogDepth++,
Level - 1,
Level,
' ',
Function,
CallSite);
else
fctprintf(profiler_uart_wrapper, nullptr, "%lld [%02d]: \033[42m->\033[0m%*c \033[33m%s\033[0m - \033[33m%s\033[0m\n",
LogDepth++,
Level - 1,
Level,
' ',
KernelSymbolTable->GetSymbolFromAddress((uintptr_t)Function),
KernelSymbolTable->GetSymbolFromAddress((uintptr_t)CallSite));
Wait = false;
if (!KernelSymbolTable)
fctprintf(profiler_uart_wrapper, nullptr, "%lld [%02d]: \033[42m->\033[0m%*c \033[33m%p\033[0m - \033[33m%p\033[0m\n",
LogDepth++,
Level - 1,
Level,
' ',
Function,
CallSite);
else
fctprintf(profiler_uart_wrapper, nullptr, "%lld [%02d]: \033[42m->\033[0m%*c \033[33m%s\033[0m - \033[33m%s\033[0m\n",
LogDepth++,
Level - 1,
Level,
' ',
KernelSymbolTable->GetSymbol((uintptr_t)Function),
KernelSymbolTable->GetSymbol((uintptr_t)CallSite));
Wait = false;
}
EXTERNC SafeFunction NIF void __cyg_profile_func_exit(void *Function, void *CallSite)
{
if (!EnableProfiler)
return;
if (!EnableProfiler)
return;
while (Wait)
while (Wait)
#if defined(a86)
asmv("pause");
asmv("pause");
#elif defined(aa64)
asmv("yield");
asmv("yield");
#endif
Wait = true;
Wait = true;
if (Level > 40)
Level--;
if (Level > 40)
Level--;
Level--;
Level--;
if (!KernelSymbolTable)
fctprintf(profiler_uart_wrapper, nullptr, "%lld [%02d]: \033[41m<-\033[0m%*c \033[33m%p\033[0m - \033[33m%p\033[0m\n",
LogDepth++,
Level - 1,
Level,
' ',
Function,
CallSite);
else
fctprintf(profiler_uart_wrapper, nullptr, "%lld [%02d]: \033[41m<-\033[0m%*c \033[33m%s\033[0m - \033[33m%s\033[0m\n",
LogDepth++,
Level - 1,
Level,
' ',
KernelSymbolTable->GetSymbolFromAddress((uintptr_t)Function),
KernelSymbolTable->GetSymbolFromAddress((uintptr_t)CallSite));
Wait = false;
if (!KernelSymbolTable)
fctprintf(profiler_uart_wrapper, nullptr, "%lld [%02d]: \033[41m<-\033[0m%*c \033[33m%p\033[0m - \033[33m%p\033[0m\n",
LogDepth++,
Level - 1,
Level,
' ',
Function,
CallSite);
else
fctprintf(profiler_uart_wrapper, nullptr, "%lld [%02d]: \033[41m<-\033[0m%*c \033[33m%s\033[0m - \033[33m%s\033[0m\n",
LogDepth++,
Level - 1,
Level,
' ',
KernelSymbolTable->GetSymbol((uintptr_t)Function),
KernelSymbolTable->GetSymbol((uintptr_t)CallSite));
Wait = false;
}