0002-rt-tests-oslat-Allow-build-for-not-supported-archs.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From 165b597e3003c6870f5980e8902014d9344e6cf3 Mon Sep 17 00:00:00 2001
  2. From: Peter Xu <peterx@redhat.com>
  3. Date: Thu, 1 Oct 2020 14:47:26 -0400
  4. Subject: [PATCH] rt-tests: oslat: Allow build for not supported archs
  5. Now rt-tests won't build for archs other than x86/i386/ppc64 after oslat is
  6. merged. Instead of failing the build, let's make it pass. However, whenever
  7. oslat is executed, instead of running the real program, dump an error message,
  8. so that people can try to implement the frc() function for it when there's a
  9. real need for the new arch.
  10. Signed-off-by: Peter Xu <peterx@redhat.com>
  11. Signed-off-by: John Kacur <jkacur@redhat.com>
  12. [Taken from:
  13. https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/commit/src/oslat/oslat.c?h=unstable/devel/latest&id=165b597e3003c6870f5980e8902014d9344e6cf3]
  14. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
  15. ---
  16. src/oslat/oslat.c | 10 +++++++++-
  17. 1 file changed, 9 insertions(+), 1 deletion(-)
  18. diff --git a/src/oslat/oslat.c b/src/oslat/oslat.c
  19. index f1a82f2..a8b6155 100644
  20. --- a/src/oslat/oslat.c
  21. +++ b/src/oslat/oslat.c
  22. @@ -69,7 +69,9 @@ static inline void frc(uint64_t *pval)
  23. __asm__ __volatile__("mfspr %0, 268\n" : "=r" (*pval));
  24. }
  25. # else
  26. -# error Need frc() for this platform.
  27. +# define relax() do { } while (0)
  28. +# define frc(x)
  29. +# define FRC_MISSING
  30. # endif
  31. #else
  32. # error Need to add support for this compiler.
  33. @@ -810,6 +812,12 @@ int main(int argc, char *argv[])
  34. int i, n_cores;
  35. cpu_set_t cpu_set;
  36. +#ifdef FRC_MISSING
  37. + printf("This architecture is not yet supported. "
  38. + "Please implement frc() function first for %s.\n", argv[0]);
  39. + return 0;
  40. +#endif
  41. +
  42. CPU_ZERO(&cpu_set);
  43. g.app_name = argv[0];
  44. --
  45. 2.20.1