FreeBSD AMD64 kernel calling convention

4 views
Skip to first unread message

Daniel Cervus

unread,
Jan 18, 2023, 11:08:22 PM1/18/23
to freebsd-...@freebsd.org

  Hi, everyone. I’m learning AMD64 assembly language. But seems I cannot find much information about FreeBSD kernel interface, does it follows the same calling convention as described in System V AMD64 ABI? Or it is like Linux kernel calling convention, uses R10 instead of RCX to pass parameters?

 

Daniel

Paul Procacci

unread,
Jan 19, 2023, 10:11:55 AM1/19/23
to Daniel Cervus, freebsd-...@freebsd.org
It's the same as Linux.

rdi, rsi, rdx, r10, r8, r9  in that order.  rcx and r11 destroy'd immediately upon syscall invocation.

Thanks,
Paul Procacci

On Wed, Jan 18, 2023 at 11:08 PM Daniel Cervus <Daniel...@outlook.com> wrote:

  Hi, everyone. I’m learning AMD64 assembly language. But seems I cannot find much information about FreeBSD kernel interface, does it follows the same calling convention as described in System V AMD64 ABI? Or it is like Linux kernel calling convention, uses R10 instead of RCX to pass parameters?

 

Daniel



--
__________________

:(){ :|:& };:
Reply all
Reply to author
Forward
0 new messages