From: Bagas Sanjaya <bagasdotme@gmail.com>
To: WANG Xuerui <kernel@xen0n.name>
Cc: linux-doc@vger.kernel.org, WANG Xuerui <git@xen0n.name>,
Huacai Chen <chenhuacai@kernel.org>, Alex Shi <alexs@kernel.org>,
Yanteng Si <siyanteng@loongson.cn>,
Jonathan Corbet <corbet@lwn.net>,
loongarch@lists.linux.dev
Subject: Re: [PATCH 1/2] Documentation: LoongArch: Document the syscall ABI
Date: Wed, 19 Oct 2022 11:13:13 +0700 [thread overview]
Message-ID: <Y095WSk6brB2li/O@debian.me> (raw)
In-Reply-To: <20221018100457.3440691-2-kernel@xen0n.name>
[-- Attachment #1: Type: text/plain, Size: 4717 bytes --]
On Tue, Oct 18, 2022 at 06:04:56PM +0800, WANG Xuerui wrote:
> From: WANG Xuerui <git@xen0n.name>
>
What description?
> diff --git a/Documentation/loongarch/syscall-abi.rst b/Documentation/loongarch/syscall-abi.rst
> new file mode 100644
> index 000000000000..6f63aa3cfc64
> --- /dev/null
> +++ b/Documentation/loongarch/syscall-abi.rst
> @@ -0,0 +1,36 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +===============================
> +Linux/LoongArch system call ABI
> +===============================
> +
> +This document describes the system call ABI of Linux/LoongArch.
> +As the kernel is 64-bit only for now, the description below assumes an LP64\*
> +calling convention.
> +
> +Syscall numbers and parameters
> +==============================
> +
> +Like with other recent architecture ports, for the most part Linux/LoongArch
> +reuses the asm-generic syscall numbers and parameters.
> +There are a few points worth mentioning though.
> +
> +* There is no ``renameat``. Use ``renameat2`` instead.
> +* There is no ``getrlimit`` or ``setrlimit``. Use ``prlimit64`` instead.
> +* There is no ``fstat`` or ``newfstatat``. Only ``statx`` is provided, and
> + low-level components making their own syscalls are expected to be aware of
> + this (and provide their own shims if necessary).
> +
> +Invocation
> +==========
> +
> +System calls are currently made with the ``syscall 0`` instruction.
> +Although the immediate field in the instruction is not checked at present,
> +it is strongly advised to keep it zeroed in case it is to be made meaningful
> +in the future.
> +
> +The system call number is placed in the register ``a7``.
> +Parameters, if present, are placed from ``a0`` through ``a6`` as needed,
> +as if calling a function with the respective arguments.
> +Upon return, ``a0`` contains the return value, and ``t0-t8`` should be
> +considered clobbered; all other registers are preserved.
The wording can be improved:
---- >8 ----
diff --git a/Documentation/loongarch/syscall-abi.rst b/Documentation/loongarch/syscall-abi.rst
index 6f63aa3cfc64e5..d05fa2e0211bbf 100644
--- a/Documentation/loongarch/syscall-abi.rst
+++ b/Documentation/loongarch/syscall-abi.rst
@@ -5,32 +5,32 @@ Linux/LoongArch system call ABI
===============================
This document describes the system call ABI of Linux/LoongArch.
-As the kernel is 64-bit only for now, the description below assumes an LP64\*
-calling convention.
+As the kernel currently only supports 64-bit LoongArch architecture, the
+description below assumes LP64\* calling convention.
Syscall numbers and parameters
==============================
-Like with other recent architecture ports, for the most part Linux/LoongArch
+Like ther recent architecture ports, for the most part Linux/LoongArch
reuses the asm-generic syscall numbers and parameters.
-There are a few points worth mentioning though.
+There are a few limitations worth mentioning though.
* There is no ``renameat``. Use ``renameat2`` instead.
* There is no ``getrlimit`` or ``setrlimit``. Use ``prlimit64`` instead.
-* There is no ``fstat`` or ``newfstatat``. Only ``statx`` is provided, and
- low-level components making their own syscalls are expected to be aware of
- this (and provide their own shims if necessary).
+* There is no ``fstat`` or ``newfstatat``. Only ``statx`` is provided and
+ low-level components invoking their own syscalls are expected to be aware
+ of this (and provide their own shims if necessary).
Invocation
==========
-System calls are currently made with the ``syscall 0`` instruction.
+System calls are currently invoked with the ``syscall 0`` instruction.
Although the immediate field in the instruction is not checked at present,
-it is strongly advised to keep it zeroed in case it is to be made meaningful
+it is strongly advised to keep it zeroed in case the field has purposes
in the future.
-The system call number is placed in the register ``a7``.
-Parameters, if present, are placed from ``a0`` through ``a6`` as needed,
-as if calling a function with the respective arguments.
-Upon return, ``a0`` contains the return value, and ``t0-t8`` should be
-considered clobbered; all other registers are preserved.
+The system call number is placed in the register ``a7``. Parameters, if
+present, are placed from ``a0`` through ``a6`` as needed, as if calling
+a function with respective arguments. Upon return, the return value is placed
+in ``a0`` and ``t0-t8`` should be considered clobbered; all other registers
+are preserved.
Thanks.
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2022-10-19 4:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 10:04 [PATCH 0/2] LoongArch syscall ABI documentation WANG Xuerui
2022-10-18 10:04 ` [PATCH 1/2] Documentation: LoongArch: Document the syscall ABI WANG Xuerui
2022-10-18 10:12 ` Xi Ruoyao
2022-10-18 11:47 ` Qi Hu
2022-10-18 12:10 ` Huacai Chen
2022-10-19 4:13 ` Bagas Sanjaya [this message]
2022-10-18 10:04 ` [PATCH 2/2] docs/zh_CN: LoongArch: Translate the syscall ABI doc WANG Xuerui
2022-10-28 18:39 ` [PATCH 0/2] LoongArch syscall ABI documentation Jonathan Corbet
2022-10-29 9:14 ` WANG Xuerui
2022-11-14 17:39 ` Xi Ruoyao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y095WSk6brB2li/O@debian.me \
--to=bagasdotme@gmail.com \
--cc=alexs@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=corbet@lwn.net \
--cc=git@xen0n.name \
--cc=kernel@xen0n.name \
--cc=linux-doc@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=siyanteng@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.