1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

AK+Userland: Stub out code that isn't currently implemented on AARCH64

Even though this almost certainly wouldn't run properly even if we had
a working kernel for AARCH64 this at least lets us build all the
userland binaries.
This commit is contained in:
Gunnar Beutner 2022-10-12 21:55:05 +02:00 committed by Linus Groh
parent c18c84dbfd
commit 31bd5b1a02
17 changed files with 206 additions and 6 deletions

View file

@ -200,7 +200,14 @@ int main(int argc, char** argv)
return Crash::Failure::UnexpectedError;
u8* makeshift_esp = makeshift_stack + 2048;
#if ARCH(I386) || ARCH(X86_64)
asm volatile("mov %%eax, %%esp" ::"a"(makeshift_esp));
#elif ARCH(AARCH64)
(void)makeshift_esp;
TODO_AARCH64();
#else
# error Unknown architecture
#endif
getuid();
dbgln("Survived syscall with MAP_STACK stack");
@ -209,7 +216,14 @@ int main(int argc, char** argv)
return Crash::Failure::UnexpectedError;
u8* bad_esp = bad_stack + 2048;
#if ARCH(I386) || ARCH(X86_64)
asm volatile("mov %%eax, %%esp" ::"a"(bad_esp));
#elif ARCH(AARCH64)
(void)bad_esp;
TODO_AARCH64();
#else
# error Unknown architecture
#endif
getuid();
return Crash::Failure::DidNotCrash;
}).run(run_type);
@ -228,6 +242,9 @@ int main(int argc, char** argv)
#elif ARCH(X86_64)
asm volatile("movq %%rax, %%rsp" ::"a"(bad_esp));
asm volatile("pushq $0");
#elif ARCH(AARCH64)
(void)bad_esp;
TODO_AARCH64();
#else
# error Unknown architecture
#endif
@ -267,7 +284,13 @@ int main(int argc, char** argv)
if (do_trigger_user_mode_instruction_prevention) {
any_failures |= !Crash("Trigger x86 User Mode Instruction Prevention", []() {
#if ARCH(I386) || ARCH(X86_64)
asm volatile("str %eax");
#elif ARCH(AARCH64)
TODO_AARCH64();
#else
# error Unknown architecture
#endif
return Crash::Failure::DidNotCrash;
}).run(run_type);
}