summaryrefslogtreecommitdiff
path: root/lib/libpthread/arch/m68k/machdep.h
diff options
context:
space:
mode:
authorbriggs <briggs@cvs.openbsd.org>1997-04-13 17:13:10 +0000
committerbriggs <briggs@cvs.openbsd.org>1997-04-13 17:13:10 +0000
commit091aa076e3981a6d671f839cff32f29a3070338a (patch)
tree88fbe8daa30529063188a046dcbd6474548798e3 /lib/libpthread/arch/m68k/machdep.h
parent28b9c4b09d13871c3b25ccaf4e08ffd6154645a8 (diff)
Initial support for pthreads on m68k from
David Leonard <david.leonard@it.uq.edu.au>.
Diffstat (limited to 'lib/libpthread/arch/m68k/machdep.h')
-rw-r--r--lib/libpthread/arch/m68k/machdep.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/libpthread/arch/m68k/machdep.h b/lib/libpthread/arch/m68k/machdep.h
new file mode 100644
index 00000000000..a63e77de0d3
--- /dev/null
+++ b/lib/libpthread/arch/m68k/machdep.h
@@ -0,0 +1,49 @@
+/* $OpenBSD */
+
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $ I d: engine-m68000-netbsd.h,v 1.51 1994/11/08 15:39:15 proven Exp $
+ *
+ */
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 0x80;
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+ volatile long temp = SEMAPHORE_CLEAR; \
+ __asm__ volatile( \
+ "tas %2; bpl 0f; movl #1,%0; 0:" \
+ :"=r" (temp) \
+ :"0" (temp),"m" (*lock)); \
+ temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * Min pthread stacksize
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+int machdep_save_state __P((void));
+
+#endif
+
+__END_DECLS