$OpenBSD: patch-src_include_storage_s_lock_h,v 1.6 2020/02/06 00:36:12 jeremy Exp $
Index: src/include/storage/s_lock.h
--- src/include/storage/s_lock.h.orig
+++ src/include/storage/s_lock.h
@@ -734,6 +734,29 @@ typedef unsigned char slock_t;
 	do { __asm__ __volatile__("" : : : "memory");  *(lock) = 0; } while (0)
 #endif
 
+#if defined(__m88k__)		/* Motorola 88k */
+#define HAS_TEST_AND_SET
+
+typedef unsigned int slock_t;
+
+#define TAS(lock) tas(lock)
+
+static __inline__ int
+tas(volatile slock_t *lock)
+{
+	register slock_t _res = 1;
+
+	__asm__ __volatile__(
+		"	xmem	%0, %2, %%r0\n"
+:		"=r"(_res)
+:		"0" (_res), "r"(lock)
+:		"memory");
+	return (int) _res;
+}
+
+#endif	 /* __m88k__ */
+
+
 #endif	/* defined(__GNUC__) || defined(__INTEL_COMPILER) */
 
 
