From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: add workaround for ambiguous C99 stdint.h types
Date: Mon, 17 Feb 2014 18:02:37 +0000 [thread overview]
Message-ID: <20140217180237.GC8361@arm.com> (raw)
In-Reply-To: <CAKv+Gu-RmZ4h=6+h_Fn+NQbDN81FNZHhnVd7Nfspx_LynJ1w6Q@mail.gmail.com>
On Mon, Feb 17, 2014 at 05:57:22PM +0000, Ard Biesheuvel wrote:
> On 17 February 2014 18:42, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > On Mon, Feb 17, 2014 at 12:40:18PM +0000, Ard Biesheuvel wrote:
> >> On 17 February 2014 13:23, Catalin Marinas <catalin.marinas@arm.com> wrote:
> >> > On Sun, Jan 26, 2014 at 08:30:48PM +0000, Ard Biesheuvel wrote:
> >> >> In a way similar to ARM commit 09096f6a0ee2 ("ARM: 7822/1: add workaround
> >> >> for ambiguous C99 stdint.h types"), this patch redefines the macros that
> >> >> are used in stdint.h so its definitions of uint64_t and int64_t are
> >> >> compatible with those of the kernel.
> >> >>
> >> >> In order to do so, drop types.h from generic-y and create a specific arm64
> >> >> version identical to the generic one with just the #define overrides added.
> >> >
> >> > I tried but still can't get what this patch is about. Do the
> >> > linux/types.h types ever get to user space? We have uapi/linux/types.h
> >> > for this.
> >> >
> >> > Can you give an example of where this is needed? Which source file
> >> > includes both stdint.h and linux/types.h (non-uapi version)?
> >>
> >> It's not about user space, it is mainly about the use of NEON
> >> instrinsics in the kernel.
> >>
> >> If you do the following:
> >>
> >> #Include <linux/types.h>
> >> #include <arm_neon.h>
> >
> > For other intrinsics that we use like __builtin_ctzl(), do we need to
> > explicitly include gcc headers? I don't think we do and I really don't
> > like such arm_neon.h include which brings in other user headers. Don't
> > we have any work around this?
>
> Well, I talked to the toolchain guys at the time and they really
> disliked the idea of coding directly against the __builtins because
> they are not considered a stable interface, especially because the
> interface that /is/ considered stable (arm_neon.h) is supported both
> on ARM and on arm64.
Than we don't use the Neon __builtins in the kernel.
> > My inbox only has some discussion in May last year on the linaro-kernel
> > list without any clear conclusion (it could be that I deleted other
> > emails).
>
> There was some discussion, indeed, but for ARM, with the conclusion
> being the fix I mentioned in the patch: 09096f6a0ee2 ("ARM: 7822/1:
> add workaround
> for ambiguous C99 stdint.h types"), only in that case, the ambiguity
> is (unsurprisingly) about the 32 bit types, not the 64 bit ones.
My worry is that some future toolchain may include something else in
this file and get other type conflicts. It really looks fragile.
--
Catalin
next prev parent reply other threads:[~2014-02-17 18:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-26 20:30 [PATCH] arm64: add workaround for ambiguous C99 stdint.h types Ard Biesheuvel
2014-02-17 12:23 ` Catalin Marinas
2014-02-17 12:40 ` Ard Biesheuvel
2014-02-17 17:42 ` Catalin Marinas
2014-02-17 17:57 ` Ard Biesheuvel
2014-02-17 18:02 ` Catalin Marinas [this message]
2014-02-17 18:17 ` Ard Biesheuvel
2014-02-20 8:55 ` Ard Biesheuvel
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=20140217180237.GC8361@arm.com \
--to=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).