Date: Thu, 19 Jan 2023 10:11:23 -0500 From: Paul Procacci <pprocacci@gmail.com> To: Daniel Cervus <DanieltheDeer@outlook.com> Cc: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: Re: FreeBSD AMD64 kernel calling convention Message-ID: <CAFbbPujGLqqWXHC-LH=QkhEagYV9VEuGo=g%2BVabpsrcd=40w3A@mail.gmail.com> In-Reply-To: <TYWP286MB26677DF496704F87B91B5D19B8C49@TYWP286MB2667.JPNP286.PROD.OUTLOOK.COM> References: <TYWP286MB26677DF496704F87B91B5D19B8C49@TYWP286MB2667.JPNP286.PROD.OUTLOOK.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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 <DanieltheDeer@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
>
--
__________________
:(){ :|:& };:
[-- Attachment #2 --]
<div dir="ltr"><div>It's the same as Linux.<br><br></div><div>rdi, rsi, rdx, r10, r8, r9 in that order. rcx and r11 destroy'd immediately upon syscall invocation.<br></div><div><br></div><div>Thanks,</div><div>Paul Procacci<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 18, 2023 at 11:08 PM Daniel Cervus <<a href="mailto:DanieltheDeer@outlook.com">DanieltheDeer@outlook.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-443616466059086476">
<div style="overflow-wrap: break-word;" lang="ZH-CN">
<div class="m_-7311855333783919003WordSection1">
<p class="MsoNormal"><span lang="EN-US"> </span><span style="font-size:11pt" lang="EN-US">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?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt" lang="EN-US">Daniel<u></u><u></u></span></p>
</div>
</div>
</div></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">__________________<br><br>:(){ :|:& };:</div>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFbbPujGLqqWXHC-LH=QkhEagYV9VEuGo=g%2BVabpsrcd=40w3A>
