Skip site navigation (1)Skip section navigation (2)
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
--0000000000005ee3c305f29f5943
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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=E2=80=99m 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 paramete=
rs?
>
>
>
> Daniel
>


--=20
__________________

:(){ :|:& };:

--0000000000005ee3c305f29f5943
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>It&#39;s the same as Linux.<br><br></div><div>rdi, rs=
i, rdx, r10, r8, r9=C2=A0 in that order.=C2=A0 rcx and r11 destroy&#39;d im=
mediately upon syscall invocation.<br></div><div><br></div><div>Thanks,</di=
v><div>Paul Procacci<br></div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Wed, Jan 18, 2023 at 11:08 PM Daniel Cervu=
s &lt;<a href=3D"mailto:DanieltheDeer@outlook.com">DanieltheDeer@outlook.co=
m</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
><div class=3D"msg-443616466059086476">





<div style=3D"overflow-wrap: break-word;" lang=3D"ZH-CN">
<div class=3D"m_-7311855333783919003WordSection1">
<p class=3D"MsoNormal"><span lang=3D"EN-US">=C2=A0 </span><span style=3D"fo=
nt-size:11pt" lang=3D"EN-US">Hi, everyone. I=E2=80=99m learning AMD64 assem=
bly 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 con=
vention, uses R10 instead of RCX to pass parameters?<u></u><u></u></span></=
p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt" lang=3D"EN-US"><u></u=
>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11pt" lang=3D"EN-US">Daniel=
<u></u><u></u></span></p>
</div>
</div>

</div></blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" clas=
s=3D"gmail_signature">__________________<br><br>:(){ :|:&amp; };:</div>

--0000000000005ee3c305f29f5943--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFbbPujGLqqWXHC-LH=QkhEagYV9VEuGo=g%2BVabpsrcd=40w3A>