From 632e49dc6eebdbeebed5c5f91ca63ea98aa5dfc4 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Fri, 26 Nov 2021 17:45:23 +0000
Subject: disable 64K alignment on 32-bit Haiku


diff --git a/stress-icache.c b/stress-icache.c
index bbff361..ed38bf7 100644
--- a/stress-icache.c
+++ b/stress-icache.c
@@ -161,14 +161,14 @@ static inline int icache_madvise(const stress_args_t *args, void *addr, size_t s
 	return 0;
 }
 
-#if defined(HAVE_ALIGNED_64K)
-STRESS_ICACHE_FUNC(stress_icache_func_64K, SIZE_64K)
+#if defined(HAVE_ALIGNED_64K) && !defined(__HAIKU__)
+STRESS_ICACHE_FUNC(stress_icache_func_64K, SIZE_4K)
 #endif
 STRESS_ICACHE_FUNC(stress_icache_func_16K, SIZE_16K)
 STRESS_ICACHE_FUNC(stress_icache_func_4K, SIZE_4K)
 
-#if defined(HAVE_ALIGNED_64K)
-STRESS_ICACHE(stress_icache_64K, SIZE_64K, stress_icache_func_64K)
+#if defined(HAVE_ALIGNED_64K) && !defined(__HAIKU__)
+STRESS_ICACHE(stress_icache_64K, SIZE_4K, stress_icache_func_64K)
 #endif
 STRESS_ICACHE(stress_icache_16K, SIZE_16K, stress_icache_func_16K)
 STRESS_ICACHE(stress_icache_4K, SIZE_4K, stress_icache_func_4K)
@@ -193,13 +193,13 @@ static int stress_icache(const stress_args_t *args)
 	case SIZE_16K:
 		ret = stress_icache_16K(args);
 		break;
-#if defined(HAVE_ALIGNED_64K)
+#if defined(HAVE_ALIGNED_64K) && !defined(__HAIKU__)
 	case SIZE_64K:
 		ret = stress_icache_64K(args);
 		break;
 #endif
 	default:
-#if defined(HAVE_ALIGNED_64K)
+#if defined(HAVE_ALIGNED_64K) && !defined(__HAIKU__)
 		pr_inf("%s: page size %zu is not %u or %u or %u, cannot test\n",
 			args->name, args->page_size,
 			SIZE_4K, SIZE_16K, SIZE_64K);
-- 
2.30.2

