atomic_or_8_cas.c revision 1.1.2.2
156693Sjhb/* $NetBSD: atomic_or_8_cas.c,v 1.1.2.2 2007/04/16 03:20:00 thorpej Exp $ */ 2130943Sjhb 356693Sjhb/*- 456693Sjhb * Copyright (c) 2007 The NetBSD Foundation, Inc. 5130943Sjhb * All rights reserved. 6130943Sjhb * 7130943Sjhb * This code is derived from software contributed to The NetBSD Foundation 8130943Sjhb * by Jason R. Thorpe. 9130943Sjhb * 10130943Sjhb * Redistribution and use in source and binary forms, with or without 11130943Sjhb * modification, are permitted provided that the following conditions 12130943Sjhb * are met: 1356693Sjhb * 1. Redistributions of source code must retain the above copyright 14130943Sjhb * notice, this list of conditions and the following disclaimer. 15130943Sjhb * 2. Redistributions in binary form must reproduce the above copyright 16130943Sjhb * notice, this list of conditions and the following disclaimer in the 17130943Sjhb * documentation and/or other materials provided with the distribution. 18130943Sjhb * 3. All advertising materials mentioning features or use of this software 19130943Sjhb * must display the following acknowledgement: 20130943Sjhb * This product includes software developed by the NetBSD 21130943Sjhb * Foundation, Inc. and its contributors. 22130943Sjhb * 4. Neither the name of The NetBSD Foundation nor the names of its 23130943Sjhb * contributors may be used to endorse or promote products derived 24130943Sjhb * from this software without specific prior written permission. 2556693Sjhb * 2656693Sjhb * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 2756693Sjhb * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2856693Sjhb * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2956693Sjhb * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 3085998Sjhb * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 3185998Sjhb * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 3285998Sjhb * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 3385998Sjhb * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 3456693Sjhb * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 3585998Sjhb * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3685998Sjhb * POSSIBILITY OF SUCH DAMAGE. 3785998Sjhb */ 3885998Sjhb 3956693Sjhb#include "atomic_op_namespace.h" 40235219Savg 41235219Savg#include <sys/atomic.h> 4256693Sjhb#include "atomic_op_cas_impl.h" 4356693Sjhb 4456693Sjhbvoid 4558713Sjhbatomic_or_8(volatile uint8_t *addr, uint8_t val) 4656693Sjhb{ 4756693Sjhb OP_LOCALS(uint8_t); 4856693Sjhb 4956693Sjhb OP_DO(addr, |, val); 5056693Sjhb} 5156693Sjhb 5258713Sjhbatomic_op_alias(atomic_or_8,_atomic_or_8) 5356693Sjhbatomic_op_alias(atomic_or_uchar,_atomic_or_8) 5456693Sjhb