public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] ptrace07: Fix compilation when not on x86
@ 2022-10-18 15:25 Richard Palethorpe via ltp
  2022-10-18 15:25 ` [LTP] [PATCH 2/2] ptrace07: Fix compilation by avoiding aligned_alloc Richard Palethorpe via ltp
  2022-10-19  9:30 ` [LTP] [PATCH 1/2] ptrace07: Fix compilation when not on x86 Martin Doucha
  0 siblings, 2 replies; 11+ messages in thread
From: Richard Palethorpe via ltp @ 2022-10-18 15:25 UTC (permalink / raw)
  To: ltp; +Cc: Richard Palethorpe

Strictly cpuid.h should not be included on non-x86, but this means
each test author has to remember not to include it. Instead we can set
a blank macro to allow compilation.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---

This time I created a PR to check if compilation succeeds:
https://github.com/linux-test-project/ltp/pull/984

 include/lapi/cpuid.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/lapi/cpuid.h b/include/lapi/cpuid.h
index cd0567f92..20e977093 100644
--- a/include/lapi/cpuid.h
+++ b/include/lapi/cpuid.h
@@ -16,11 +16,15 @@
  * have __cpuid_count().
  */
 #ifndef __cpuid_count
+#  if defined(__i386__) || defined(__x86_64__)
 #define __cpuid_count(level, count, a, b, c, d) ({			\
 	__asm__ __volatile__ ("cpuid\n\t"				\
 			      : "=a" (a), "=b" (b), "=c" (c), "=d" (d)	\
 			      : "0" (level), "2" (count));		\
 })
+#  else
+#define __cpuid_count(level, count, a, b, c, d)
+#  endif
 #endif
 
 #endif /* LAPI_CPUID_H__ */
-- 
2.36.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2022-10-20 11:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-18 15:25 [LTP] [PATCH 1/2] ptrace07: Fix compilation when not on x86 Richard Palethorpe via ltp
2022-10-18 15:25 ` [LTP] [PATCH 2/2] ptrace07: Fix compilation by avoiding aligned_alloc Richard Palethorpe via ltp
2022-10-19  1:40   ` Pengfei Xu
2022-10-19  2:59     ` Li Wang
2022-10-19  3:16       ` Pengfei Xu
2022-10-19  3:20         ` Li Wang
2022-10-19  9:30 ` [LTP] [PATCH 1/2] ptrace07: Fix compilation when not on x86 Martin Doucha
2022-10-20  3:53   ` Li Wang
2022-10-20  7:31     ` Richard Palethorpe
2022-10-20 10:41     ` Martin Doucha
2022-10-20 10:59       ` Richard Palethorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox