mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
Tests+Userland: Implement AARCH64 support for some inline assembly blobs
This commit is contained in:
parent
dadf656dc9
commit
808c43312d
Notes:
sideshowbarker
2024-07-17 10:54:57 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/808c43312d Pull-request: https://github.com/SerenityOS/serenity/pull/15558 Reviewed-by: https://github.com/BertalanD Reviewed-by: https://github.com/FireFox317 Reviewed-by: https://github.com/awesomekling ✅ Reviewed-by: https://github.com/linusg
4 changed files with 25 additions and 0 deletions
|
@ -11,9 +11,17 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if ARCH(I386) || ARCH(X86_64)
|
||||
asm("haxcode:\n"
|
||||
"1: jmp 1b\n"
|
||||
"haxcode_end:\n");
|
||||
#elif ARCH(AARCH64)
|
||||
asm("haxcode:\n"
|
||||
"1: b 1b\n"
|
||||
"haxcode_end:\n");
|
||||
#else
|
||||
# error Unknown architecture
|
||||
#endif
|
||||
|
||||
extern "C" void haxcode();
|
||||
extern "C" void haxcode_end();
|
||||
|
|
|
@ -62,9 +62,14 @@ void _entry(int, char**, char**) __attribute__((used));
|
|||
|
||||
NAKED void _start(int, char**, char**)
|
||||
{
|
||||
#ifdef AK_ARCH_AARCH64
|
||||
asm(
|
||||
"bl _entry\n");
|
||||
#else
|
||||
asm(
|
||||
"push $0\n"
|
||||
"jmp _entry@plt\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void _entry(int argc, char** argv, char** envp)
|
||||
|
|
|
@ -17,3 +17,10 @@ _longjmp:
|
|||
longjmp:
|
||||
# FIXME: Possibly incomplete.
|
||||
ret
|
||||
|
||||
.global _sigsetjmp
|
||||
.global sigsetjmp
|
||||
_sigsetjmp:
|
||||
sigsetjmp:
|
||||
# FIXME: Possibly incomplete.
|
||||
ret
|
||||
|
|
|
@ -25,9 +25,14 @@ void _start(int, char**, char**) __attribute__((used));
|
|||
|
||||
NAKED void _start(int, char**, char**)
|
||||
{
|
||||
# ifdef AK_ARCH_AARCH64
|
||||
asm(
|
||||
"bl _entry\n");
|
||||
# else
|
||||
asm(
|
||||
"push $0\n"
|
||||
"jmp _entry@plt\n");
|
||||
# endif
|
||||
}
|
||||
|
||||
int _entry(int argc, char** argv, char** env)
|
||||
|
|
Loading…
Reference in a new issue