Sleep before checking again if the thread is critical

This commit is contained in:
Alex 2023-03-20 01:54:33 +02:00
parent f1c703452d
commit 9242471469
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -308,9 +308,10 @@ bool ELFDynamicReallocation(void *ElfFile, void *MemoryImage)
int ld_main() int ld_main()
{ {
/* Prevent race condition. */ /* Prevent race condition. */
uintptr_t KCTL_ret = 0xdead; uintptr_t KCTL_ret = KernelCTL(KCTL_IS_CRITICAL, 0, 0, 0, 0);
do do
{ {
syscall1(_Sleep, 250);
KCTL_ret = KernelCTL(KCTL_IS_CRITICAL, 0, 0, 0, 0); KCTL_ret = KernelCTL(KCTL_IS_CRITICAL, 0, 0, 0, 0);
} while (KCTL_ret == SYSCALL_ACCESS_DENIED); } while (KCTL_ret == SYSCALL_ACCESS_DENIED);
@ -319,20 +320,14 @@ int ld_main()
/* --------------------------------------------------- */ /* --------------------------------------------------- */
__asm__ __volatile__("syscall" syscall2(_Print, 'H', 0);
:
: "a"(1), "D"('H'), "S"(0)
: "rcx", "r11", "memory");
return 0; return 0;
} }
/* Actual load */ /* Actual load */
int ld_load(int argc, char *argv[], char *envp[]) int ld_load(int argc, char *argv[], char *envp[])
{ {
__asm__ __volatile__("syscall" syscall2(_Print, 'L', 0);
:
: "a"(1), "D"('L'), "S"(0)
: "rcx", "r11", "memory");
void *IPCBuffer = (void *)RequestPages(1); void *IPCBuffer = (void *)RequestPages(1);