[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4f8402e5-2bfa-4ee3-9123-fac887ed866d@t-8ch.de>
Date: Mon, 3 Nov 2025 10:27:22 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Huacai Chen <chenhuacai@...nel.org>
Cc: WANG Xuerui <kernel@...0n.name>, Jiaxun Yang <jiaxun.yang@...goat.com>,
loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] LoongArch: ptrace: Use UAPI types in UAPI header
Hi Huacai,
On 2025-11-03 17:12:58+0800, Huacai Chen wrote:
> On Wed, Oct 29, 2025 at 11:20 PM Thomas Weißschuh <linux@...ssschuh.net> wrote:
> >
> > The kernel UAPI headers already contain fixed-width integer types,
> > there is no need to rely on libc types. There may not be a libc
> > available or it may not provide <stdint.h>, like for example on nolibc.
> >
> > This also aligns the header with the rest of the LoongArch UAPI headers.
> Thank you for your patch, but could you please tell me some history
> and user guide about the three styles: u64, __u64 and unint64_t?
uint64_t -> userspace type, should not be used within the kernel
can technically be used in UAPI it will be somewhat
nonstandard and introduce a dependency on libc with no
upsides.
u64 -> kernel-internal type, used for regular kernel code
defined in include/linux/types.h
__u64 -> UAPI type usable from both kernel and userspace code
defined in include/uapi/linux/types.
As a note: When applying the patch I want to clarify the commit message
a bit, as nolibc indeed has a stdint.h header. The real breakage comes
from a validation step we perform which does not add the libc include
directory to the include path.
Thomas
Powered by blists - more mailing lists