-
Notifications
You must be signed in to change notification settings - Fork 18
Add aarch64 support #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Nice! That works on termux aarch64, except their gcc reports an error for #ifndef __ANDROID__
(void) fd;
#endif I really don't know arm, but this (https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#611general-purpose-registers) document on aarch64 suggests that:
And for SIMD/floating-point:
And if I read and understood the code correctly, you are saving r19-r30, but what about v8-v15? |
Thank you for pointing it out. They are now being saved.
in coroutine_restore_context also have the same guard? I also added the inline assembly to move fd to the correct registers in sleep_write and sleep_read as I forgot to add those in my initial commit 🥲. |
yes, all of the cases with |
|
||
|
||
|
||
*(--rsp) = 0; // push r29 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you also need to reserve space for r30 here, since the load will read both r29 and r30?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you also need to reserve space for r30 here, since the load will read both r29 and r30?
r30 is the same as the link register so the line
*(--rsp) = coroutine__finish_current;
will already reserve space for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, yeah, we don't need to preserve it's value, so we can just read some garbage into it, instead of the previous value. Now but what about storing to the stack, wouldn't it override *(--rsp) = f; // push r0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if I am following you. So far everything runs perfectly fine on the raspberry pi 4 model B.
No description provided.