linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] asm-generic: current: Don't include thread-info.h if building asm
@ 2023-07-04  8:30 David Gow
  2023-07-04  8:30 ` [PATCH 2/2] arch: um: Use the x86 checksum implementation on 32-bit David Gow
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Gow @ 2023-07-04  8:30 UTC (permalink / raw)
  To: Richard Weinberger, Anton Ivanov, Johannes Berg, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, H . Peter Anvin,
	Arnd Bergmann, Noah Goldstein
  Cc: linux-um, x86, linux-arch, Geert Uytterhoeven, linux-kselftest,
	linux-kernel, David Gow

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 */
-- 
2.41.0.255.g8b1d071c50-goog


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-19 23:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 1/2] asm-generic: current: Don't include thread-info.h if building asm Richard Weinberger
2023-08-19 23:12 ` Arnd Bergmann

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).