summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/arch/m68k
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-09-01 00:32:23 +0000
committerguenther <guenther@openbsd.org>2012-09-01 00:32:23 +0000
commitcde6fc201d55f174c423caf7560c454b29da406e (patch)
tree3c8a6d2fd05c6c6d8d34297c0d9d94bea91bbc5b /lib/libpthread/arch/m68k
parentmodload needs to invoke ld with -nopie now on ELF platforms (diff)
downloadwireguard-openbsd-cde6fc201d55f174c423caf7560c454b29da406e.tar.xz
wireguard-openbsd-cde6fc201d55f174c423caf7560c454b29da406e.zip
So passes uthreads
Like autumn leaves on water don't fear the tedu@
Diffstat (limited to 'lib/libpthread/arch/m68k')
-rw-r--r--lib/libpthread/arch/m68k/_atomic_lock.c38
-rw-r--r--lib/libpthread/arch/m68k/uthread_machdep.c54
-rw-r--r--lib/libpthread/arch/m68k/uthread_machdep.h6
-rw-r--r--lib/libpthread/arch/m68k/uthread_machdep_asm.S18
4 files changed, 0 insertions, 116 deletions
diff --git a/lib/libpthread/arch/m68k/_atomic_lock.c b/lib/libpthread/arch/m68k/_atomic_lock.c
deleted file mode 100644
index cc4effe06f9..00000000000
--- a/lib/libpthread/arch/m68k/_atomic_lock.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* $OpenBSD: _atomic_lock.c,v 1.7 2008/10/02 23:27:23 deraadt Exp $ */
-/* David Leonard, <d@csee.uq.edu.au>. Public domain. */
-
-/*
- * Atomic lock for m68k
- */
-
-#include "spinlock.h"
-
-int
-_atomic_lock(volatile _spinlock_lock_t *lock)
-{
- _spinlock_lock_t old;
-
- /*
- * The Compare And Swap instruction (mc68020 and above)
- * compares its first operand with the memory addressed by
- * the third. If they are the same value, the second operand
- * is stored at the address. Otherwise the 1st operand (register)
- * is loaded with the contents of the 3rd operand.
- *
- * old = 0;
- * CAS(old, 1, *lock);
- * if (old == 1) { lock was acquired }
- *
- * From the MC68030 User's Manual (Motorola), page `3-13':
- * CAS Dc,Du,<ea>:
- * (<ea> - Dc) -> cc;
- * if Z then Du -> <ea>
- * else <ea> -> Dc;
- */
- old = _SPINLOCK_UNLOCKED;
- __asm__("casl %0, %2, %1" : "=d" (old), "=m" (*lock)
- : "d" (_SPINLOCK_LOCKED),
- "0" (old), "1" (*lock)
- : "cc");
- return (old != _SPINLOCK_UNLOCKED);
-}
diff --git a/lib/libpthread/arch/m68k/uthread_machdep.c b/lib/libpthread/arch/m68k/uthread_machdep.c
deleted file mode 100644
index 77c8019d1da..00000000000
--- a/lib/libpthread/arch/m68k/uthread_machdep.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* $OpenBSD: uthread_machdep.c,v 1.2 2003/06/02 08:11:15 miod Exp $ */
-/* David Leonard, <d@csee.uq.edu.au>. Public domain. */
-
-/*
- * Machine-dependent thread state functions for OpenBSD/m68k
- */
-
-#include <pthread.h>
-#include "pthread_private.h"
-
-#define ALIGNBYTES 0x3
-
-struct frame {
- int d2,d3,d4,d5,d6,d7;
- int a2,a3,a4,a5,fp;
- int link; /* frame link */
- int ra;
-};
-
-/*
- * Given a stack and an entry function, initialise a state
- * structure that can be later switched to.
- */
-void
-_thread_machdep_init(statep, base, len, entry)
- struct _machdep_state* statep;
- void *base;
- int len;
- void (*entry)(void);
-{
- struct frame *f;
-
- /* Locate the initial frame, aligned at the top of the stack */
- f = (struct frame *)(((int)base + len - sizeof *f) & ~ALIGNBYTES);
-
- f->ra = (int)entry;
- f->link = 0;
- f->fp = (int)&f->link;
- statep->sp = (int)f;
-}
-
-void
-_thread_machdep_save_float_state(statep)
- struct _machdep_state* statep;
-{
- /* fsave is a privileged instruction */
-}
-
-void
-_thread_machdep_restore_float_state(statep)
- struct _machdep_state* statep;
-{
- /* frestore is a privileged instruction */
-}
diff --git a/lib/libpthread/arch/m68k/uthread_machdep.h b/lib/libpthread/arch/m68k/uthread_machdep.h
deleted file mode 100644
index d9bb9935ca6..00000000000
--- a/lib/libpthread/arch/m68k/uthread_machdep.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/* $OpenBSD: uthread_machdep.h,v 1.4 2000/10/04 05:55:34 d Exp $ */
-/* David Leonard, <d@csee.uq.edu.au>. Public domain. */
-
-struct _machdep_state {
- int sp;
-};
diff --git a/lib/libpthread/arch/m68k/uthread_machdep_asm.S b/lib/libpthread/arch/m68k/uthread_machdep_asm.S
deleted file mode 100644
index 30e4397b838..00000000000
--- a/lib/libpthread/arch/m68k/uthread_machdep_asm.S
+++ /dev/null
@@ -1,18 +0,0 @@
-/* $OpenBSD: uthread_machdep_asm.S,v 1.1 2000/09/25 09:03:44 d Exp $ */
-/* David Leonard, <d@csee.uq.edu.au>. Public domain. */
-
-#include <machine/asm.h>
-
-#define SA(x) (((x)+3)&~3)
-#define FRAMESIZE 4*11
-
-ENTRY(_thread_machdep_switch)
- link a6, #-SA(FRAMESIZE)
- moveml #0x7CFC, sp@ /* d2-d7,a2-a6 */
- movel a6@(8), a0
- movel a6@(12), a1
- movel sp, a1@
- movel a0@, sp
- moveml sp@, #0x7CFC
- unlk a6
- rts