-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add partial aarch64 support to libuser #566
Open
leo60228
wants to merge
10
commits into
sunriseos:master
Choose a base branch
from
leo60228:aarch64
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ee7b8a7
Convert syscall() to macro
leo60228 6391063
#[cfg] x86-only code
leo60228 471dfce
Add aarch64 target JSON
leo60228 11698f9
Use x86 get_my_tls_region on x86_64 to fix docs
leo60228 253cacd
Use non-arch-specific register names
leo60228 3a4de25
Add aarch64 syscall stub
leo60228 f57980e
Handle shifted arguments on x86
leo60228 b97f8a9
Address review
leo60228 eb2d5c8
Add note about aarch64 threads
leo60228 708cb35
Revert "Use non-arch-specific register names"
leo60228 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@roblabla , I need your confirmation on this, but IIRC the sole reason we use a global asm for the syscall is because we need to pass
ebp
as our sixth argument, but trying to backup+set/restore it in an inline asm block was unfeasible, because Rust needs this register to exit the inline asm block and restore regular context (or something like that).This struct is only used as an argument to the global asm
syscall_iner
. This is pretty inefficient, since to do a syscall you must:syscall
. (this is standard i386 ABI)syscall
copies those arguments to fill a newRegister
structure, and callssyscall_inner
syscall_inner
consumes this struct, and puts every field in a register.int 0x80
syscall_inner
saves the return registers state to theRegister
structure, and returns.On aarch64, where we have plenty of registers, this whole dance seems unnecessary, and I'd like to see the
syscall
function simply be a wrapper around a single inline asm instruction, that define its input/output registers properly (e.g.nr
->r0
) and let llvm do all the copying for us.In this context, the
Register
struct is very i386 specific, and doesn't need to be made generic.I'd like to hear roblabla's opinion this, but if he agrees with me I'd recommend dropping this commit entirely