xref: /openbsd-src/sys/arch/sh/include/spinlock.h (revision a5511fa9f431600dbd6dc2b46fc4e6b73e7d239c)
1*a5511fa9Sguenther /*	$OpenBSD: spinlock.h,v 1.6 2017/09/05 02:40:54 guenther Exp $	*/
295c7671fSmiod /*	$NetBSD: lock.h,v 1.10 2006/01/03 01:29:46 uwe Exp $	*/
395c7671fSmiod 
495c7671fSmiod /*-
595c7671fSmiod  * Copyright (c) 2002 The NetBSD Foundation, Inc.
695c7671fSmiod  * All rights reserved.
795c7671fSmiod  *
895c7671fSmiod  * This code is derived from software contributed to The NetBSD Foundation
995c7671fSmiod  * by Gregory McGarry.
1095c7671fSmiod  *
1195c7671fSmiod  * Redistribution and use in source and binary forms, with or without
1295c7671fSmiod  * modification, are permitted provided that the following conditions
1395c7671fSmiod  * are met:
1495c7671fSmiod  * 1. Redistributions of source code must retain the above copyright
1595c7671fSmiod  *    notice, this list of conditions and the following disclaimer.
1695c7671fSmiod  * 2. Redistributions in binary form must reproduce the above copyright
1795c7671fSmiod  *    notice, this list of conditions and the following disclaimer in the
1895c7671fSmiod  *    documentation and/or other materials provided with the distribution.
1995c7671fSmiod  *
2095c7671fSmiod  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2195c7671fSmiod  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2295c7671fSmiod  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2395c7671fSmiod  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2495c7671fSmiod  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2595c7671fSmiod  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2695c7671fSmiod  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2795c7671fSmiod  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2895c7671fSmiod  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2995c7671fSmiod  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3095c7671fSmiod  * POSSIBILITY OF SUCH DAMAGE.
3195c7671fSmiod  */
3295c7671fSmiod 
3395c7671fSmiod /*
3495c7671fSmiod  * Machine-dependent spin lock operations.
3595c7671fSmiod  */
3695c7671fSmiod 
3795c7671fSmiod #ifndef _SH_SPINLOCK_H_
3895c7671fSmiod #define	_SH_SPINLOCK_H_
3995c7671fSmiod 
40ad97619cSmiod typedef unsigned char _atomic_lock_t;
4195c7671fSmiod 
427ff8e670Stedu #define	_ATOMIC_LOCK_LOCKED	0x80
437ff8e670Stedu #define	_ATOMIC_LOCK_UNLOCKED	0x00
4495c7671fSmiod 
4595c7671fSmiod #endif /* !_SH_SPINLOCK_H_ */
46