From: Richard Weinberger <richard@nod.at>
To: davidgow <davidgow@google.com>
Cc: anton ivanov <anton.ivanov@cambridgegreys.com>,
Johannes Berg <johannes@sipsolutions.net>,
tglx <tglx@linutronix.de>, mingo <mingo@redhat.com>,
bp <bp@alien8.de>, dave hansen <dave.hansen@linux.intel.com>,
hpa <hpa@zytor.com>, Arnd Bergmann <arnd@arndb.de>,
Noah Goldstein <goldstein.w.n@gmail.com>,
linux-um <linux-um@lists.infradead.org>, x86 <x86@kernel.org>,
linux-arch <linux-arch@vger.kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-kselftest <linux-kselftest@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] asm-generic: current: Don't include thread-info.h if building asm
Date: Sat, 19 Aug 2023 23:17:47 +0200 (CEST) [thread overview]
Message-ID: <1999963356.6490608.1692479867613.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <20230704083022.692368-1-davidgow@google.com>
----- Ursprüngliche Mail -----
> Von: "davidgow" <davidgow@google.com>
> asm/current.h is included by some assembly files (either directly, or
> indirectly). This works on some architectures (such as x86), as their
> implementation of current.h is careful to not include any C, but the
> asm-generic version includes linux/thread-info.h unconditionally, which
> leads to errors when either C code or non-asm-compatible preprocessor
> directives are included.
>
> Just wrap the contents behind an #ifndef __ASSEMBLY__ to avoid any C
> code making its way in.
>
> Signed-off-by: David Gow <davidgow@google.com>
> ---
>
> This is requrired for patch #2 here, as UML uses this asm-generic
> header, but works with x86 assembly files which are expecting the x86
> current.h, which is assembly-friendly.
>
> ---
> include/asm-generic/current.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/asm-generic/current.h b/include/asm-generic/current.h
> index 3a2e224b9fa0..9c2aeecbd05a 100644
> --- a/include/asm-generic/current.h
> +++ b/include/asm-generic/current.h
> @@ -2,9 +2,11 @@
> #ifndef __ASM_GENERIC_CURRENT_H
> #define __ASM_GENERIC_CURRENT_H
>
> +#ifndef __ASSEMBLY__
> #include <linux/thread_info.h>
>
> #define get_current() (current_thread_info()->task)
> #define current get_current()
> +#endif
>
> #endif /* __ASM_GENERIC_CURRENT_H */
I'm fine with the UML side of this change but the generic part needs Arnd's ACK.
Thanks,
//richard
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
next prev parent reply other threads:[~2023-08-19 21:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-04 8:30 [PATCH 1/2] asm-generic: current: Don't include thread-info.h if building asm David Gow
2023-07-04 8:30 ` [PATCH 2/2] arch: um: Use the x86 checksum implementation on 32-bit David Gow
2023-08-19 21:17 ` Richard Weinberger [this message]
2023-08-19 23:12 ` [PATCH 1/2] asm-generic: current: Don't include thread-info.h if building asm Arnd Bergmann
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=1999963356.6490608.1692479867613.JavaMail.zimbra@nod.at \
--to=richard@nod.at \
--cc=anton.ivanov@cambridgegreys.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=davidgow@google.com \
--cc=geert@linux-m68k.org \
--cc=goldstein.w.n@gmail.com \
--cc=hpa@zytor.com \
--cc=johannes@sipsolutions.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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).