[Midnightbsd-cvs] src: arch/arm: Remove unsupported architectures.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Oct 30 17:32:43 EDT 2008


Log Message:
-----------
Remove unsupported architectures.

Removed Files:
-------------
    src/lib/libkse/arch/arm:
        Makefile.inc
    src/lib/libkse/arch/arm/arm:
        context.S
        pthread_md.c
    src/lib/libkse/arch/arm/include:
        atomic_ops.h
        pthread_md.h
    src/lib/libkse/arch/ia64:
        Makefile.inc
    src/lib/libkse/arch/ia64/ia64:
        context.S
        enter_uts.S
        pthread_md.c
    src/lib/libkse/arch/ia64/include:
        atomic_ops.h
        pthread_md.h
    src/lib/libkse/arch/powerpc:
        Makefile.inc
    src/lib/libkse/arch/powerpc/include:
        atomic_ops.h
        pthread_md.h
    src/lib/libkse/arch/powerpc/powerpc:
        assym.c
        assym.s
        context.S
        enter_uts.S
        pthread_md.c

-------------- next part --------------
--- lib/libkse/arch/arm/Makefile.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-# $FreeBSD: src/lib/libkse/arch/arm/Makefile.inc,v 1.3 2007/10/09 13:42:22 obrien Exp $
-
-.PATH:	${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
-
-CFLAGS+=-DSYSTEM_SCOPE_ONLY
-
-SRCS+=	pthread_md.c context.S
--- lib/libkse/arch/arm/arm/context.S
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) Olivier Houchard
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Neither the name of the author nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libkse/arch/arm/arm/context.S,v 1.4 2007/10/09 13:42:22 obrien Exp $");
-
-/*
- * int thr_setcontext(mcontext_t *mcp, intptr_t val, intptr_t *loc)
- *
- * Restores the context in mcp.
- *
- * Returns 0 if there are no errors; -1 otherwise
- */
-      
-.weak _C_LABEL(_thr_setcontext)
-.set _C_LABEL(_thr_setcontext), _C_LABEL(__thr_setcontext)
-
-ENTRY(__thr_setcontext)
-/* Check for NULL pointer. */
-	cmp 	r0, #0
-	moveq 	r0, #-1
-	moveq 	pc, lr
-	cmp	r2, #0
-	strne	r1, [r2]
-	ldr	r1, [r0, #(16 * 4)] /* CPSR */
-	msr	cpsr, r1
-	ldmia	r0, {r0-r15}
-	mov	pc, lr
-	/* XXX: FP bits ? */
-
-/*
- * int thr_getcontext(mcontext_t *mcp);
- *
- * Returns -1 if there is an error, 0 no errors; 1 upon return
- * from a setcontext().
- */
-.weak _C_LABEL(_thr_getcontext)
-.set _C_LABEL(_thr_getcontext), _C_LABEL(__thr_getcontext)
-		     
-ENTRY(__thr_getcontext)
-/* Check for NULL pointer. */
-	cmp	r0, #0
-	moveq	r0, #-1
-	moveq	pc, lr
-	stmia	r0, {r1-r14}
-	mov	r1, #1
-	str	r1, [r0] /* Return 1 from setcontext */
-	str	lr, [r0, #(15 * 4)] /* PC */
-	mrs	r1, cpsr
-	str	r1, [r0, #(16 * 4)] /* CPSR */
-	mov	r0, #0 /* Return 0. */
-	mov	pc, lr
-
-ENTRY(_arm_enter_uts)
-	add	sp, r2, r3 /* Stack addr + size. */
-	mov	pc, r1
--- lib/libkse/arch/arm/arm/pthread_md.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * Copyright (C) 2003 Jake Burkholder <jake at freebsd.org>
- * Copyright (C) 2003 David Xu <davidxu at freebsd.org>
- * Copyright (c) 2001,2003 Daniel Eischen <deischen at freebsd.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Neither the name of the author nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libkse/arch/arm/arm/pthread_md.c,v 1.5 2007/10/09 13:42:22 obrien Exp $");
-
-#include <sys/types.h>
-
-#include <unistd.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ucontext.h>
-
-#include <machine/sysarch.h>
-
-#include "pthread_md.h"
-
-struct arm_tp **arm_tp = (struct arm_tp **)ARM_TP_ADDRESS;
-
-struct tcb *
-_tcb_ctor(struct pthread *thread, int initial)
-{
-	struct tcb *tcb;
-
-	if ((tcb = malloc(sizeof(struct tcb)))) {
-		bzero(tcb, sizeof(struct tcb));
-		tcb->tcb_thread = thread;
-		/* XXX - Allocate tdv/tls */
-	}
-	return (tcb);
-}
-
-void
-_tcb_dtor(struct tcb *tcb)
-{
-
-	free(tcb);
-}
-
-struct kcb *
-_kcb_ctor(struct kse *kse)
-{
-	struct kcb *kcb;
-
-	kcb = malloc(sizeof(struct kcb));
-	if (kcb != NULL) {
-		bzero(kcb, sizeof(struct kcb));
-		kcb->kcb_faketcb.tcb_isfake = 1;
-		kcb->kcb_faketcb.tcb_tmbx.tm_flags = TMF_NOUPCALL;
-		kcb->kcb_curtcb = &kcb->kcb_faketcb;
-		kcb->kcb_kse = kse;
-	}
-	return (kcb);
-}
-
-void
-_kcb_dtor(struct kcb *kcb)
-{
-	free(kcb);
-}
--- lib/libkse/arch/arm/include/pthread_md.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/*-
- * Copyright (c) 2003 Jake Burkholder <jake at freebsd.org>.
- * Copyright (c) 2003 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libkse/arch/arm/include/pthread_md.h,v 1.9 2007/10/09 13:42:23 obrien Exp $
- */
-
-/*
- * Machine-dependent thread prototypes/definitions for the thread kernel.
- */
-#ifndef _PTHREAD_MD_H_
-#define	_PTHREAD_MD_H_
-
-#include <sys/kse.h>
-#include <stddef.h>
-#include <ucontext.h>
-
-#define	KSE_STACKSIZE		16384
-#define	DTV_OFFSET              offsetof(struct tcb, tcb_tp.tp_tdv)
-
-int _thr_setcontext(mcontext_t *, intptr_t, intptr_t *);
-int _thr_getcontext(mcontext_t *);
-
-#define	THR_GETCONTEXT(ucp)	_thr_getcontext(&(ucp)->uc_mcontext)
-#define	THR_SETCONTEXT(ucp)	_thr_setcontext(&(ucp)->uc_mcontext, 0, NULL)
-
-#define	PER_THREAD
-
-struct kcb;
-struct kse;
-struct pthread;
-struct tcb;
-struct tdv;	/* We don't know what this is yet? */
-
-
-/*
- * %r6 points to one of these. We define the static TLS as an array
- * of long double to enforce 16-byte alignment of the TLS memory.
- *
- * XXX - Both static and dynamic allocation of any of these structures
- *       will result in a valid, well-aligned thread pointer???
- */
-struct arm_tp {
-	struct tdv		*tp_tdv;	/* dynamic TLS */
-};
-
-struct tcb {
-	struct pthread		*tcb_thread;
-	struct kcb		*tcb_curkcb;
-	uint32_t		tcb_isfake;
-	struct kse_thr_mailbox	tcb_tmbx;	/* needs 32-byte alignment */
-	struct arm_tp		tcb_tp;
-};
-
-struct kcb {
-	struct kse_mailbox	kcb_kmbx;
-	struct tcb		kcb_faketcb;
-	struct tcb		*kcb_curtcb;
-	struct kse		*kcb_kse;
-};
-
-extern struct arm_tp **arm_tp;
-#define _tp (*arm_tp)
-
-#define	_tcb	((struct tcb*)((char*)(_tp) - offsetof(struct tcb, tcb_tp)))
-
-/*
- * The kcb and tcb constructors.
- */
-struct tcb	*_tcb_ctor(struct pthread *, int);
-void		_tcb_dtor(struct tcb *);
-struct kcb	*_kcb_ctor(struct kse *kse);
-void		_kcb_dtor(struct kcb *);
-
-static __inline uint32_t
-__kcb_swp(uint32_t val, void *ptr)
-{       
-	
-	__asm __volatile("swp   %0, %1, [%2]"
-	    : "=r" (val) : "r" (val) , "r" (ptr) : "memory");
-    	return (val);
-}
-
-/* Called from the KSE to set its private data. */
-static __inline void
-_kcb_set(struct kcb *kcb)
-{
-	/* There is no thread yet; use the fake tcb. */
-	__kcb_swp((uint32_t)&kcb->kcb_faketcb.tcb_tp, &_tp);
-}
-
-/*
- * Get the current kcb.
- *
- * This can only be called while in a critical region; don't
- * worry about having the kcb changed out from under us.
- */
-static __inline struct kcb *
-_kcb_get(void)
-{
-	return (_tcb->tcb_curkcb);
-}
-
-/*
- * Enter a critical region.
- *
- * Read and clear km_curthread in the kse mailbox.
- */
-static __inline struct kse_thr_mailbox *
-_kcb_critical_enter(void)
-{
-	struct kse_thr_mailbox *crit;
-
-	if (_tcb->tcb_isfake)
-		return (NULL);
-	crit = (struct kse_thr_mailbox *)__kcb_swp((uint32_t)NULL, 
-	    &_tcb->tcb_curkcb->kcb_kmbx.km_curthread);
-	return (crit);
-}
-
-static __inline void
-_kcb_critical_leave(struct kse_thr_mailbox *crit)
-{
-
-	if (_tcb->tcb_isfake == 0)
-		__kcb_swp((uint32_t)crit, 
-		    &_tcb->tcb_curkcb->kcb_kmbx.km_curthread);
-}
-
-static __inline int
-_kcb_in_critical(void)
-{
-	uint32_t flags;
-	int ret;
-
-	return (_tcb->tcb_curkcb->kcb_kmbx.km_curthread == NULL);
-	if (_tcb->tcb_isfake != 0) {
-		/*
-		 * We are in a critical region since there is no
-		 * current thread.
-		 */
-		ret = 1;
-	} else {
-		flags = _tcb->tcb_tmbx.tm_flags;
-		_tcb->tcb_tmbx.tm_flags |= TMF_NOUPCALL;
-		ret = (_tcb->tcb_curkcb->kcb_kmbx.km_curthread == NULL);
-		_tcb->tcb_tmbx.tm_flags = flags;
-	}
-	return (ret);
-}
-
-static __inline void
-_tcb_set(struct kcb *kcb, struct tcb *tcb)
-{
-	if (tcb == NULL) 
-		tcb = &kcb->kcb_faketcb;
-	__kcb_swp((uint32_t)&tcb->tcb_tp, &_tp);
-	kcb->kcb_curtcb = tcb;
-	tcb->tcb_curkcb = kcb;
-}
-
-static __inline struct tcb *
-_tcb_get(void)
-{
-	return (_tcb);
-}
-
-static __inline struct pthread *
-_get_curthread(void)
-{
-	return (_tcb->tcb_thread);
-}
-
-/*
- * Get the current kse.
- *
- * Like _kcb_get(), this can only be called while in a critical region.
- */
-static __inline struct kse *
-_get_curkse(void)
-{
-	return (_tcb->tcb_curkcb->kcb_kse);
-}
-
-void _arm_enter_uts(struct kse_mailbox *km, kse_func_t uts, void *stack,
-    size_t stacksz);
-
-static __inline int
-_thread_enter_uts(struct tcb *tcb, struct kcb *kcb)
-{
-	int ret;
-	
-	if ((ret = _thr_getcontext(&tcb->tcb_tmbx.tm_context.uc_mcontext))
-	    == 0) {
-		kcb->kcb_curtcb = &kcb->kcb_faketcb;
-		__kcb_swp((int)&kcb->kcb_faketcb.tcb_tp, &_tp);
-		_arm_enter_uts(&kcb->kcb_kmbx, kcb->kcb_kmbx.km_func,
-		    kcb->kcb_kmbx.km_stack.ss_sp,
-		    kcb->kcb_kmbx.km_stack.ss_size);
-		/* We should not reach here. */
-		return (-1);
-	} else if (ret < 0)
-		return (-1);
-	return (0);
-}
-
-static __inline int
-_thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox)
-{
-	extern int _libkse_debug;
-	mcontext_t *mc;
-
-	if (!tcb || !kcb)
-		return (-1);
-	_tcb_set(kcb, tcb);
-	mc = &tcb->tcb_tmbx.tm_context.uc_mcontext;
-	if (_libkse_debug == 0) {
-		tcb->tcb_tmbx.tm_lwp = kcb->kcb_kmbx.km_lwp;
-		if (setmbox)
-			_thr_setcontext(mc, (intptr_t)&tcb->tcb_tmbx,
-				(intptr_t *)&kcb->kcb_kmbx.km_curthread);
-		else
-			_thr_setcontext(mc, 0, NULL);
-	} else {
-		if (setmbox)
-			kse_switchin(&tcb->tcb_tmbx, KSE_SWITCHIN_SETTMBX);
-		else
-			kse_switchin(&tcb->tcb_tmbx, 0);
-	}
-
-	/* We should not reach here. */
-	return (-1);
-}
-
-#endif /* _PTHREAD_MD_H_ */
--- lib/libkse/arch/arm/include/atomic_ops.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * Copyright (c) 2001 Daniel Eischen <deischen at FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Neither the name of the author nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libkse/arch/arm/include/atomic_ops.h,v 1.4 2007/10/09 13:42:23 obrien Exp $
- */
-
-#ifndef	_ATOMIC_OPS_H_
-#define	_ATOMIC_OPS_H_
-
-#include <machine/atomic.h>
-#include "thr_private.h"
-
-/*
- * Atomic swap:
- *   Atomic (tmp = *dst, *dst = val), then *res = tmp
- *
- * void atomic_swap32(intptr_t *dst, intptr_t val, intptr_t *res);
- */
-static inline void
-atomic_swap32(intptr_t *dst, intptr_t val, intptr_t *res)
-{
-	*res = __swp(val, dst);
-}
-
-#define	atomic_swap_ptr(d, v, r) \
-	atomic_swap32((intptr_t *)d, (intptr_t)v, (intptr_t *)r)
-
-#define	atomic_swap_int(d, v, r) \
-	atomic_swap32((intptr_t *)d, (intptr_t)v, (intptr_t *)r)
-#endif
-
--- lib/libkse/arch/ia64/Makefile.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-# $FreeBSD: src/lib/libkse/arch/ia64/Makefile.inc,v 1.5 2007/10/09 13:42:24 obrien Exp $
-
-.PATH:	${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
-
-SRCS+=	context.S enter_uts.S pthread_md.c
--- lib/libkse/arch/ia64/ia64/context.S
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * Copyright (c) 2003 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libkse/arch/ia64/ia64/context.S,v 1.6 2007/10/09 13:42:24 obrien Exp $");
-
-#include <sys/syscall.h>
-
-#define	SIZEOF_SPECIAL	(18*8)
-
-/*
- * int _ia64_restore_context(mcontext_t *mc, intptr_t val, intptr_t *loc);
- */
-ENTRY(_ia64_restore_context, 3)
-{	.mmi
-	invala
-	mov		ar.rsc=0xc
-	add		r32=16,r32
-	;;
-}
-{	.mmi
-	loadrs
-	ld8		r12=[r32]		// sp
-	add		r31=8,r32
-	;;
-}
-{	.mii
-	ld8		r16=[r31],16		// unat (before)
-	add		r30=16,r32
-	add		r14=SIZEOF_SPECIAL,r32
-	;;
-}
-{	.mmi
-	ld8		r17=[r30],16		// rp
-	ld8		r18=[r31],16		// pr
-	mov		r2=r33
-	;;
-}
-{	.mmi
-	ld8		r19=[r30],16		// pfs
-	ld8		r20=[r31],32		// bspstore
-	mov		rp=r17
-	;;
-}
-{	.mmi
-	ld8		r21=[r30],32		// rnat
-	ld8		r22=[r31],16		// rsc
-	mov		pr=r18,0x1fffe
-	;;
-}
-{	.mmi
-	ld8		r23=[r30]		// fpsr
-	ld8		r24=[r31]		// psr		-- not used
-	mov		r3=r34
-	;;
-}
-{	.mmi
-	ld8		r17=[r14],8		// unat (after)
-	mov		ar.bspstore=r20
-	cmp.ne		p15,p0=r0,r3
-	;;
-}
-{	.mmi
-	mov		ar.rnat=r21
-	mov		ar.unat=r17
-	add		r15=8,r14
-	;;
-}
-{	.mmi
-	ld8.fill	r4=[r14],16		// r4
-	ld8.fill	r5=[r15],16		// r5
-	mov		ar.pfs=r19
-	;;
-}
-{	.mmi
-	ld8.fill	r6=[r14],16		// r6
-	ld8.fill	r7=[r15],16		// r7
-	nop		0
-	;;
-}
-{	.mmi
-	mov		ar.unat=r16
-	mov		ar.rsc=r22
-	nop		0
-}
-{	.mmi
-	ld8		r17=[r14],16		// b1
-	ld8		r18=[r15],16		// b2
-	nop		0
-	;;
-}
-{	.mmi
-	ld8		r19=[r14],16		// b3
-	ld8		r20=[r15],16		// b4
-	mov		b1=r17
-	;;
-}
-{	.mmi
-	ld8		r16=[r14],24		// b5
-	ld8		r17=[r15],32		// lc
-	mov		b2=r18
-	;;
-}
-{	.mmi
-	ldf.fill	f2=[r14],32
-	ldf.fill	f3=[r15],32
-	mov		b3=r19
-	;;
-}
-{	.mmi
-	ldf.fill	f4=[r14],32
-	ldf.fill	f5=[r15],32
-	mov		b4=r20
-	;;
-}
-{	.mmi
-	ldf.fill	f16=[r14],32
-	ldf.fill	f17=[r15],32
-	mov		b5=r16
-	;;
-}
-{	.mmi
-	ldf.fill	f18=[r14],32
-	ldf.fill	f19=[r15],32
-	mov		ar.lc=r17
-	;;
-}
-	ldf.fill	f20=[r14],32
-	ldf.fill	f21=[r15],32
-	;;
-	ldf.fill	f22=[r14],32
-	ldf.fill	f23=[r15],32
-	;;
-	ldf.fill	f24=[r14],32
-	ldf.fill	f25=[r15],32
-	;;
-	ldf.fill	f26=[r14],32
-	ldf.fill	f27=[r15],32
-	;;
-	ldf.fill	f28=[r14],32
-	ldf.fill	f29=[r15],32
-	;;
-	ldf.fill	f30=[r14],32+24
-	ldf.fill	f31=[r15],24+24
-	;;
-	ld8		r8=[r14],16
-	ld8		r9=[r15],16
-	;;
-	ld8		r10=[r14]
-	ld8		r11=[r15]
-	;;
-{	.mmb
-(p15)	st8		[r3]=r2
-	mov		ar.fpsr=r23
-	br.ret.sptk	rp
-	;;
-}
-END(_ia64_restore_context)
-
-/*
- * int _ia64_save_context(mcontext_t *mc);
- */
-ENTRY(_ia64_save_context, 1)
-{	.mmi
-	mov		r14=ar.rsc
-	mov		r15=ar.fpsr
-	add		r31=8,r32
-	;;
-}
-{	.mmi
-	st8		[r32]=r0,16
-	st8		[r31]=r0,16
-	nop		0
-	;;
-}
-{	.mmi
-	mov		ar.rsc=0xc
-	mov		r16=ar.unat
-	nop		0
-	;;
-}
-{	.mmi
-	flushrs
-	st8		[r32]=sp,16		// sp
-	mov		r17=rp
-	;;
-}
-{	.mmi
-	st8		[r31]=r16,16		// unat (before)
-	st8		[r32]=r17,16		// rp
-	mov		r16=pr
-	;;
-}
-{	.mmi
-	st8		[r31]=r16,16		// pr
-	mov		r17=ar.bsp
-	mov		r16=ar.pfs
-	;;
-}
-{	.mmi
-	st8		[r32]=r16,16		// pfs
-	st8		[r31]=r17,16		// bspstore
-	nop		0
-	;;
-}
-{	.mmi
-	mov		r16=ar.rnat
-	mov		ar.rsc=r14
-	add		r30=SIZEOF_SPECIAL-(6*8),r32
-	;;
-}
-{	.mmi
-	st8		[r32]=r16,16		// rnat
-	st8		[r31]=r0,16		// __spare
-	nop		0
-	;;
-}
-{	.mmi
-	st8		[r32]=r13,16		// tp		-- not used
-	st8		[r31]=r14,16		// rsc
-	mov		r16=b1
-	;;
-}
-{	.mmi
-	st8		[r32]=r15,10*8		// fpr
-	st8		[r31]=r0,8*8		// psr
-	nop		0
-	;;
-}
-	/* callee_saved */
-{	.mmi
-	.mem.offset	8,0
-	st8.spill	[r31]=r4,16		// r4
-	.mem.offset	16,0
-	st8.spill	[r32]=r5,16		// r5
-	mov		r17=b2
-	;;
-}
-{	.mmi
-	.mem.offset	24,0
-	st8.spill	[r31]=r6,16		// r6
-	.mem.offset	32,0
-	st8.spill	[r32]=r7,16		// r7
-	mov		r18=b3
-	;;
-}
-{	.mmi
-	st8		[r31]=r16,16		// b1
-	mov		r16=ar.unat
-	mov		r19=b4
-	;;
-}
-{	.mmi
-	st8		[r30]=r16		// unat (after)
-	st8		[r32]=r17,16		// b2
-	mov		r16=b5
-	;;
-}
-{	.mmi
-	st8		[r31]=r18,16		// b3
-	st8		[r32]=r19,16		// b4
-	mov		r17=ar.lc
-	;;
-}
-	st8		[r31]=r16,16		// b5
-	st8		[r32]=r17,16		// lc
-	;;
-	st8		[r31]=r0,24		// __spare
-	stf.spill	[r32]=f2,32
-	;;
-	stf.spill	[r31]=f3,32
-	stf.spill	[r32]=f4,32
-	;;
-	stf.spill	[r31]=f5,32
-	stf.spill	[r32]=f16,32
-	;;
-	stf.spill	[r31]=f17,32
-	stf.spill	[r32]=f18,32
-	;;
-	stf.spill	[r31]=f19,32
-	stf.spill	[r32]=f20,32
-	;;
-	stf.spill	[r31]=f21,32
-	stf.spill	[r32]=f22,32
-	;;
-	stf.spill	[r31]=f23,32
-	stf.spill	[r32]=f24,32
-	;;
-	stf.spill	[r31]=f25,32
-	stf.spill	[r32]=f26,32
-	;;
-	stf.spill	[r31]=f27,32
-	stf.spill	[r32]=f28,32
-	;;
-{	.mmi
-	stf.spill	[r31]=f29,32
-	stf.spill	[r32]=f30,32+24
-	add		r14=1,r0
-	;;
-}
-{	.mmi
-	stf.spill	[r31]=f31,24+24
-	st8		[r32]=r14,16		// r8
-	add		r8=0,r0
-	;;
-}
-	st8		[r31]=r0,16		// r9
-	st8		[r32]=r0		// r10
-	;;
-{	.mmb
-	st8		[r31]=r0		// r11
-	mf
-	br.ret.sptk	rp
-	;;
-}
-END(_ia64_save_context)
-
-/*
- * void _ia64_break_setcontext(mcontext_t *mc);
- */
-ENTRY(_ia64_break_setcontext, 1)
-{	.mmi
-	mov		r8=r32
-	break		0x180000
-	nop		0
-	;;
-}
-END(_ia64_break_setcontext)
--- lib/libkse/arch/ia64/ia64/enter_uts.S
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2003 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libkse/arch/ia64/ia64/enter_uts.S,v 1.2 2007/10/09 13:42:24 obrien Exp $");
-
-/*
- * void _ia64_enter_uts(kse_func_t uts, struct kse_mailbox *km, void *stack,
- *     size_t stacksz);
- */
-ENTRY(_ia64_enter_uts, 4)
-{	.mmi
-	ld8		r14=[in0],8
-	mov		ar.rsc=0xc
-	add		r15=in2,in3
-	;;
-}
-{	.mmi
-	flushrs
-	ld8		r1=[in0]
-	mov		b7=r14
-	;;
-}
-{	.mii
-	mov		ar.bspstore=in2
-	add		sp=-16,r15
-	mov		rp=r14
-	;;
-}
-{	.mib
-	mov		ar.rsc=0xf
-	mov		in0=in1
-	br.cond.sptk	b7
-	;;
-}
-1:	br.cond.sptk	1b
-END(_ia64_enter_uts)
--- lib/libkse/arch/ia64/ia64/pthread_md.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2003 Daniel Eischen <deischen at freebsd.org>
- * Copyright (c) 2006 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Neither the name of the author nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libkse/arch/ia64/ia64/pthread_md.c,v 1.6 2007/10/09 13:42:24 obrien Exp $
- */
-
-#include <stdlib.h>
-#include <strings.h>
-
-#include "rtld_tls.h"
-#include "pthread_md.h"
-
-/*
- * The constructors.
- */
-struct tcb *
-_tcb_ctor(struct pthread *thread, int initial)
-{
-	register char *tp __asm("%r13");
-	struct tcb *tcb;
-
-	tcb = _rtld_allocate_tls((initial) ? tp : NULL,
-	    sizeof(struct tcb), 16);
-	if (tcb == NULL)
-		return (NULL);
-	tcb->tcb_thread = thread;
-	return (tcb);
-}
-
-void
-_tcb_dtor(struct tcb *tcb)
-{
-
-	_rtld_free_tls(tcb, sizeof(struct tcb), 16);
-}
-
-struct kcb *
-_kcb_ctor(struct kse *kse)
-{
-	struct kcb *kcb;
-
-	kcb = malloc(sizeof(struct kcb));
-	if (kcb == NULL)
-		return (NULL);
-	bzero(kcb, sizeof(struct kcb));
-	kcb->kcb_kse = kse;
-	kcb->kcb_faketcb.tcb_isfake = 1;
-	kcb->kcb_faketcb.tcb_tmbx.tm_flags = TMF_NOUPCALL;
-	kcb->kcb_curtcb = &kcb->kcb_faketcb;
-	return (kcb);
-}
-
-void
-_kcb_dtor(struct kcb *kcb)
-{
-	free(kcb);
-}
--- lib/libkse/arch/ia64/include/pthread_md.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright (c) 2003-2006 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libkse/arch/ia64/include/pthread_md.h,v 1.19 2007/10/09 13:42:24 obrien Exp $
- */
-
-#ifndef _PTHREAD_MD_H_
-#define	_PTHREAD_MD_H_
-
-#include <sys/kse.h>
-#include <stddef.h>
-#include <ucontext.h>
-
-#define	KSE_STACKSIZE		16384
-#define	DTV_OFFSET		offsetof(struct tcb, tcb_tp.tp_dtv)
-
-#define	THR_GETCONTEXT(ucp)	_ia64_save_context(&(ucp)->uc_mcontext)
-#define	THR_SETCONTEXT(ucp)	PANIC("THR_SETCONTEXT() now in use!\n")
-
-#define	PER_THREAD
-
-struct kcb;
-struct kse;
-struct pthread;
-struct tcb;
-
-/*
- * tp points to one of these. We define the TLS structure as a union
- * containing a long double to enforce 16-byte alignment. This makes
- * sure that there will not be any padding in struct tcb after the
- * TLS structure.
- */
-union ia64_tp {
-	void			*tp_dtv;
-	long double		_align_;
-};
-
-struct tcb {
-	struct kse_thr_mailbox	tcb_tmbx;
-	struct pthread		*tcb_thread;
-	struct kcb		*tcb_curkcb;
-	long			tcb_isfake;
-	union ia64_tp		tcb_tp;
-};
-
-struct kcb {
-	struct kse_mailbox	kcb_kmbx;
-	struct kse		*kcb_kse;
-	struct tcb		*kcb_curtcb;
-	struct tcb		kcb_faketcb;
-};
-
-static __inline struct tcb *
-ia64_get_tcb()
-{
-	register char *tp __asm("%r13");
-
-	return ((struct tcb *)(tp - offsetof(struct tcb, tcb_tp)));
-}
-
-static __inline void
-ia64_set_tcb(struct tcb *tcb)
-{
-	register char *tp __asm("%r13");
-
-	__asm __volatile("mov %0 = %1;;" : "=r"(tp) : "r"(&tcb->tcb_tp));
-}
-
-/*
- * The kcb and tcb constructors.
- */
-struct tcb	*_tcb_ctor(struct pthread *, int);
-void		_tcb_dtor(struct tcb *);
-struct kcb	*_kcb_ctor(struct kse *kse);
-void		_kcb_dtor(struct kcb *);
-
-/* Called from the KSE to set its private data. */
-static __inline void
-_kcb_set(struct kcb *kcb)
-{
-	/* There is no thread yet; use the fake tcb. */
-	ia64_set_tcb(&kcb->kcb_faketcb);
-}
-
-/*
- * Get the current kcb.
- *
- * This can only be called while in a critical region; don't
- * worry about having the kcb changed out from under us.
- */
-static __inline struct kcb *
-_kcb_get(void)
-{
-	return (ia64_get_tcb()->tcb_curkcb);
-}
-
-/*
- * Enter a critical region.
- *
- * Read and clear km_curthread in the kse mailbox.
- */
-static __inline struct kse_thr_mailbox *
-_kcb_critical_enter(void)
-{
-	struct tcb *tcb;
-	struct kse_thr_mailbox *crit;
-	uint32_t flags;
-
-	tcb = ia64_get_tcb();
-	if (tcb->tcb_isfake != 0) {
-		/*
-		 * We already are in a critical region since
-		 * there is no current thread.
-		 */
-		crit = NULL;
-	} else {
-		flags = tcb->tcb_tmbx.tm_flags;
-		tcb->tcb_tmbx.tm_flags |= TMF_NOUPCALL;
-		crit = tcb->tcb_curkcb->kcb_kmbx.km_curthread;
-		tcb->tcb_curkcb->kcb_kmbx.km_curthread = NULL;
-		tcb->tcb_tmbx.tm_flags = flags;
-	}
-	return (crit);
-}
-
-static __inline void
-_kcb_critical_leave(struct kse_thr_mailbox *crit)
-{
-	struct tcb *tcb;
-
-	tcb = ia64_get_tcb();
-	/* No need to do anything if this is a fake tcb. */
-	if (tcb->tcb_isfake == 0)
-		tcb->tcb_curkcb->kcb_kmbx.km_curthread = crit;
-}
-
-static __inline int
-_kcb_in_critical(void)
-{
-	struct tcb *tcb;
-	uint32_t flags;
-	int ret;
-
-	tcb = ia64_get_tcb();
-	if (tcb->tcb_isfake != 0) {
-		/*
-		 * We are in a critical region since there is no
-		 * current thread.
-		 */
-		ret = 1;
-	} else {
-		flags = tcb->tcb_tmbx.tm_flags;
-		tcb->tcb_tmbx.tm_flags |= TMF_NOUPCALL;
-		ret = (tcb->tcb_curkcb->kcb_kmbx.km_curthread == NULL);
-		tcb->tcb_tmbx.tm_flags = flags;
-	}
-	return (ret);
-}
-
-static __inline void
-_tcb_set(struct kcb *kcb, struct tcb *tcb)
-{
-	if (tcb == NULL)
-		tcb = &kcb->kcb_faketcb;
-	kcb->kcb_curtcb = tcb;
-	tcb->tcb_curkcb = kcb;
-	ia64_set_tcb(tcb);
-}
-
-static __inline struct tcb *
-_tcb_get(void)
-{
-	return (ia64_get_tcb());
-}
-
-static __inline struct pthread *
-_get_curthread(void)
-{
-	return (ia64_get_tcb()->tcb_thread);
-}
-
-/*
- * Get the current kse.
- *
- * Like _kcb_get(), this can only be called while in a critical region.
- */
-static __inline struct kse *
-_get_curkse(void)
-{
-	return (ia64_get_tcb()->tcb_curkcb->kcb_kse);
-}
-
-void _ia64_break_setcontext(mcontext_t *mc);
-void _ia64_enter_uts(kse_func_t uts, struct kse_mailbox *km, void *stack,
-    size_t stacksz);
-int _ia64_restore_context(mcontext_t *mc, intptr_t val, intptr_t *loc);
-int _ia64_save_context(mcontext_t *mc);
-
-static __inline int
-_thread_enter_uts(struct tcb *tcb, struct kcb *kcb)
-{
-	if (_ia64_save_context(&tcb->tcb_tmbx.tm_context.uc_mcontext) == 0) {
-		/* Make the fake tcb the current thread. */
-		kcb->kcb_curtcb = &kcb->kcb_faketcb;
-		ia64_set_tcb(&kcb->kcb_faketcb);
-		_ia64_enter_uts(kcb->kcb_kmbx.km_func, &kcb->kcb_kmbx,
-		    kcb->kcb_kmbx.km_stack.ss_sp,
-		    kcb->kcb_kmbx.km_stack.ss_size);
-		/* We should not reach here. */
-		return (-1);
-	}
-	return (0);
-}
-
-static __inline int
-_thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox)
-{
-	mcontext_t *mc;
-
-	_tcb_set(kcb, tcb);
-	mc = &tcb->tcb_tmbx.tm_context.uc_mcontext;
-	if (mc->mc_flags & _MC_FLAGS_ASYNC_CONTEXT) {
-		if (setmbox) {
-			mc->mc_flags |= _MC_FLAGS_KSE_SET_MBOX;
-			mc->mc_special.ifa =
-			    (intptr_t)&kcb->kcb_kmbx.km_curthread;
-			mc->mc_special.isr = (intptr_t)&tcb->tcb_tmbx;
-		}
-		_ia64_break_setcontext(mc);
-	} else if (mc->mc_flags & _MC_FLAGS_SYSCALL_CONTEXT) {
-		if (setmbox)
-			kse_switchin(&tcb->tcb_tmbx, KSE_SWITCHIN_SETTMBX);
-		else
-			kse_switchin(&tcb->tcb_tmbx, 0);
-	} else {
-		if (setmbox)
-			_ia64_restore_context(mc, (intptr_t)&tcb->tcb_tmbx,
-			    (intptr_t *)&kcb->kcb_kmbx.km_curthread);
-		else
-			_ia64_restore_context(mc, 0, NULL);
-	}
-	/* We should not reach here. */
-	return (-1);
-}
-
-#endif /* _PTHREAD_MD_H_ */
--- lib/libkse/arch/ia64/include/atomic_ops.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2003 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libkse/arch/ia64/include/atomic_ops.h,v 1.2 2007/10/09 13:42:24 obrien Exp $
- */
-
-#ifndef	_ATOMIC_OPS_H_
-#define	_ATOMIC_OPS_H_
-
-static inline void
-atomic_swap_int(int *dst, int val, int *res)
-{
-	__asm("xchg4	%0=[%2],%1" : "=r"(*res) : "r"(val), "r"(dst));
-}
-
-static inline void
-atomic_swap_long(long *dst, long val, long *res)
-{
-	__asm("xchg8	%0=[%2],%1" : "=r"(*res) : "r"(val), "r"(dst));
-}
-
-#define	atomic_swap_ptr(d,v,r)		\
-	atomic_swap_long((long*)d, (long)v, (long*)r)
-
-#endif /* _ATOMIC_OPS_H_ */
--- lib/libkse/arch/powerpc/Makefile.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-# $FreeBSD: src/lib/libkse/arch/powerpc/Makefile.inc,v 1.2 2007/10/09 13:42:24 obrien Exp $
-
-# XXX temporary
-CFLAGS+=-DSYSTEM_SCOPE_ONLY
-
-.PATH:	${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
-
-SRCS+=	enter_uts.S context.S pthread_md.c
--- lib/libkse/arch/powerpc/include/pthread_md.h
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * Copyright 2004 by Peter Grehan.
- * Copyright 2006 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libkse/arch/powerpc/include/pthread_md.h,v 1.7 2007/10/09 13:42:24 obrien Exp $
- */
-
-/*
- * Machine-dependent thread prototypes/definitions for the thread kernel.
- */
-#ifndef _PTHREAD_MD_H_
-#define	_PTHREAD_MD_H_
-
-#include <sys/kse.h>
-#include <stddef.h>
-#include <ucontext.h>
-
-extern void _ppc32_enter_uts(struct kse_mailbox *, kse_func_t, void *, size_t);
-extern int  _ppc32_setcontext(mcontext_t *, intptr_t, intptr_t *);
-extern int  _ppc32_getcontext(mcontext_t *);
-
-#define	KSE_STACKSIZE		16384
-#define	DTV_OFFSET		offsetof(struct tcb, tcb_tp.tp_dtv)
-
-#define	THR_GETCONTEXT(ucp)	_ppc32_getcontext(&(ucp)->uc_mcontext)
-#define	THR_SETCONTEXT(ucp)	_ppc32_setcontext(&(ucp)->uc_mcontext, 0, NULL)
-
-#define	PER_THREAD
-
-struct kcb;
-struct kse;
-struct pthread;
-struct tcb;
-
-/*
- * %r2 points to the following.
- */
-struct ppc32_tp {
-	void		*tp_dtv;	/* dynamic thread vector */
-	uint32_t	_reserved_;
-	double		tp_tls[0];	/* static TLS */
-};
-
-struct tcb {
-	struct kse_thr_mailbox	tcb_tmbx;
-	struct pthread		*tcb_thread;
-	struct kcb		*tcb_curkcb;
-	long			tcb_isfake;
-	long			tcb_spare[3];
-	struct ppc32_tp		tcb_tp;
-};
-
-struct kcb {
-	struct kse_mailbox	kcb_kmbx;
-	struct kse		*kcb_kse;
-	struct tcb		*kcb_curtcb;
-	struct tcb		kcb_faketcb;
-};
-
-/*
- * From the PowerPC32 TLS spec:
- *
- * "r2 is the thread pointer, and points 0x7000 past the end of the
- * thread control block." Or, 0x7008 past the start of the 8-byte tcb
- */
-#define TP_OFFSET	0x7008
-
-static __inline char *
-ppc_get_tp()
-{
-	register char *r2 __asm__("%r2");
-
-	return (r2 - TP_OFFSET);
-}
-
-static __inline void
-ppc_set_tp(char *tp)
-{
-	register char *r2 __asm__("%r2");
-	__asm __volatile("mr %0,%1" : "=r"(r2) : "r"(tp + TP_OFFSET));
-}
-
-static __inline struct tcb *
-ppc_get_tcb()
-{
-	return ((struct tcb *)(ppc_get_tp() - offsetof(struct tcb, tcb_tp)));
-}
-
-static __inline void
-ppc_set_tcb(struct tcb *tcb)
-{
-	ppc_set_tp((char*)&tcb->tcb_tp);
-}
-
-/*
- * The kcb and tcb constructors.
- */
-struct tcb	*_tcb_ctor(struct pthread *, int);
-void		_tcb_dtor(struct tcb *);
-struct kcb	*_kcb_ctor(struct kse *kse);
-void		_kcb_dtor(struct kcb *);
-
-/* Called from the KSE to set its private data. */
-static __inline void
-_kcb_set(struct kcb *kcb)
-{
-	/* There is no thread yet; use the fake tcb. */
-	ppc_set_tcb(&kcb->kcb_faketcb);
-}
-
-/*
- * Get the current kcb.
- *
- * This can only be called while in a critical region; don't
- * worry about having the kcb changed out from under us.
- */
-static __inline struct kcb *
-_kcb_get(void)
-{
-	return (ppc_get_tcb()->tcb_curkcb);
-}
-
-/*
- * Enter a critical region.
- *
- * Read and clear km_curthread in the kse mailbox.
- */
-static __inline struct kse_thr_mailbox *
-_kcb_critical_enter(void)
-{
-	struct kse_thr_mailbox *crit;
-	struct tcb *tcb;
-	uint32_t flags;
-
-	tcb = ppc_get_tcb();
-	if (tcb->tcb_isfake != 0) {
-		/*
-		 * We already are in a critical region since
-		 * there is no current thread.
-		 */
-		crit = NULL;
-	} else {
-		flags = tcb->tcb_tmbx.tm_flags;
-		tcb->tcb_tmbx.tm_flags |= TMF_NOUPCALL;
-		crit = tcb->tcb_curkcb->kcb_kmbx.km_curthread;
-		tcb->tcb_curkcb->kcb_kmbx.km_curthread = NULL;
-		tcb->tcb_tmbx.tm_flags = flags;
-	}
-	return (crit);
-}
-
-static __inline void
-_kcb_critical_leave(struct kse_thr_mailbox *crit)
-{
-	struct tcb *tcb;
-
-	tcb = ppc_get_tcb();
-
-	/* No need to do anything if this is a fake tcb. */
-	if (tcb->tcb_isfake == 0)
-		tcb->tcb_curkcb->kcb_kmbx.km_curthread = crit;
-}
-
-static __inline int
-_kcb_in_critical(void)
-{
-	struct tcb *tcb;
-	uint32_t flags;
-	int ret;
-
-	tcb = ppc_get_tcb();
-	if (tcb->tcb_isfake != 0) {
-		/*
-		 * We are in a critical region since there is no
-		 * current thread.
-		 */
-		ret = 1;
-	} else {
-		flags = tcb->tcb_tmbx.tm_flags;
-		tcb->tcb_tmbx.tm_flags |= TMF_NOUPCALL;
-		ret = (tcb->tcb_curkcb->kcb_kmbx.km_curthread == NULL);
-		tcb->tcb_tmbx.tm_flags = flags;
-	}
-	return (ret);
-}
-
-static __inline void
-_tcb_set(struct kcb *kcb, struct tcb *tcb)
-{
-        if (tcb == NULL)
-                tcb = &kcb->kcb_faketcb;
-        kcb->kcb_curtcb = tcb;
-        tcb->tcb_curkcb = kcb;
-	ppc_set_tcb(tcb);
-}
-
-static __inline struct tcb *
-_tcb_get(void)
-{
-	return (ppc_get_tcb());
-}
-
-static __inline struct pthread *
-_get_curthread(void)
-{
-	return (ppc_get_tcb()->tcb_thread);
-}
-
-/*
- * Get the current kse.
- *
- * Like _kcb_get(), this can only be called while in a critical region.
- */
-static __inline struct kse *
-_get_curkse(void)
-{
-	return (ppc_get_tcb()->tcb_curkcb->kcb_kse);
-}
-
-static __inline int
-_thread_enter_uts(struct tcb *tcb, struct kcb *kcb)
-{
-	if (_ppc32_getcontext(&tcb->tcb_tmbx.tm_context.uc_mcontext) == 0) {
-		/* Make the fake tcb the current thread. */
-		kcb->kcb_curtcb = &kcb->kcb_faketcb;
-		ppc_set_tcb(&kcb->kcb_faketcb);
-		_ppc32_enter_uts(&kcb->kcb_kmbx, kcb->kcb_kmbx.km_func,
-		    kcb->kcb_kmbx.km_stack.ss_sp,
-		    kcb->kcb_kmbx.km_stack.ss_size - 32);
-		/* We should not reach here. */
-		return (-1);
-	}
-	return (0);
-}
-
-static __inline int
-_thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox)
-{
-	mcontext_t *mc;
-	extern int _libkse_debug;
-
-	_tcb_set(kcb, tcb);
-	mc = &tcb->tcb_tmbx.tm_context.uc_mcontext;
-
-	/*
-	 * A full context needs a system call to restore, so use
-	 * kse_switchin. Otherwise, the partial context can be
-	 * restored with _ppc32_setcontext
-	 */
-	if (mc->mc_vers != _MC_VERSION_KSE && _libkse_debug != 0) {
-		if (setmbox)
-			kse_switchin(&tcb->tcb_tmbx, KSE_SWITCHIN_SETTMBX);
-		else
-			kse_switchin(&tcb->tcb_tmbx, 0);
-	} else {
-		tcb->tcb_tmbx.tm_lwp = kcb->kcb_kmbx.km_lwp;
-		if (setmbox)
-			_ppc32_setcontext(mc, (intptr_t)&tcb->tcb_tmbx,
-			    (intptr_t *)&kcb->kcb_kmbx.km_curthread);
-		else
-			_ppc32_setcontext(mc, 0, NULL);
-	}
-
-	/* We should not reach here. */
-	return (-1);
-}
-
-#endif /* _PTHREAD_MD_H_ */
--- lib/libkse/arch/powerpc/include/atomic_ops.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2004 by Peter Grehan. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libkse/arch/powerpc/include/atomic_ops.h,v 1.2 2007/10/09 13:42:24 obrien Exp $
- */
-
-#ifndef	_ATOMIC_OPS_H_
-#define	_ATOMIC_OPS_H_
-
-/*
- * Atomic swap:
- *   Atomic (tmp = *dst, *dst = val), then *res = tmp
- *
- * void atomic_swap32(intptr_t *dst, intptr_t val, intptr_t *res);
- */
-static inline void
-atomic_swap32(intptr_t *dst, intptr_t val, intptr_t *res)
-{
-	int tmp;
-
-	tmp = 0;	/* should be a better way to quieten cc1... */
-#ifdef __GNUC__
-	__asm __volatile(
-		"1:	lwarx	%0, 0, %4\n"	/* load with reservation */
-		"	stwcx.	%3, 0, %4\n"	/* attempt to store val */
-		"	bne- 1b\n"		/* interrupted? retry */
-		"	stw	%0, %1\n"	/* else, *dst -> *res */
-		: "=&r" (tmp), "=m" (*res), "+m" (*dst)
-		: "r" (val), "r" (dst)
-		: "cc", "memory");
-#endif
-}
-
-#define	atomic_swap_ptr(d, v, r) \
-	atomic_swap32((intptr_t *)d, (intptr_t)v, (intptr_t *)r)
-
-#define	atomic_swap_int(d, v, r) \
-	atomic_swap32((intptr_t *)d, (intptr_t)v, (intptr_t *)r)
-#endif
--- lib/libkse/arch/powerpc/powerpc/context.S
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2004 Peter Grehan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libkse/arch/powerpc/powerpc/context.S,v 1.2 2007/10/09 13:42:25 obrien Exp $");
-
-#include "assym.s"
-
-/*
- * int _ppc32_getcontext(mcontext_t *mcp)
- *
- *   Save register state from a voluntary context switch.
- * Only volatile registers, and those needed to complete
- * a setcontext call, need to be saved.
- *
- *	r1
- *	r14-31
- *	f14-31		XXX
- *	lr
- *
- *  Return 0 for this call, and set up the context so it will return
- * 1 when restored with _ppc32_setcontext().
- *
- * XXX XXX
- *  Floating-point is a big issue. Since there's no way to determine
- * if the caller has used FP, all volatile register need to be saved.
- * If FP hasn't been used, this results in a lazy FP exception in
- * the kernel and from that point on FP is always switched in/out
- * for the thread, which may be a big performance drag for the system.
- *  An alternative is to use a system call to get the context, which
- * will do the right thing for floating point, but will save all
- * registers rather than the caller-saved subset, and has the overhead
- * of a syscall.
- *  Maybe another option would be to give a light-weight way for a
- * thread to determine if FP is in used: perhaps a syscall that
- * returns in the asm traphandler, or an OSX-style read-only page
- * with a flag to indicate FP state.
- *
- * For now, punt the issue ala Alpha 1:1 model and fix in the future.
- */
-ENTRY(_ppc32_getcontext)
-	stw	%r1,  _MC_R1(%r3)
-	stw	%r13, _MC_R13(%r3)
-	stw	%r14, _MC_R14(%r3)
-	stw	%r15, _MC_R15(%r3)
-	stw	%r16, _MC_R16(%r3)
-	stw	%r17, _MC_R17(%r3)
-	stw	%r18, _MC_R18(%r3)
-	stw	%r19, _MC_R19(%r3)
-	stw	%r20, _MC_R20(%r3)
-	stw	%r21, _MC_R21(%r3)
-	stw	%r22, _MC_R22(%r3)
-	stw	%r23, _MC_R23(%r3)
-	stw	%r24, _MC_R24(%r3)
-	stw	%r25, _MC_R25(%r3)
-	stw	%r26, _MC_R26(%r3)
-	stw	%r27, _MC_R27(%r3)
-	stw	%r28, _MC_R28(%r3)
-	stw	%r29, _MC_R28(%r3)
-	stw	%r30, _MC_R30(%r3)
-	stw	%r31, _MC_R31(%r3)
-	mflr	%r4
-	stw	%r4,  _MC_LR(%r3)
-	mfcr	%r4
-	stw	%r4,  _MC_CR(%r3)
-
-	/* XXX f14-31 ? */
-
-	li	%r4, _MC_VERSION_KSE	/* partial ucontext version */
-	stw	%r4, _MC_VERS(%r3)
-
-	/* Return 0 */
-	li	%r3, 0
-	blr
-
-/*
- *	int _ppc32_setcontext(const mcontext_t *mcp, intptr_t val,
- *	    intptr_t *loc);
- *
- *  Should only be called for partial KSE contexts. The full context
- * case is handled by kse_switchin() in _thread_switch()
- *
- *  Returns -1 on error and 1 for return from a saved context
- */
-
-ENTRY(_ppc32_setcontext)
-	lwz	%r6, _MC_VERS(%r3)
-	cmpwi	%r6, _MC_VERSION_KSE	/* KSE partial context ? */
-	beq	1f
-	li	%r3, -1			/* invalid context type, return -1 */
-	blr
-
-1:	/* partial format, callee-saved regs assumed */
-	lwz	%r1,  _MC_R1(%r3)
-	lwz	%r13, _MC_R13(%r3)
-	lwz	%r14, _MC_R14(%r3)
-	lwz	%r15, _MC_R15(%r3)
-	lwz	%r16, _MC_R16(%r3)
-	lwz	%r17, _MC_R17(%r3)
-	lwz	%r18, _MC_R18(%r3)
-	lwz	%r19, _MC_R19(%r3)
-	lwz	%r20, _MC_R20(%r3)
-	lwz	%r21, _MC_R21(%r3)
-	lwz	%r22, _MC_R22(%r3)
-	lwz	%r23, _MC_R23(%r3)
-	lwz	%r24, _MC_R24(%r3)
-	lwz	%r25, _MC_R25(%r3)
-	lwz	%r26, _MC_R26(%r3)
-	lwz	%r27, _MC_R27(%r3)
-	lwz	%r28, _MC_R28(%r3)
-	lwz	%r29, _MC_R28(%r3)
-	lwz	%r30, _MC_R30(%r3)
-	lwz	%r31, _MC_R31(%r3)
-	lwz	%r6,  _MC_LR(%r3)
-	mtlr	%r6
-	lwz	%r6,  _MC_CR(%r3)
-	mtcr	%r6
-
-	/*  XXX f14-31 ? */
-
-	/* if (loc != NULL) *loc = val */
-	cmpwi	%r5, 0
-	beq	2f
-	stw	%r4, 0(%r5)
-
-	/* Return 1 */
-2:	li	%r3, 1
-	blr
--- lib/libkse/arch/powerpc/powerpc/assym.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2004 Peter Grehan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libkse/arch/powerpc/powerpc/assym.c,v 1.2 2007/10/09 13:42:25 obrien Exp $
- */
-
-/* Used to generate mcontext_t offsets */
-
-#include <sys/types.h>
-#include <sys/assym.h>
-#include <sys/ucontext.h>
-
-#include <stddef.h>
-
-ASSYM(_MC_VERSION, _MC_VERSION);
-ASSYM(_MC_VERSION_KSE, _MC_VERSION_KSE);
-ASSYM(_MC_FP_VALID, _MC_FP_VALID);
-
-ASSYM(_MC_VERS, offsetof(mcontext_t, mc_vers));
-ASSYM(_MC_FLAGS, offsetof(mcontext_t, mc_flags));
-
-ASSYM(_MC_R0,  offsetof(mcontext_t, mc_frame[0]));
-ASSYM(_MC_R1,  offsetof(mcontext_t, mc_frame[1]));
-ASSYM(_MC_R2,  offsetof(mcontext_t, mc_frame[2]));
-ASSYM(_MC_R3,  offsetof(mcontext_t, mc_frame[3]));
-ASSYM(_MC_R4,  offsetof(mcontext_t, mc_frame[4]));
-ASSYM(_MC_R5,  offsetof(mcontext_t, mc_frame[5]));
-ASSYM(_MC_R6,  offsetof(mcontext_t, mc_frame[6]));
-ASSYM(_MC_R7,  offsetof(mcontext_t, mc_frame[7]));
-ASSYM(_MC_R8,  offsetof(mcontext_t, mc_frame[8]));
-ASSYM(_MC_R9,  offsetof(mcontext_t, mc_frame[9]));
-ASSYM(_MC_R10, offsetof(mcontext_t, mc_frame[10]));
-ASSYM(_MC_R11, offsetof(mcontext_t, mc_frame[11]));
-ASSYM(_MC_R12, offsetof(mcontext_t, mc_frame[12]));
-ASSYM(_MC_R13, offsetof(mcontext_t, mc_frame[13]));
-ASSYM(_MC_R14, offsetof(mcontext_t, mc_frame[14]));
-ASSYM(_MC_R15, offsetof(mcontext_t, mc_frame[15]));
-ASSYM(_MC_R16, offsetof(mcontext_t, mc_frame[16]));
-ASSYM(_MC_R17, offsetof(mcontext_t, mc_frame[17]));
-ASSYM(_MC_R18, offsetof(mcontext_t, mc_frame[18]));
-ASSYM(_MC_R19, offsetof(mcontext_t, mc_frame[19]));
-ASSYM(_MC_R20, offsetof(mcontext_t, mc_frame[20]));
-ASSYM(_MC_R21, offsetof(mcontext_t, mc_frame[21]));
-ASSYM(_MC_R22, offsetof(mcontext_t, mc_frame[22]));
-ASSYM(_MC_R23, offsetof(mcontext_t, mc_frame[23]));
-ASSYM(_MC_R24, offsetof(mcontext_t, mc_frame[24]));
-ASSYM(_MC_R25, offsetof(mcontext_t, mc_frame[25]));
-ASSYM(_MC_R26, offsetof(mcontext_t, mc_frame[26]));
-ASSYM(_MC_R27, offsetof(mcontext_t, mc_frame[27]));
-ASSYM(_MC_R28, offsetof(mcontext_t, mc_frame[28]));
-ASSYM(_MC_R29, offsetof(mcontext_t, mc_frame[29]));
-ASSYM(_MC_R30, offsetof(mcontext_t, mc_frame[30]));
-ASSYM(_MC_R31, offsetof(mcontext_t, mc_frame[31]));
-ASSYM(_MC_LR,  offsetof(mcontext_t, mc_frame[32]));
-ASSYM(_MC_CR,  offsetof(mcontext_t, mc_frame[33]));
-ASSYM(_MC_XER, offsetof(mcontext_t, mc_frame[34]));
-ASSYM(_MC_CTR, offsetof(mcontext_t, mc_frame[35]));
-
-ASSYM(_MC_FPSCR, offsetof(mcontext_t, mc_fpreg[32]));
-ASSYM(_MC_F0,  offsetof(mcontext_t, mc_fpreg[0]));
-ASSYM(_MC_F1,  offsetof(mcontext_t, mc_fpreg[1]));
-ASSYM(_MC_F2,  offsetof(mcontext_t, mc_fpreg[2]));
-ASSYM(_MC_F3,  offsetof(mcontext_t, mc_fpreg[3]));
-ASSYM(_MC_F4,  offsetof(mcontext_t, mc_fpreg[4]));
-ASSYM(_MC_F5,  offsetof(mcontext_t, mc_fpreg[5]));
-ASSYM(_MC_F6,  offsetof(mcontext_t, mc_fpreg[6]));
-ASSYM(_MC_F7,  offsetof(mcontext_t, mc_fpreg[7]));
-ASSYM(_MC_F8,  offsetof(mcontext_t, mc_fpreg[8]));
-ASSYM(_MC_F9,  offsetof(mcontext_t, mc_fpreg[9]));
-ASSYM(_MC_F10, offsetof(mcontext_t, mc_fpreg[10]));
-ASSYM(_MC_F11, offsetof(mcontext_t, mc_fpreg[11]));
-ASSYM(_MC_F12, offsetof(mcontext_t, mc_fpreg[12]));
-ASSYM(_MC_F13, offsetof(mcontext_t, mc_fpreg[13]));
-ASSYM(_MC_F14, offsetof(mcontext_t, mc_fpreg[14]));
-ASSYM(_MC_F15, offsetof(mcontext_t, mc_fpreg[15]));
-ASSYM(_MC_F16, offsetof(mcontext_t, mc_fpreg[16]));
-ASSYM(_MC_F17, offsetof(mcontext_t, mc_fpreg[17]));
-ASSYM(_MC_F18, offsetof(mcontext_t, mc_fpreg[18]));
-ASSYM(_MC_F19, offsetof(mcontext_t, mc_fpreg[19]));
-ASSYM(_MC_F20, offsetof(mcontext_t, mc_fpreg[20]));
-ASSYM(_MC_F21, offsetof(mcontext_t, mc_fpreg[21]));
-ASSYM(_MC_F22, offsetof(mcontext_t, mc_fpreg[22]));
-ASSYM(_MC_F23, offsetof(mcontext_t, mc_fpreg[23]));
-ASSYM(_MC_F24, offsetof(mcontext_t, mc_fpreg[24]));
-ASSYM(_MC_F25, offsetof(mcontext_t, mc_fpreg[25]));
-ASSYM(_MC_F26, offsetof(mcontext_t, mc_fpreg[26]));
-ASSYM(_MC_F27, offsetof(mcontext_t, mc_fpreg[27]));
-ASSYM(_MC_F28, offsetof(mcontext_t, mc_fpreg[28]));
-ASSYM(_MC_F29, offsetof(mcontext_t, mc_fpreg[29]));
-ASSYM(_MC_F30, offsetof(mcontext_t, mc_fpreg[30]));
-ASSYM(_MC_F31, offsetof(mcontext_t, mc_fpreg[31]));
--- lib/libkse/arch/powerpc/powerpc/enter_uts.S
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2004 Peter Grehan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libkse/arch/powerpc/powerpc/enter_uts.S,v 1.2 2007/10/09 13:42:25 obrien Exp $");
-
-/*
- * _ppc32_enter_uts(struct kse_mailbox *km, kse_func_t uts, void *stack,
- *     long stacksz);
- *
- *  Call (*uts)(km) on the requested stack. This function doesn't
- * return. The km parameter stays in %r3.
- */
-ENTRY(_ppc32_enter_uts)
-	add	%r1,%r5,%r6	/* new stack = stack + stacksz */
-	mtlr	%r4		/* link register = uts */
-	blrl			/* (*uts)(km) */
--- lib/libkse/arch/powerpc/powerpc/assym.s
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2004 Peter Grehan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libkse/arch/powerpc/powerpc/assym.s,v 1.2 2007/10/09 13:42:25 obrien Exp $
- */
-
-/*
- * Struct offsets for version 0x1 of the mcontext struct.
- * Generated with
- *   cc -c assym.c
- *   ${SYSSRC}/kern/genassym.sh assym.o > assym_syms.s
- *   hand-edit output
- */
-#define _MC_VERSION     0x1
-#define _MC_VERSION_KSE 0xee
-#define _MC_FP_VALID    0x1
-
-#define _MC_VERS        0x0
-#define _MC_FLAGS       0x4
-
-#define _MC_R0	0x298
-#define _MC_R1  0x21c
-#define _MC_R2  0x220
-#define _MC_R3  0x224
-#define _MC_R4  0x228
-#define _MC_R5  0x22c
-#define _MC_R6  0x230
-#define _MC_R7  0x234
-#define _MC_R8  0x238
-#define _MC_R9  0x23c
-#define _MC_R10 0x240
-#define _MC_R11 0x244
-#define _MC_R12 0x248
-#define _MC_R13 0x24c
-#define _MC_R14 0x250
-#define _MC_R15 0x254
-#define _MC_R16 0x258
-#define _MC_R17 0x25c
-#define _MC_R18 0x260
-#define _MC_R19 0x264
-#define _MC_R20 0x268
-#define _MC_R21 0x26c
-#define _MC_R22 0x270
-#define _MC_R23 0x274
-#define _MC_R24 0x278
-#define _MC_R25 0x27c
-#define _MC_R26 0x280
-#define _MC_R27 0x284
-#define _MC_R28 0x288
-#define _MC_R29 0x28c
-#define _MC_R30 0x290
-#define _MC_R31 0x294
-#define _MC_LR  0x298
-#define _MC_CR  0x29c
-#define _MC_XER 0x2a0
-#define _MC_CTR 0x2a4
-
-#define _MC_FPSCR       0x3c0
-#define _MC_F0  0x2c0
-#define _MC_F1  0x2c8
-#define _MC_F2  0x2d0
-#define _MC_F3  0x2d8
-#define _MC_F4  0x2e0
-#define _MC_F5  0x2e8
-#define _MC_F6  0x2f0
-#define _MC_F7  0x2f8
-#define _MC_F8  0x300
-#define _MC_F9  0x308
-#define _MC_F10 0x310
-#define _MC_F11 0x318
-#define _MC_F12 0x320
-#define _MC_F13 0x328
-#define _MC_F14 0x330
-#define _MC_F15 0x338
-#define _MC_F16 0x340
-#define _MC_F17 0x348
-#define _MC_F18 0x350
-#define _MC_F19 0x358
-#define _MC_F20 0x360
-#define _MC_F21 0x368
-#define _MC_F22 0x370
-#define _MC_F23 0x378
-#define _MC_F24 0x380
-#define _MC_F25 0x388
-#define _MC_F26 0x390
-#define _MC_F27 0x398
-#define _MC_F28 0x3a0
-#define _MC_F29 0x3a8
-#define _MC_F30 0x3b0
-#define _MC_F31 0x3b8
-
--- lib/libkse/arch/powerpc/powerpc/pthread_md.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2003 Daniel Eischen <deischen at freebsd.org>
- * Copyright (c) 2006 Marcel Moolenaar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Neither the name of the author nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libkse/arch/powerpc/powerpc/pthread_md.c,v 1.5 2007/10/09 13:42:25 obrien Exp $");
-
-#include <stdlib.h>
-#include <strings.h>
-
-#include "rtld_tls.h"
-#include "pthread_md.h"
-
-/*
- * The constructors.
- */
-struct tcb *
-_tcb_ctor(struct pthread *thread, int initial)
-{
-	struct tcb *tcb;
-
-	tcb = _rtld_allocate_tls((initial) ? ppc_get_tp() : NULL,
-	    sizeof(struct tcb), 8);
-	if (tcb == NULL)
-		return (NULL);
-	tcb->tcb_thread = thread;
-	return (tcb);
-}
-
-void
-_tcb_dtor(struct tcb *tcb)
-{
-	_rtld_free_tls(tcb, sizeof(struct tcb), 8);
-}
-
-struct kcb *
-_kcb_ctor(struct kse *kse)
-{
-	struct kcb *kcb;
-
-	kcb = malloc(sizeof(struct kcb));
-	if (kcb == NULL)
-		return (NULL);
-	bzero(kcb, sizeof(struct kcb));
-	kcb->kcb_kse = kse;
-	kcb->kcb_faketcb.tcb_isfake = 1;
-	kcb->kcb_faketcb.tcb_tmbx.tm_flags = TMF_NOUPCALL;
-	kcb->kcb_curtcb = &kcb->kcb_faketcb;
-	return (kcb);
-}
-
-void
-_kcb_dtor(struct kcb *kcb)
-{
-	free(kcb);
-}


More information about the Midnightbsd-cvs mailing list