chore: Update makefiles & macros

This commit is contained in:
EnderIce2
2024-11-29 04:24:27 +02:00
parent ce3cf8162a
commit 7948d0c6e5
116 changed files with 682 additions and 740 deletions

View File

@ -28,23 +28,23 @@
/* static assert, no constructor needed */
#ifdef a64
#ifdef __amd64__
#if UINTPTR_MAX != UINT64_MAX
#error "uintptr_t is not 64-bit!"
#endif // UINTPTR_MAX != UINT64_MAX
#endif // a64
#endif // __amd64__
#ifdef a32
#ifdef __i386__
#if UINTPTR_MAX != UINT32_MAX
#error "uintptr_t is not 32-bit!"
#endif // UINTPTR_MAX != UINT32_MAX
#endif // a32
#endif // __i386__
#ifdef aa64
#ifdef __aarch64__
#if UINTPTR_MAX != UINT64_MAX
#error "uintptr_t is not 64-bit!"
#endif // UINTPTR_MAX != UINT64_MAX
#endif // aa64
#endif // __aarch64__
#ifndef __fennix__
#error "This compiler is not supported!"

View File

@ -126,7 +126,7 @@ extern bool DebuggerIsAttached;
void TestMemoryAllocation()
{
return; /* Bit annoying to have to wait for this to finish */
#ifdef a32
#ifdef __i386__
return; /* Not ready for now. */
#endif
if (DebuggerIsAttached)

View File

@ -38,7 +38,7 @@ __constructor void TestRandom()
if (strcmp(CPU::Hypervisor(), x86_CPUID_VENDOR_TCG) == 0)
RDRANDFlag = 0;
#if defined(a86)
#if defined(__amd64__) || defined(__i386__)
if (RDRANDFlag)
{
uintptr_t RDSEEDValue = 0;

View File

@ -137,15 +137,15 @@ void TaskMgr()
continue;
int State = Proc->State.load();
uint64_t ProcessCpuUsage = GetUsage(OldSystemTime, &Proc->Info);
#if defined(a64)
#if defined(__amd64__)
printf("\e%s-> \eAABBCC%s \e00AAAA%s %ld%% (KT: %ld UT: %ld)\n",
Statuses[State], Proc->Name, StatusesSign[State],
ProcessCpuUsage, Proc->Info.KernelTime, Proc->Info.UserTime);
#elif defined(a32)
#elif defined(__i386__)
printf("\e%s-> \eAABBCC%s \e00AAAA%s %lld%% (KT: %lld UT: %lld)\n",
Statuses[State], Proc->Name, StatusesSign[State],
ProcessCpuUsage, Proc->Info.KernelTime, Proc->Info.UserTime);
#elif defined(aa64)
#elif defined(__aarch64__)
#endif
foreach (auto Thd in Proc->Threads)
@ -154,26 +154,26 @@ void TaskMgr()
continue;
State = Thd->State.load();
uint64_t ThreadCpuUsage = GetUsage(OldSystemTime, &Thd->Info);
#if defined(a64)
#if defined(__amd64__)
printf(" \e%s-> \eAABBCC%s \e00AAAA%s %ld%% (KT: %ld UT: %ld, IP: \e24FF2B%#lx \eEDFF24%s\e00AAAA)\n\eAABBCC",
Statuses[State], Thd->Name, StatusesSign[State], ThreadCpuUsage, Thd->Info.KernelTime,
Thd->Info.UserTime, Thd->Registers.rip, "unknown");
#elif defined(a32)
#elif defined(__i386__)
printf(" \e%s-> \eAABBCC%s \e00AAAA%s %lld%% (KT: %lld UT: %lld, IP: \e24FF2B%#x \eEDFF24%s\e00AAAA)\n\eAABBCC",
Statuses[State], Thd->Name, StatusesSign[State], ThreadCpuUsage, Thd->Info.KernelTime,
Thd->Info.UserTime, Thd->Registers.eip, "unknown");
#elif defined(aa64)
#elif defined(__aarch64__)
#endif
}
}
OldSystemTime = TimeManager->GetCounter();
#if defined(a64)
#if defined(__amd64__)
register uintptr_t CurrentStackAddress asm("rsp");
printf("Sanity: %d, Stack: %#lx", sanity++, CurrentStackAddress);
#elif defined(a32)
#elif defined(__i386__)
register uintptr_t CurrentStackAddress asm("esp");
printf("Sanity: %d, Stack: %#x", sanity++, CurrentStackAddress);
#elif defined(aa64)
#elif defined(__aarch64__)
register uintptr_t CurrentStackAddress asm("sp");
printf("Sanity: %d, Stack: %#lx", sanity++, CurrentStackAddress);
#endif