[Midnightbsd-cvs] src: libpthread/sys: Remove old architectures.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Mon Apr 28 11:32:33 EDT 2008
Log Message:
-----------
Remove old architectures.
$MidnightBSD$
Modified Files:
--------------
src/lib/libpthread/arch/amd64:
Makefile.inc (r1.1.1.1 -> r1.2)
src/lib/libpthread/arch/arm:
Makefile.inc (r1.1.1.1 -> r1.2)
src/lib/libpthread/arch/i386:
Makefile.inc (r1.1.1.1 -> r1.2)
src/lib/libpthread/arch/ia64:
Makefile.inc (r1.1.1.1 -> r1.2)
src/lib/libpthread/arch/sparc64:
Makefile.inc (r1.1.1.1 -> r1.2)
src/lib/libpthread/support:
Makefile.inc (r1.1.1.1 -> r1.2)
src/lib/libpthread/sys:
Makefile.inc (r1.1.1.1 -> r1.2)
src/lib/libpthread/test:
Makefile (r1.2 -> r1.3)
src/lib/libpthread/thread:
Makefile.inc (r1.1.1.1 -> r1.2)
Removed Files:
-------------
src/lib/libpthread/arch/alpha:
Makefile.inc
src/lib/libpthread/arch/alpha/alpha:
context.S
enter_uts.S
pthread_md.c
src/lib/libpthread/arch/alpha/include:
atomic_ops.h
pthread_md.h
src/lib/libpthread/arch/powerpc:
Makefile.inc
src/lib/libpthread/arch/powerpc/include:
atomic_ops.h
pthread_md.h
src/lib/libpthread/arch/powerpc/powerpc:
assym.c
assym.s
context.S
enter_uts.S
pthread_md.c
-------------- next part --------------
--- lib/libpthread/arch/alpha/alpha/context.S
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Copyright (c) 2001,3 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.
- */
-/*
- * Copyright (c) 1994, 1995 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution at CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- *
- */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libpthread/arch/alpha/alpha/context.S,v 1.2 2003/10/02 20:51:30 deischen Exp $");
-
-/* #include <machine/frame.h> */
-#define FRAME_V0 0
-#define FRAME_T0 1
-#define FRAME_T1 2
-#define FRAME_T2 3
-#define FRAME_T3 4
-#define FRAME_T4 5
-#define FRAME_T5 6
-#define FRAME_T6 7
-#define FRAME_T7 8
-#define FRAME_S0 9
-#define FRAME_S1 10
-#define FRAME_S2 11
-#define FRAME_S3 12
-#define FRAME_S4 13
-#define FRAME_S5 14
-#define FRAME_S6 15
-#define FRAME_A3 16
-#define FRAME_A4 17
-#define FRAME_A5 18
-#define FRAME_RA 23
-#define FRAME_T12 24
-#define FRAME_AT 25
-#define FRAME_SP 26
-#define FRAME_TRAPARG_A0 28
-#define FRAME_TRAPARG_A1 29
-#define FRAME_TRAPARG_A2 30
-#define FRAME_PC (FRAME_TRAPARG_A2 + 1 + 1)
-
-/* #include <machine/reg.h> */
-#define R_V0 0
-#define R_T0 1
-#define R_T1 2
-#define R_T2 3
-#define R_T3 4
-#define R_T4 5
-#define R_T5 6
-#define R_T6 7
-#define R_T7 8
-#define R_S0 9
-#define R_S1 10
-#define R_S2 11
-#define R_S3 12
-#define R_S4 13
-#define R_S5 14
-#define R_S6 15
-#define R_A0 16
-#define R_A1 17
-#define R_A2 18
-#define R_A3 19
-#define R_A4 20
-#define R_A5 21
-#define R_T8 22
-#define R_T9 23
-#define R_T10 24
-#define R_T11 25
-#define R_RA 26
-#define R_T12 27
-#define R_SP 30
-#define R_ZERO 31
-
-/*
- * XXX - The rev id's are defined in <machine/ucontext.h>
- */
-#define MC_FMT_OFFSET 73*8 /* offset to format from mcontext */
-#define REV0_SIGFRAME 0x0001 /* rev R0 sigcontext format */
-#define REV0_TRAPFRAME 0x0002 /* rev R0 trapframe format */
-
-/*
- * int _alpha_restore_context(const mcontext_t *mcp,
- * intptr_t val, intptr_t *loc);
- *
- * The format of the context is verified at the beginning.
- * Returns -1 if invalid format.
- */
- .set noreorder
-LEAF(_alpha_restore_context, 3)
- LDGP(pv)
- bne a0, Lsc1 /* argument null? */
-Lscbad: ldiq v0, -1 /* return -1 */
- br Lscend
-Lsc1: ldq t1, MC_FMT_OFFSET(a0) /* is mcontext valid format? */
- ldiq t0, REV0_TRAPFRAME
- cmpeq t0, t1, t0 /* is it trapframe format? */
- bne t0, Lsc_fp /* if so, check fp state */
- ldiq t0, REV0_SIGFRAME
- cmpeq t0, t1, t0 /* is it sigcontext format? */
- beq t0, Lscbad
- /* supposedly sigcontext format, check magic number */
- ldiq t0, 0xACEDBADE /* check magic number */
- ldq t1, ((R_ZERO + 1) * 8)(a0) /* magic in mc_regs[R_ZERO] */
- cmpeq t0, t1, t0
- beq t0, Lscbad
- /* restore floating point regs first */
-Lsc_fp: ldq t0, ((71 + 1) * 8)(a0) /* if FP regs not saved, */
- beq t0, Lsc2 /* skip setting FP regs */
- ldt $f0, ((37 + 1) * 8)(a0) /* restore FP regs using */
- ldt $f1, ((38 + 1) * 8)(a0) /* hw name */
- ldt $f2, ((39 + 1) * 8)(a0)
- ldt $f3, ((40 + 1) * 8)(a0)
- ldt $f4, ((41 + 1) * 8)(a0)
- ldt $f5, ((42 + 1) * 8)(a0)
- ldt $f6, ((43 + 1) * 8)(a0)
- ldt $f7, ((44 + 1) * 8)(a0)
- ldt $f8, ((45 + 1) * 8)(a0)
- ldt $f9, ((46 + 1) * 8)(a0)
- ldt $f10, ((47 + 1) * 8)(a0)
- ldt $f11, ((48 + 1) * 8)(a0)
- ldt $f12, ((49 + 1) * 8)(a0)
- ldt $f13, ((50 + 1) * 8)(a0)
- ldt $f14, ((51 + 1) * 8)(a0)
- ldt $f15, ((52 + 1) * 8)(a0)
- ldt $f16, ((53 + 1) * 8)(a0)
- ldt $f17, ((54 + 1) * 8)(a0)
- ldt $f18, ((55 + 1) * 8)(a0)
- ldt $f19, ((56 + 1) * 8)(a0)
- ldt $f20, ((57 + 1) * 8)(a0)
- ldt $f21, ((58 + 1) * 8)(a0)
- ldt $f22, ((59 + 1) * 8)(a0)
- ldt $f23, ((60 + 1) * 8)(a0)
- ldt $f24, ((61 + 1) * 8)(a0)
- ldt $f25, ((62 + 1) * 8)(a0)
- ldt $f26, ((63 + 1) * 8)(a0)
- ldt $f27, ((64 + 1) * 8)(a0)
- .set noat
- ldt $f28, ((65 + 1) * 8)(a0)
- .set at
- ldt $f29, ((66 + 1) * 8)(a0)
- ldt $f30, ((67 + 1) * 8)(a0)
- /* $f31 is hardwired zero */
- ldt ft0, ((69 + 1) * 8)(a0) /* restore FP control reg */
- mt_fpcr ft0
-Lsc2: ldiq t0, REV0_SIGFRAME /* check the context format */
- ldq t1, MC_FMT_OFFSET(a0) /* again. */
- cmpeq t0, t1, t0 /* is it sigcontext format? */
- bne t0, Lsc_sc
- /* trapframe format */
- ldq v0, ((FRAME_V0 + 1) * 8)(a0) /* restore v0 */
- ldq t0, ((FRAME_T0 + 1) * 8)(a0) /* restore t0-t7 */
- ldq t1, ((FRAME_T1 + 1) * 8)(a0)
- ldq t2, ((FRAME_T2 + 1) * 8)(a0)
- ldq t3, ((FRAME_T3 + 1) * 8)(a0)
- ldq t4, ((FRAME_T4 + 1) * 8)(a0)
- ldq t5, ((FRAME_T5 + 1) * 8)(a0)
- ldq t6, ((FRAME_T6 + 1) * 8)(a0)
- ldq t7, ((FRAME_T7 + 1) * 8)(a0)
- ldq s0, ((FRAME_S0 + 1) * 8)(a0) /* restore s0-s6 */
- ldq s1, ((FRAME_S1 + 1) * 8)(a0)
- ldq s2, ((FRAME_S2 + 1) * 8)(a0)
- ldq s3, ((FRAME_S3 + 1) * 8)(a0)
- ldq s4, ((FRAME_S4 + 1) * 8)(a0)
- ldq s5, ((FRAME_S5 + 1) * 8)(a0)
- ldq s6, ((FRAME_S6 + 1) * 8)(a0)
- ldq a4, ((FRAME_A4 + 1) * 8)(a0) /* restore a4, a5 */
- ldq a5, ((FRAME_A5 + 1) * 8)(a0)
- ldq ra, ((FRAME_RA + 1) * 8)(a0)
- ldq sp, ((FRAME_SP + 1) * 8)(a0)
- subq sp, 16, sp /* save room on stack */
- ldq a3, ((FRAME_TRAPARG_A1 + 1) * 8)(a0)
- stq a3, 0(a0) /* save a1 on stack */
- ldq a3, ((FRAME_TRAPARG_A2 + 1) * 8)(a0)
- stq a3, 8(a0) /* save a2 on stack */
- .set noat
- ldq at_reg, ((FRAME_PC + 1) * 8)(a0) /* PC at time of trap? */
- .set at
- ldq a3, ((FRAME_A3 + 1) * 8)(a0) /* restore a3 */
- ldq a0, ((FRAME_TRAPARG_A0 + 1) * 8)(a0) /* restore a0 */
- br Lsc3
-Lsc_sc: /* sigcontext format */
- ldq v0, ((R_V0 + 1) * 8)(a0) /* restore v0 */
- ldq t0, ((R_T0 + 1) * 8)(a0) /* restore t0-t7 */
- ldq t1, ((R_T1 + 1) * 8)(a0)
- ldq t2, ((R_T2 + 1) * 8)(a0)
- ldq t3, ((R_T3 + 1) * 8)(a0)
- ldq t4, ((R_T4 + 1) * 8)(a0)
- ldq t5, ((R_T5 + 1) * 8)(a0)
- ldq t6, ((R_T6 + 1) * 8)(a0)
- ldq t7, ((R_T7 + 1) * 8)(a0)
- ldq s0, ((R_S0 + 1) * 8)(a0) /* restore s0-s6 */
- ldq s1, ((R_S1 + 1) * 8)(a0)
- ldq s2, ((R_S2 + 1) * 8)(a0)
- ldq s3, ((R_S3 + 1) * 8)(a0)
- ldq s4, ((R_S4 + 1) * 8)(a0)
- ldq s5, ((R_S5 + 1) * 8)(a0)
- ldq s6, ((R_S6 + 1) * 8)(a0)
- ldq a4, ((R_A4 + 1) * 8)(a0) /* restore a4, a5 */
- ldq a5, ((R_A5 + 1) * 8)(a0)
- ldq ra, ((R_RA + 1) * 8)(a0)
- ldq sp, ((R_SP + 1) * 8)(a0)
- subq sp, 16, sp /* save room on stack */
- ldq a3, ((R_A1 + 1) * 8)(a0) /* get a1 */
- stq a3, 0(a0) /* save a1 on stack */
- ldq a3, ((R_A2 + 1) * 8)(a0) /* get a2 */
- stq a3, 8(a0) /* save a2 on stack */
- ldq a3, ((R_A3 + 1) * 8)(a0) /* restore a3 */
- ldq a0, ((R_A0 + 1) * 8)(a0) /* restore a0 */
-Lsc3: beq a2, Lsc4
- stq a1, 0(a2)
-Lsc4: ldq a1, 0(sp) /* restore a1, a2 */
- ldq a2, 8(sp)
- addq sp, 16, sp /* restore stack */
-Lscend: RET
-END(_alpha_restore_context)
-
-
-/*
- * int _alpha_save_context(mcontext_t *);
- *
- * Always save in trapframe format. Floating point registers are
- * saved but may be optimized away later (see comments below).
- */
-LEAF(_alpha_save_context, 1)
- LDGP(pv)
- bne a0, Lgc1 /* argument null? */
- ldiq v0, -1 /* return -1 */
- br Lgcend
-Lgc1: ldiq v0, 1 /* save_context returns 1, */
- stq v0, ((FRAME_V0 + 1) * 8)(a0) /* so save 1 in v0 */
- stq t0, ((FRAME_T0 + 1) * 8)(a0) /* save t0-t7 */
- stq t1, ((FRAME_T1 + 1) * 8)(a0)
- stq t2, ((FRAME_T2 + 1) * 8)(a0)
- stq t3, ((FRAME_T3 + 1) * 8)(a0)
- stq t4, ((FRAME_T4 + 1) * 8)(a0)
- stq t5, ((FRAME_T5 + 1) * 8)(a0)
- stq t6, ((FRAME_T6 + 1) * 8)(a0)
- stq t7, ((FRAME_T7 + 1) * 8)(a0)
- stq s0, ((FRAME_S0 + 1) * 8)(a0) /* save s0-s6 */
- stq s1, ((FRAME_S1 + 1) * 8)(a0)
- stq s2, ((FRAME_S2 + 1) * 8)(a0)
- stq s3, ((FRAME_S3 + 1) * 8)(a0)
- stq s4, ((FRAME_S4 + 1) * 8)(a0)
- stq s5, ((FRAME_S5 + 1) * 8)(a0)
- stq s6, ((FRAME_S6 + 1) * 8)(a0)
- stq a0, ((FRAME_TRAPARG_A0 + 1) * 8)(a0) /* save a0-a5 */
- stq a1, ((FRAME_TRAPARG_A1 + 1) * 8)(a0)
- stq a2, ((FRAME_TRAPARG_A2 + 1) * 8)(a0)
- stq a3, ((FRAME_A3 + 1) * 8)(a0)
- stq a4, ((FRAME_A4 + 1) * 8)(a0)
- stq a5, ((FRAME_A5 + 1) * 8)(a0)
- stq ra, ((FRAME_RA + 1) * 8)(a0)
- stq sp, ((FRAME_SP + 1) * 8)(a0)
- ldiq t0, REV0_TRAPFRAME /* store trapframe format in */
- stq t0, MC_FMT_OFFSET(a0) /* ucp->uc-rev */
- /*
- * XXX - Do we really need to save floating point registers?
- *
- * This is an explicit call to get the current context, so
- * shouldn't the caller be done with the floating point registers?
- * Contexts formed by involuntary switches, such as signal delivery,
- * should have floating point registers saved by the kernel.
- */
-#if 1
- stq zero, ((71 + 1) * 8)(a0) /* FP regs are not saved */
-#else
- ldiq t0, 1 /* say we've used FP, */
- stq t0, ((71 + 1) * 8)(a0) /* mc_ownedfp = 1 */
- stt $f0, ((37 + 1) * 8)(a0) /* save first register, using */
- stt $f1, ((38 + 1) * 8)(a0) /* hw name etc. */
- stt $f2, ((39 + 1) * 8)(a0)
- stt $f3, ((40 + 1) * 8)(a0)
- stt $f4, ((41 + 1) * 8)(a0)
- stt $f5, ((42 + 1) * 8)(a0)
- stt $f6, ((43 + 1) * 8)(a0)
- stt $f7, ((44 + 1) * 8)(a0)
- stt $f8, ((45 + 1) * 8)(a0)
- stt $f9, ((46 + 1) * 8)(a0)
- stt $f10, ((47 + 1) * 8)(a0)
- stt $f11, ((48 + 1) * 8)(a0)
- stt $f12, ((49 + 1) * 8)(a0)
- stt $f13, ((50 + 1) * 8)(a0)
- stt $f14, ((51 + 1) * 8)(a0)
- stt $f15, ((52 + 1) * 8)(a0)
- stt $f16, ((53 + 1) * 8)(a0)
- stt $f17, ((54 + 1) * 8)(a0)
- stt $f18, ((55 + 1) * 8)(a0)
- stt $f19, ((56 + 1) * 8)(a0)
- stt $f20, ((57 + 1) * 8)(a0)
- stt $f21, ((58 + 1) * 8)(a0)
- stt $f22, ((59 + 1) * 8)(a0)
- stt $f23, ((60 + 1) * 8)(a0)
- stt $f24, ((61 + 1) * 8)(a0)
- stt $f25, ((62 + 1) * 8)(a0)
- stt $f26, ((63 + 1) * 8)(a0)
- stt $f27, ((64 + 1) * 8)(a0)
- .set noat
- stt $f28, ((65 + 1) * 8)(a0)
- .set at
- stt $f29, ((66 + 1) * 8)(a0)
- stt $f30, ((67 + 1) * 8)(a0)
- /* $f31 is hardwired zero */
-#endif
- mf_fpcr ft0 /* get FP control reg */
- stt ft0, ((69 + 1) * 8)(a0) /* and store it in mc_fpcr */
- stq zero, ((70 + 1) * 8)(a0) /* FP software control XXX */
- mov zero, v0 /* return zero */
-Lgcend: RET
-END(_alpha_save_context)
--- lib/libpthread/arch/alpha/alpha/enter_uts.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 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 <machine/asm.h>
-__FBSDID("$FreeBSD: src/lib/libpthread/arch/alpha/alpha/enter_uts.S,v 1.3 2005/05/31 19:58:23 jhb Exp $");
-
-/*
- * _alpha_enter_uts(struct kse_mailbox *km, kse_func_t uts, void *stack,
- * long stacksz);
- */
-LEAF(_alpha_enter_uts, 4)
- addq a2, a3, a2
- ldiq a3, ~0xf
- and a2, a3, a2
- mov a2, sp
- mov a1, ra
- mov a1, t12
- RET
- END(_alpha_enter_uts)
--- lib/libpthread/arch/alpha/alpha/pthread_md.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 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 ``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/libpthread/arch/alpha/alpha/pthread_md.c,v 1.2 2004/08/15 16:28:04 dfr Exp $");
-
-#include <stdlib.h>
-#include <strings.h>
-#include "pthread_md.h"
-
-/*
- * The constructors.
- */
-struct tcb *
-_tcb_ctor(struct pthread *thread, int initial)
-{
- struct tcb *tcb;
-
- if ((tcb = malloc(sizeof(struct tcb))) != NULL) {
- bzero(tcb, sizeof(struct tcb));
- tcb->tcb_thread = thread;
- /* Allocate TDV */
- }
- return (tcb);
-}
-
-void
-_tcb_dtor(struct tcb *tcb)
-{
- /* Free TDV */
- free(tcb);
-}
-
-struct kcb *
-_kcb_ctor(struct kse *kse)
-{
- struct kcb *kcb;
-
- if ((kcb = malloc(sizeof(struct 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/libpthread/arch/alpha/include/pthread_md.h
+++ /dev/null
@@ -1,247 +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/libpthread/arch/alpha/include/pthread_md.h,v 1.7 2004/08/16 14:07:38 davidxu 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_tdv)
-
-#define THR_GETCONTEXT(ucp) _alpha_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;
-struct tdv; /* We don't know what this is yet? */
-
-/*
- * tp 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,
- * struct alpha_tp, struct tcb and also struct kcb. Both static and
- * dynamic allocation of any of these structures will result in a
- * valid, well-aligned thread pointer.
- */
-struct alpha_tp {
- struct tdv *tp_tdv; /* dynamic TLS */
- uint64_t _reserved_;
- long 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;
- struct alpha_tp tcb_tp;
-};
-
-struct kcb {
- struct kse_mailbox kcb_kmbx;
- struct tcb kcb_faketcb;
- struct tcb *kcb_curtcb;
- struct kse *kcb_kse;
-};
-
-#define _tp __builtin_thread_pointer()
-#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 *);
-
-/* 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. */
- __builtin_set_thread_pointer(&kcb->kcb_faketcb.tcb_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;
- uint32_t flags;
-
- 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)
-{
- /* 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)
-{
- uint32_t flags;
- int ret;
-
- 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;
- __builtin_set_thread_pointer(&tcb->tcb_tp);
-}
-
-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 _alpha_enter_uts(struct kse_mailbox *km, kse_func_t uts, void *stack,
- size_t stacksz);
-int _alpha_restore_context(mcontext_t *mc, intptr_t val, intptr_t *loc);
-int _alpha_save_context(mcontext_t *mc);
-
-static __inline int
-_thread_enter_uts(struct tcb *tcb, struct kcb *kcb)
-{
- if (_alpha_save_context(&tcb->tcb_tmbx.tm_context.uc_mcontext) == 0) {
- /* Make the fake tcb the current thread. */
- kcb->kcb_curtcb = &kcb->kcb_faketcb;
- __builtin_set_thread_pointer(&kcb->kcb_faketcb.tcb_tp);
- _alpha_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);
- }
- return (0);
-}
-
-static __inline int
-_thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox)
-{
- extern int _libkse_debug;
-
- _tcb_set(kcb, tcb);
- if (_libkse_debug == 0) {
- tcb->tcb_tmbx.tm_lwp = kcb->kcb_kmbx.km_lwp;
- if (setmbox != 0)
- _alpha_restore_context(
- &tcb->tcb_tmbx.tm_context.uc_mcontext,
- (intptr_t)&tcb->tcb_tmbx,
- (intptr_t *)&kcb->kcb_kmbx.km_curthread);
- else
- _alpha_restore_context(
- &tcb->tcb_tmbx.tm_context.uc_mcontext,
- 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/libpthread/arch/alpha/include/atomic_ops.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * Copyright (c) 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.
- *
- * $FreeBSD: src/lib/libpthread/arch/alpha/include/atomic_ops.h,v 1.3 2003/09/26 11:59:04 davidxu Exp $
- */
-
-#ifndef _ATOMIC_OPS_H_
-#define _ATOMIC_OPS_H_
-
-/*
- * Atomic swap:
- * Atomic (tmp = *dst, *dst = val), then *res = tmp
- *
- * void atomic_swap_long(long *dst, long val, long *res);
- */
-static inline void
-atomic_swap_long(long *dst, long val, long *res)
-{
- /* $1 and $2 are t0 and t1 respectively. */
- __asm __volatile (
- " ldq $1, %1\n" /* get cache line before lock */
- "1: ldq_l $1, %1\n" /* load *dst asserting lock */
- " mov %2, $2\n" /* save value to be swapped */
- " stq_c $2, %1\n" /* attempt the store; $2 clobbered */
- " beq $2, 1b\n" /* it didn't work, loop */
- " stq $1, %0\n" /* save value of *dst in *res */
- " mb \n"
- : "+m"(*res)
- : "m"(*dst), "r"(val)
- : "memory", "$1", "$2"); /* clobber t0 and t1 */
-}
-
-static inline void
-atomic_swap_int(int *dst, int val, int *res)
-{
- /* $1 and $2 are t0 and t1 respectively. */
- __asm __volatile (
- " ldl $1, %1\n" /* get cache line before lock */
- "1: ldl_l $1, %1\n" /* load *dst asserting lock */
- " mov %2, $2\n" /* save value to be swapped */
- " stl_c $2, %1\n" /* attempt the store; $2 clobbered */
- " beq $2, 1b\n" /* it didn't work, loop */
- " stl $1, %0\n" /* save value of *dst in *res */
- " mb \n"
- : "+m"(*res)
- : "m"(*dst), "r"(val)
- : "memory", "$1", "$2"); /* clobber t0 and t1 */
-}
-
-#define atomic_swap_ptr(d, v, r) \
- atomic_swap_long((long *)(d), (long)(v), (long *)(r))
-
-#endif
Index: Makefile.inc
===================================================================
RCS file: /home/cvs/src/lib/libpthread/arch/amd64/Makefile.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L lib/libpthread/arch/amd64/Makefile.inc -L lib/libpthread/arch/amd64/Makefile.inc -u -r1.1.1.1 -r1.2
--- lib/libpthread/arch/amd64/Makefile.inc
+++ lib/libpthread/arch/amd64/Makefile.inc
@@ -1,3 +1,4 @@
+# $MidnightBSD$
# $FreeBSD: src/lib/libpthread/arch/amd64/Makefile.inc,v 1.2 2003/08/05 22:45:59 deischen Exp $
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
Index: Makefile.inc
===================================================================
RCS file: /home/cvs/src/lib/libpthread/arch/arm/Makefile.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L lib/libpthread/arch/arm/Makefile.inc -L lib/libpthread/arch/arm/Makefile.inc -u -r1.1.1.1 -r1.2
--- lib/libpthread/arch/arm/Makefile.inc
+++ lib/libpthread/arch/arm/Makefile.inc
@@ -1,3 +1,4 @@
+# $MidnightBSD$
# $FreeBSD: src/lib/libpthread/arch/arm/Makefile.inc,v 1.2 2005/02/26 19:06:49 cognet Exp $
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
Index: Makefile.inc
===================================================================
RCS file: /home/cvs/src/lib/libpthread/arch/i386/Makefile.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L lib/libpthread/arch/i386/Makefile.inc -L lib/libpthread/arch/i386/Makefile.inc -u -r1.1.1.1 -r1.2
--- lib/libpthread/arch/i386/Makefile.inc
+++ lib/libpthread/arch/i386/Makefile.inc
@@ -1,3 +1,4 @@
+# $MidnightBSD$
# $FreeBSD: src/lib/libpthread/arch/i386/Makefile.inc,v 1.3 2003/08/05 22:45:59 deischen Exp $
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
Index: Makefile.inc
===================================================================
RCS file: /home/cvs/src/lib/libpthread/arch/ia64/Makefile.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L lib/libpthread/arch/ia64/Makefile.inc -L lib/libpthread/arch/ia64/Makefile.inc -u -r1.1.1.1 -r1.2
--- lib/libpthread/arch/ia64/Makefile.inc
+++ lib/libpthread/arch/ia64/Makefile.inc
@@ -1,3 +1,4 @@
+# $MidnightBSD$
# $FreeBSD: src/lib/libpthread/arch/ia64/Makefile.inc,v 1.4 2003/08/05 22:46:00 deischen Exp $
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
--- lib/libpthread/arch/powerpc/Makefile.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-# $FreeBSD: src/lib/libpthread/arch/powerpc/Makefile.inc,v 1.1 2004/07/19 12:19:04 grehan Exp $
-
-# XXX temporary
-CFLAGS+=-DSYSTEM_SCOPE_ONLY
-
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
-
-SRCS+= enter_uts.S context.S pthread_md.c
--- lib/libpthread/arch/powerpc/include/pthread_md.h
+++ /dev/null
@@ -1,258 +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/libpthread/arch/powerpc/include/pthread_md.h,v 1.3 2004/08/16 05:41:38 grehan 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_tdv)
-
-#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;
-struct tdv;
-
-/*
- * %r2 points to a struct kcb.
- */
-struct ppc32_tp {
- struct tdv *tp_tdv; /* dynamic TLS */
- uint32_t _reserved_;
- long 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;
- struct ppc32_tp tcb_tp;
-};
-
-struct kcb {
- struct kse_mailbox kcb_kmbx;
- struct tcb kcb_faketcb;
- struct tcb *kcb_curtcb;
- struct kse *kcb_kse;
-};
-
-/*
- * 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
-register uint8_t *_tpr __asm("%r2");
-
-#define _tcb ((struct tcb *)(_tpr - TP_OFFSET - 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 *);
-
-/* 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. */
- _tpr = (uint8_t *)&kcb->kcb_faketcb.tcb_tp + TP_OFFSET;
-}
-
-/*
- * 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;
- uint32_t flags;
-
- 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)
-{
- /* 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)
-{
- uint32_t flags;
- int ret;
-
- 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;
- _tpr = (uint8_t *)&tcb->tcb_tp + TP_OFFSET;
-}
-
-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);
-}
-
-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;
- _tpr = (uint8_t *)&kcb->kcb_faketcb.tcb_tp + TP_OFFSET;
- _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/libpthread/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/libpthread/arch/powerpc/include/atomic_ops.h,v 1.1 2004/07/19 12:19:04 grehan 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/libpthread/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/libpthread/arch/powerpc/powerpc/context.S,v 1.1 2004/07/19 12:19:04 grehan 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/libpthread/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/libpthread/arch/powerpc/powerpc/assym.c,v 1.1 2004/07/19 12:19:04 grehan 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/libpthread/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/libpthread/arch/powerpc/powerpc/enter_uts.S,v 1.1 2004/07/19 12:19:04 grehan 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/libpthread/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/libpthread/arch/powerpc/powerpc/assym.s,v 1.1 2004/07/19 12:19:04 grehan 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/libpthread/arch/powerpc/powerpc/pthread_md.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 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 ``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/libpthread/arch/powerpc/powerpc/pthread_md.c,v 1.2 2004/08/16 05:41:39 grehan Exp $");
-
-#include <stdlib.h>
-#include <strings.h>
-#include "pthread_md.h"
-
-/*
- * The constructors.
- */
-struct tcb *
-_tcb_ctor(struct pthread *thread, int initial)
-{
- struct tcb *tcb;
-
- if ((tcb = malloc(sizeof(struct tcb))) != NULL) {
- bzero(tcb, sizeof(struct tcb));
- tcb->tcb_thread = thread;
- /* Allocate TDV */
- }
- return (tcb);
-}
-
-void
-_tcb_dtor(struct tcb *tcb)
-{
- /* Free TDV */
- free(tcb);
-}
-
-struct kcb *
-_kcb_ctor(struct kse *kse)
-{
- struct kcb *kcb;
-
- if ((kcb = malloc(sizeof(struct 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/libpthread/arch/alpha/Makefile.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-# $FreeBSD: src/lib/libpthread/arch/alpha/Makefile.inc,v 1.2 2003/08/09 05:44:27 deischen Exp $
-
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
-
-SRCS+= enter_uts.S context.S pthread_md.c
Index: Makefile.inc
===================================================================
RCS file: /home/cvs/src/lib/libpthread/arch/sparc64/Makefile.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L lib/libpthread/arch/sparc64/Makefile.inc -L lib/libpthread/arch/sparc64/Makefile.inc -u -r1.1.1.1 -r1.2
--- lib/libpthread/arch/sparc64/Makefile.inc
+++ lib/libpthread/arch/sparc64/Makefile.inc
@@ -1,3 +1,4 @@
+# $MidnightBSD$
# $FreeBSD: src/lib/libpthread/arch/sparc64/Makefile.inc,v 1.1 2003/10/09 02:32:28 deischen Exp $
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
Index: Makefile.inc
===================================================================
RCS file: /home/cvs/src/lib/libpthread/support/Makefile.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L lib/libpthread/support/Makefile.inc -L lib/libpthread/support/Makefile.inc -u -r1.1.1.1 -r1.2
--- lib/libpthread/support/Makefile.inc
+++ lib/libpthread/support/Makefile.inc
@@ -1,3 +1,4 @@
+# $MidnightBSD$
# $FreeBSD: src/lib/libpthread/support/Makefile.inc,v 1.8 2005/03/21 23:10:35 davidxu Exp $
.PATH: ${.CURDIR}/support ${.CURDIR}/../libc/gen ${.CURDIR}/../libc/string
Index: Makefile.inc
===================================================================
RCS file: /home/cvs/src/lib/libpthread/sys/Makefile.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L lib/libpthread/sys/Makefile.inc -L lib/libpthread/sys/Makefile.inc -u -r1.1.1.1 -r1.2
--- lib/libpthread/sys/Makefile.inc
+++ lib/libpthread/sys/Makefile.inc
@@ -1,3 +1,4 @@
+# $MidnightBSD$
# $FreeBSD: src/lib/libpthread/sys/Makefile.inc,v 1.15 2003/06/23 04:28:31 marcel Exp $
.PATH: ${.CURDIR}/sys
Index: Makefile
===================================================================
RCS file: /home/cvs/src/lib/libpthread/test/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -L lib/libpthread/test/Makefile -L lib/libpthread/test/Makefile -u -r1.2 -r1.3
--- lib/libpthread/test/Makefile
+++ lib/libpthread/test/Makefile
@@ -1,4 +1,4 @@
-#
+# $MidnightBSD$
# $FreeBSD: src/lib/libpthread/test/Makefile,v 1.13 2004/02/05 02:55:20 davidxu Exp $
#
# Automated test suite for libpthread (pthreads).
Index: Makefile.inc
===================================================================
RCS file: /home/cvs/src/lib/libpthread/thread/Makefile.inc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L lib/libpthread/thread/Makefile.inc -L lib/libpthread/thread/Makefile.inc -u -r1.1.1.1 -r1.2
--- lib/libpthread/thread/Makefile.inc
+++ lib/libpthread/thread/Makefile.inc
@@ -1,3 +1,4 @@
+# $MidnightBSD$
# $FreeBSD: src/lib/libpthread/thread/Makefile.inc,v 1.49.2.1 2005/12/15 07:22:24 davidxu Exp $
# thr sources
More information about the Midnightbsd-cvs
mailing list