Skip to content
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

Variable passing #1

Open
IanSeyler opened this issue Sep 30, 2014 · 0 comments
Open

Variable passing #1

IanSeyler opened this issue Sep 30, 2014 · 0 comments

Comments

@IanSeyler
Copy link
Member

The kernel uses a non-standard way of passing variables to internal functions. The AMD64 ABI should be investigated to see if it is a good fit.

From the AMD64 ABI:
Passing Once arguments are classified, the registers get assigned (in left-to-right order) for passing as follows:

  1. If the class is MEMORY, pass the argument on the stack.
  2. If the class is INTEGER, the next available register of the sequence %rdi,
    %rsi, %rdx, %rcx, %r8 and %r9 is used.
  3. If the class is SSE, the next available vector register is used, the registers
    are taken in the order from %xmm0 to %xmm7.

Return values are passed as %rax, %rdx

Linux system call table

@IanSeyler IanSeyler changed the title x86-64 variable passing Variable passing Dec 4, 2015
@IanSeyler IanSeyler removed the x86-64 label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant