Home | History | Annotate | Line # | Download | only in atomic
atomic_and.S revision 1.2
      1  1.2  matt /*	$NetBSD: atomic_and.S,v 1.2 2009/12/14 00:38:59 matt Exp $	*/
      2  1.2  matt 
      3  1.2  matt /*-
      4  1.2  matt  * Copyright (c) 2008 The NetBSD Foundation, Inc.
      5  1.2  matt  * All rights reserved.
      6  1.2  matt  *
      7  1.2  matt  * Redistribution and use in source and binary forms, with or without
      8  1.2  matt  * modification, are permitted provided that the following conditions
      9  1.2  matt  * are met:
     10  1.2  matt  * 1. Redistributions of source code must retain the above copyright
     11  1.2  matt  *    notice, this list of conditions and the following disclaimer.
     12  1.2  matt  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.2  matt  *    notice, this list of conditions and the following disclaimer in the
     14  1.2  matt  *    documentation and/or other materials provided with the distribution.
     15  1.2  matt  *
     16  1.2  matt  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     17  1.2  matt  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     18  1.2  matt  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     19  1.2  matt  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     20  1.2  matt  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21  1.2  matt  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22  1.2  matt  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     23  1.2  matt  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     24  1.2  matt  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     25  1.2  matt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     26  1.2  matt  * POSSIBILITY OF SUCH DAMAGE.
     27  1.2  matt  */
     28  1.2  matt 
     29  1.2  matt #include <sys/cdefs.h>
     30  1.2  matt #include <machine/asm.h>
     31  1.2  matt #include "atomic_op_asm.h"
     32  1.2  matt 
     33  1.2  matt RCSID("$NetBSD: atomic_and.S,v 1.2 2009/12/14 00:38:59 matt Exp $")
     34  1.2  matt 
     35  1.2  matt 	.text
     36  1.2  matt 	.set	noat
     37  1.2  matt 	.set	noreorder
     38  1.2  matt 	.set	nomacro
     39  1.2  matt 
     40  1.2  matt LEAF(_atomic_and_32)
     41  1.2  matt 1:	INT_LL		t0, 0(a0)
     42  1.2  matt 	 nop
     43  1.2  matt 	and		t0, a1
     44  1.2  matt 	INT_SC		t0, 0(a0)
     45  1.2  matt 	beq		t0, zero, 1b
     46  1.2  matt  	 nop
     47  1.2  matt 	j		ra
     48  1.2  matt 	 nop
     49  1.2  matt END(_atomic_and_32)
     50  1.2  matt ATOMIC_OP_ALIAS(atomic_and_32, _atomic_and_32)
     51  1.2  matt 
     52  1.2  matt LEAF(_atomic_and_32_nv)
     53  1.2  matt 1:	INT_LL		v0, 0(a0)
     54  1.2  matt 	 nop
     55  1.2  matt 	and		v0, a1
     56  1.2  matt 	move		t0, v0
     57  1.2  matt 	INT_SC		t0, 0(a0)
     58  1.2  matt 	beq		t0, zero, 1b
     59  1.2  matt  	 nop
     60  1.2  matt 	j		ra
     61  1.2  matt 	 nop
     62  1.2  matt END(_atomic_and_32_nv)
     63  1.2  matt ATOMIC_OP_ALIAS(atomic_and_32_nv, _atomic_and_32_nv)
     64  1.2  matt 
     65  1.2  matt #if !defined(__mips_o32)
     66  1.2  matt LEAF(_atomic_and_64)
     67  1.2  matt 1:	REG_LL		t0, 0(a0)
     68  1.2  matt 	 nop
     69  1.2  matt 	and		t0, a1
     70  1.2  matt 	REG_SC		t0, 0(a0)
     71  1.2  matt 	beq		t0, zero, 1b
     72  1.2  matt  	 nop
     73  1.2  matt 	j		ra
     74  1.2  matt 	 nop
     75  1.2  matt END(_atomic_and_64)
     76  1.2  matt ATOMIC_OP_ALIAS(atomic_and_64, _atomic_and_64)
     77  1.2  matt 
     78  1.2  matt LEAF(_atomic_and_64_nv)
     79  1.2  matt 1:	REG_LL		v0, 0(a0)
     80  1.2  matt 	 nop
     81  1.2  matt 	and		v0, a1
     82  1.2  matt 	move		t0, v0
     83  1.2  matt 	REG_SC		t0, 0(a0)
     84  1.2  matt 	beq		t0, zero, 1b
     85  1.2  matt  	 nop
     86  1.2  matt 	j		ra
     87  1.2  matt 	 nop
     88  1.2  matt END(_atomic_and_64_nv)
     89  1.2  matt ATOMIC_OP_ALIAS(atomic_and_64_nv, _atomic_and_64_nv)
     90  1.2  matt #endif
     91  1.2  matt 
     92  1.2  matt #ifdef _LP64
     93  1.2  matt STRONG_ALIAS(_atomic_and_ulong,		_atomic_and_64)
     94  1.2  matt STRONG_ALIAS(_atomic_and_ulong_nv,	_atomic_and_64_nv)
     95  1.2  matt #else
     96  1.2  matt STRONG_ALIAS(_atomic_and_ulong,		_atomic_and_32)
     97  1.2  matt STRONG_ALIAS(_atomic_and_ulong_nv,	_atomic_and_32_nv)
     98  1.2  matt #endif
     99  1.2  matt STRONG_ALIAS(_atomic_and_uint,		_atomic_and_32)
    100  1.2  matt STRONG_ALIAS(_atomic_and_uint_nv,	_atomic_and_32_nv)
    101  1.2  matt 
    102  1.2  matt ATOMIC_OP_ALIAS(atomic_and_uint,	_atomic_and_uint)
    103  1.2  matt ATOMIC_OP_ALIAS(atomic_and_uint_nv,	_atomic_and_uint_nv)
    104  1.2  matt ATOMIC_OP_ALIAS(atomic_and_ulong,	_atomic_and_ulong)
    105  1.2  matt ATOMIC_OP_ALIAS(atomic_and_ulong_nv,	_atomic_and_ulong_nv)
    106