Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src New files for OR1K support
details: https://anonhg.NetBSD.org/src/rev/8a58df324903
branches: trunk
changeset: 331992:8a58df324903
user: matt <matt%NetBSD.org@localhost>
date: Wed Sep 03 19:34:25 2014 +0000
description:
New files for OR1K support
diffstat:
common/lib/libc/arch/or1k/atomic/Makefile.inc | 28 +
common/lib/libc/arch/or1k/atomic/atomic_add_32.S | 97 +
common/lib/libc/arch/or1k/atomic/atomic_and_32.S | 67 +
common/lib/libc/arch/or1k/atomic/atomic_cas_32.S | 61 +
common/lib/libc/arch/or1k/atomic/atomic_dec_32.S | 68 +
common/lib/libc/arch/or1k/atomic/atomic_inc_32.S | 65 +
common/lib/libc/arch/or1k/atomic/atomic_nand_32.S | 68 +
common/lib/libc/arch/or1k/atomic/atomic_op_asm.h | 57 +
common/lib/libc/arch/or1k/atomic/atomic_or_32.S | 66 +
common/lib/libc/arch/or1k/atomic/atomic_swap_32.S | 59 +
common/lib/libc/arch/or1k/atomic/atomic_xor_32.S | 66 +
common/lib/libc/arch/or1k/atomic/membar_ops.S | 57 +
common/lib/libc/arch/or1k/atomic/sync_bool_compare_and_swap_4.S | 45 +
common/lib/libc/arch/or1k/gen/mulsi3.S | 74 +
common/lib/libc/arch/or1k/string/bcopy.S | 4 +
common/lib/libc/arch/or1k/string/bzero.S | 4 +
common/lib/libc/arch/or1k/string/clz.S | 68 +
common/lib/libc/arch/or1k/string/ctz.S | 69 +
common/lib/libc/arch/or1k/string/ffs.S | 64 +
common/lib/libc/arch/or1k/string/memcmp.S | 213 +++
common/lib/libc/arch/or1k/string/memcpy.c | 135 ++
common/lib/libc/arch/or1k/string/memmove.S | 218 +++
common/lib/libc/arch/or1k/string/memset.S | 135 ++
common/lib/libc/arch/or1k/string/strlen.S | 123 ++
distrib/sets/lists/comp/md.or1k | 49 +
etc/etc.or1k/MAKEDEV.conf | 30 +
etc/etc.or1k/ttys | 20 +
lib/csu/arch/or1k/Makefile.inc | 5 +
lib/csu/arch/or1k/crt0.S | 44 +
lib/csu/arch/or1k/crtbegin.h | 35 +
lib/csu/arch/or1k/crtend.S | 48 +
lib/csu/arch/or1k/crti.S | 41 +
lib/csu/arch/or1k/crtn.S | 3 +
lib/libc/arch/or1k/Makefile.inc | 10 +
lib/libc/arch/or1k/SYS.h | 44 +
lib/libc/arch/or1k/gdtoa/Makefile.inc | 3 +
lib/libc/arch/or1k/gdtoa/arith.h | 3 +
lib/libc/arch/or1k/gdtoa/gd_qnan.h | 5 +
lib/libc/arch/or1k/gen/Makefile.inc | 29 +
lib/libc/arch/or1k/gen/__setjmp14.S | 70 +
lib/libc/arch/or1k/gen/__sigsetjmp14.S | 25 +
lib/libc/arch/or1k/gen/_lwp.c | 72 +
lib/libc/arch/or1k/gen/_setjmp.S | 89 +
lib/libc/arch/or1k/gen/flt_rounds.c | 54 +
lib/libc/arch/or1k/gen/fpgetmask.c | 60 +
lib/libc/arch/or1k/gen/fpgetround.c | 57 +
lib/libc/arch/or1k/gen/fpgetsticky.c | 60 +
lib/libc/arch/or1k/gen/fpsetmask.c | 65 +
lib/libc/arch/or1k/gen/fpsetround.c | 64 +
lib/libc/arch/or1k/gen/fpsetsticky.c | 87 +
lib/libc/arch/or1k/gen/makecontext.c | 83 +
lib/libc/arch/or1k/gen/nanf.c | 15 +
lib/libc/arch/or1k/gen/resumecontext.c | 54 +
lib/libc/arch/or1k/gen/swapcontext.S | 75 +
lib/libc/arch/or1k/genassym.cf | 64 +
lib/libc/arch/or1k/net/Makefile.inc | 3 +
lib/libc/arch/or1k/softfloat/milieu.h | 48 +
lib/libc/arch/or1k/softfloat/or1k-gcc.h | 89 +
lib/libc/arch/or1k/softfloat/softfloat.h | 305 +++++
lib/libc/arch/or1k/stdlib/Makefile.inc | 1 +
lib/libc/arch/or1k/string/Makefile.inc | 24 +
lib/libc/arch/or1k/sys/__clone.S | 79 +
lib/libc/arch/or1k/sys/__sigaction14_sigtramp.c | 82 +
lib/libc/arch/or1k/sys/__sigtramp2.S | 52 +
lib/libc/arch/or1k/sys/__syscall.S | 24 +
lib/libc/arch/or1k/sys/__vfork14.S | 17 +
lib/libc/arch/or1k/sys/brk.S | 49 +
lib/libc/arch/or1k/sys/cerror.S | 51 +
lib/libc/arch/or1k/sys/exect.S | 5 +
lib/libc/arch/or1k/sys/fork.S | 17 +
lib/libc/arch/or1k/sys/getcontext.S | 51 +
lib/libc/arch/or1k/sys/pipe.S | 23 +
lib/libc/arch/or1k/sys/ptrace.S | 64 +
lib/libc/arch/or1k/sys/sbrk.S | 37 +
lib/libc/arch/or1k/sys/shmat.S | 5 +
lib/libc/arch/or1k/sys/syscall.S | 3 +
lib/libkvm/kvm_or1k.c | 126 ++
lib/libpthread/arch/or1k/pthread_md.h | 47 +
libexec/ld.elf_so/arch/or1k/Makefile.inc | 10 +
libexec/ld.elf_so/arch/or1k/mdreloc.c | 293 +++++
libexec/ld.elf_so/arch/or1k/rtld_start.S | 118 ++
sys/arch/or1k/Makefile | 5 +
sys/arch/or1k/conf/majors.or1k | 76 +
sys/arch/or1k/include/Makefile | 25 +
sys/arch/or1k/include/ansi.h | 3 +
sys/arch/or1k/include/aout_machdep.h | 40 +
sys/arch/or1k/include/asm.h | 105 +
sys/arch/or1k/include/bswap.h | 11 +
sys/arch/or1k/include/bus_defs.h | 370 ++++++
sys/arch/or1k/include/bus_funcs.h | 559 ++++++++++
sys/arch/or1k/include/byte_swap.h | 95 +
sys/arch/or1k/include/cdefs.h | 8 +
sys/arch/or1k/include/cpu.h | 120 ++
sys/arch/or1k/include/cpu_counter.h | 61 +
sys/arch/or1k/include/db_machdep.h | 98 +
sys/arch/or1k/include/disklabel.h | 68 +
sys/arch/or1k/include/elf_machdep.h | 93 +
sys/arch/or1k/include/endian.h | 3 +
sys/arch/or1k/include/endian_machdep.h | 3 +
sys/arch/or1k/include/fenv.h | 39 +
sys/arch/or1k/include/float.h | 58 +
sys/arch/or1k/include/frame.h | 50 +
sys/arch/or1k/include/ieee.h | 3 +
sys/arch/or1k/include/ieeefp.h | 44 +
sys/arch/or1k/include/int_const.h | 20 +
sys/arch/or1k/include/int_fmtio.h | 216 +++
sys/arch/or1k/include/int_limits.h | 3 +
sys/arch/or1k/include/int_mwgwtypes.h | 3 +
sys/arch/or1k/include/int_types.h | 3 +
sys/arch/or1k/include/intr.h | 145 ++
sys/arch/or1k/include/kcore.h | 40 +
sys/arch/or1k/include/limits.h | 3 +
sys/arch/or1k/include/lock.h | 136 ++
sys/arch/or1k/include/math.h | 3 +
sys/arch/or1k/include/mcontext.h | 140 ++
sys/arch/or1k/include/mutex.h | 97 +
sys/arch/or1k/include/param.h | 93 +
sys/arch/or1k/include/pcb.h | 46 +
sys/arch/or1k/include/pmap.h | 68 +
sys/arch/or1k/include/pmc.h | 3 +
sys/arch/or1k/include/proc.h | 47 +
sys/arch/or1k/include/profile.h | 91 +
sys/arch/or1k/include/psl.h | 3 +
sys/arch/or1k/include/pte.h | 37 +
sys/arch/or1k/include/ptrace.h | 46 +
sys/arch/or1k/include/reg.h | 59 +
sys/arch/or1k/include/rwlock.h | 56 +
sys/arch/or1k/include/setjmp.h | 59 +
sys/arch/or1k/include/signal.h | 39 +
sys/arch/or1k/include/spr.h | 97 +
sys/arch/or1k/include/sysarch.h | 3 +
sys/arch/or1k/include/trap.h | 52 +
sys/arch/or1k/include/types.h | 89 +
sys/arch/or1k/include/vmparam.h | 94 +
sys/arch/or1k/include/wchar_limits.h | 3 +
tests/lib/libc/arch/or1k/exec_prot_support.c | 41 +
tests/lib/libc/arch/or1k/return_one.S | 12 +
usr.bin/xlint/arch/or1k/targparam.h | 54 +
138 files changed, 8735 insertions(+), 0 deletions(-)
diffs (truncated from 9287 to 300 lines):
diff -r 0f49aac6ee12 -r 8a58df324903 common/lib/libc/arch/or1k/atomic/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/or1k/atomic/Makefile.inc Wed Sep 03 19:34:25 2014 +0000
@@ -0,0 +1,28 @@
+# $NetBSD: Makefile.inc,v 1.1 2014/09/03 19:34:25 matt Exp $
+
+.for op in add and cas nand or swap xor
+.for sz in 32
+SRCS.atomic+= atomic_${op}_${sz}.S
+.endfor
+.for sz in 8 16
+SRCS.atomic+= atomic_${op}_${sz}_cas.c
+.endfor
+.endfor
+SRCS.atomic+= atomic_dec_32.S atomic_inc_32.S
+SRCS.atomic+= membar_ops.S
+SRCS.atomic+= atomic_cas_by_cas32.c
+.if defined(LIB) && ${LIB} != "kern"
+SRCS.atomic+= sync_bool_compare_and_swap_4.S
+.endif
+
+#.if defined(LIB) && (${LIB} != "kern")
+#SRCS.atomic+= atomic_simplelock.c
+#.endif
+
+.if defined(LIB) && (${LIB} != "kern" && ${LIB} != "rump")
+
+SRCS.atomic+= atomic_init_cas.c
+
+.endif #LIB
+
+SRCS+= ${SRCS.atomic}
diff -r 0f49aac6ee12 -r 8a58df324903 common/lib/libc/arch/or1k/atomic/atomic_add_32.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/or1k/atomic/atomic_add_32.S Wed Sep 03 19:34:25 2014 +0000
@@ -0,0 +1,97 @@
+/* $NetBSD: atomic_add_32.S,v 1.1 2014/09/03 19:34:25 matt Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "atomic_op_asm.h"
+
+ENTRY_NP(_atomic_sub_32)
+ l.sub r4, r0, r4 /* negate */
+ /* FALLTHROUGH */
+ENTRY_NP(_atomic_add_32)
+1: l.lwa r11, 0(r3) /* load old value */
+ l.add r5, r11, r4 /* calculate new value */
+ l.swa 0(r3), r5 /* try to store */
+ l.bnf 1b /* succeed? no, try again */
+ l.nop /* -- delay slot -- */
+ l.jr lr /* return old value */
+ l.nop
+END(_atomic_add_32)
+END(_atomic_sub_32)
+
+ATOMIC_OP_ALIAS(atomic_add_32,_atomic_add_32)
+ATOMIC_OP_ALIAS(atomic_add_int,_atomic_add_32)
+ATOMIC_OP_ALIAS(atomic_add_long,_atomic_add_32)
+ATOMIC_OP_ALIAS(atomic_add_ptr,_atomic_add_32)
+CRT_ALIAS(__sync_fetch_and_add_4,_atomic_add_32)
+CRT_ALIAS(__atomic_fetch_add_4,_atomic_add_32)
+STRONG_ALIAS(_atomic_add_int,_atomic_add_32)
+STRONG_ALIAS(_atomic_add_long,_atomic_add_32)
+STRONG_ALIAS(_atomic_add_ptr,_atomic_add_32)
+
+ATOMIC_OP_ALIAS(atomic_sub_32,_atomic_sub_32)
+ATOMIC_OP_ALIAS(atomic_sub_int,_atomic_sub_32)
+ATOMIC_OP_ALIAS(atomic_sub_long,_atomic_sub_32)
+ATOMIC_OP_ALIAS(atomic_sub_ptr,_atomic_sub_32)
+CRT_ALIAS(__sync_fetch_and_sub_4,_atomic_sub_32)
+CRT_ALIAS(__atomic_fetch_sub_4,_atomic_sub_32)
+STRONG_ALIAS(_atomic_sub_int,_atomic_sub_32)
+STRONG_ALIAS(_atomic_sub_long,_atomic_sub_32)
+STRONG_ALIAS(_atomic_sub_ptr,_atomic_sub_32)
+
+ENTRY_NP(_atomic_sub_32_nv)
+ l.sub r4, r0, r4 /* negate */
+ /* FALLTHROUGH */
+ENTRY_NP(_atomic_add_32_nv)
+1: l.lwa r5, 0(r3) /* load old value */
+ l.add r11, r5, r4 /* calculate new value */
+ l.swa 0(r3), r11 /* try to store */
+ l.bnf 1b /* succeed? no, try again */
+ l.nop /* -- delay slot -- */
+ l.jr lr /* return old value */
+ l.nop
+END(_atomic_add_32_nv)
+END(_atomic_sub_32_nv)
+ATOMIC_OP_ALIAS(atomic_add_32_nv,_atomic_add_32_nv)
+ATOMIC_OP_ALIAS(atomic_add_int_nv,_atomic_add_32_nv)
+ATOMIC_OP_ALIAS(atomic_add_long_nv,_atomic_add_32_nv)
+ATOMIC_OP_ALIAS(atomic_add_ptr_nv,_atomic_add_32_nv)
+CRT_ALIAS(__sync_add_and_fetch_4,_atomic_add_32_nv)
+STRONG_ALIAS(_atomic_add_int_nv,_atomic_add_32_nv)
+STRONG_ALIAS(_atomic_add_long_nv,_atomic_add_32_nv)
+STRONG_ALIAS(_atomic_add_ptr_nv,_atomic_add_32_nv)
+
+ATOMIC_OP_ALIAS(atomic_sub_32_nv,_atomic_sub_32_nv)
+ATOMIC_OP_ALIAS(atomic_sub_int_nv,_atomic_sub_32_nv)
+ATOMIC_OP_ALIAS(atomic_sub_long_nv,_atomic_sub_32_nv)
+ATOMIC_OP_ALIAS(atomic_sub_ptr_nv,_atomic_sub_32_nv)
+CRT_ALIAS(__sync_sub_and_fetch_4,_atomic_sub_32_nv)
+STRONG_ALIAS(_atomic_sub_int_nv,_atomic_sub_32_nv)
+STRONG_ALIAS(_atomic_sub_long_nv,_atomic_sub_32_nv)
+STRONG_ALIAS(_atomic_sub_ptr_nv,_atomic_sub_32_nv)
diff -r 0f49aac6ee12 -r 8a58df324903 common/lib/libc/arch/or1k/atomic/atomic_and_32.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/or1k/atomic/atomic_and_32.S Wed Sep 03 19:34:25 2014 +0000
@@ -0,0 +1,67 @@
+/* $NetBSD: atomic_and_32.S,v 1.1 2014/09/03 19:34:25 matt Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "atomic_op_asm.h"
+
+ENTRY_NP(_atomic_and_32)
+1: l.lwa r11, 0(r3) /* load old value */
+ l.and r5, r11, r4 /* calculate new value */
+ l.swa 0(r3), r5 /* try to store */
+ l.bnf 1b /* succeed? no, try again */
+ l.nop /* -- delay slot -- */
+ l.jr lr /* return old value */
+ l.nop
+END(_atomic_and_32)
+
+ATOMIC_OP_ALIAS(atomic_and_32,_atomic_and_32)
+ATOMIC_OP_ALIAS(atomic_and_uint,_atomic_and_32)
+ATOMIC_OP_ALIAS(atomic_and_ulong,_atomic_and_32)
+CRT_ALIAS(__sync_fetch_and_and_4,_atomic_and_32)
+CRT_ALIAS(__atomic_fetch_and_4,_atomic_and_32)
+STRONG_ALIAS(_atomic_and_uint,_atomic_and_32)
+STRONG_ALIAS(_atomic_and_ulong,_atomic_and_32)
+
+ENTRY_NP(_atomic_and_32_nv)
+1: l.lwa r5, 0(r3) /* load old value */
+ l.and r11, r5, r4 /* calculate new value */
+ l.swa 0(r3), r11 /* try to store */
+ l.bnf 1b /* succeed? no, try again */
+ l.nop /* -- delay slot -- */
+ l.jr lr /* return old value */
+ l.nop
+END(_atomic_and_32_nv)
+
+ATOMIC_OP_ALIAS(atomic_and_32_nv,_atomic_and_32_nv)
+ATOMIC_OP_ALIAS(atomic_and_uint_nv,_atomic_and_32_nv)
+ATOMIC_OP_ALIAS(atomic_and_ulong_nv,_atomic_and_32_nv)
+CRT_ALIAS(__sync_and_and_fetch_4,_atomic_and_32_nv)
+STRONG_ALIAS(_atomic_and_uint_nv,_atomic_and_32_nv)
+STRONG_ALIAS(_atomic_and_ulong_nv,_atomic_and_32_nv)
diff -r 0f49aac6ee12 -r 8a58df324903 common/lib/libc/arch/or1k/atomic/atomic_cas_32.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/or1k/atomic/atomic_cas_32.S Wed Sep 03 19:34:25 2014 +0000
@@ -0,0 +1,61 @@
+/* $NetBSD: atomic_cas_32.S,v 1.1 2014/09/03 19:34:25 matt Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "atomic_op_asm.h"
+
+ENTRY_NP(_atomic_cas_32)
+1: l.lwa r11, 0(r3)
+ l.sfeq r11, r4
+ l.bnf 2f
+ l.nop
+ l.swa 0(r3), r5
+ l.bnf 1b
+ l.nop
+2: l.jr lr
+ l.nop
+END(_atomic_cas_32)
+
+ATOMIC_OP_ALIAS(atomic_cas_32,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_uint,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_ulong,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_ptr,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_32_ni,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_uint_ni,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_ulong_ni,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_ptr_ni,_atomic_cas_32)
+CRT_ALIAS(__sync_val_compare_and_swap_4,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_uint,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_ulong,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_32_ni,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_ptr_ni,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_uint_ni,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_ulong_ni,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_ptr,_atomic_cas_32)
diff -r 0f49aac6ee12 -r 8a58df324903 common/lib/libc/arch/or1k/atomic/atomic_dec_32.S
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/lib/libc/arch/or1k/atomic/atomic_dec_32.S Wed Sep 03 19:34:25 2014 +0000
@@ -0,0 +1,68 @@
+/* $NetBSD: atomic_dec_32.S,v 1.1 2014/09/03 19:34:25 matt Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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)
Home |
Main Index |
Thread Index |
Old Index