/*
 * |-----------------------------------------------------------|
 * | Copyright (c) 1991, 1990 MIPS Computer Systems, Inc.      |
 * | All Rights Reserved                                       |
 * |-----------------------------------------------------------|
 * |          Restricted Rights Legend                         |
 * | Use, duplication, or disclosure by the Government is      |
 * | subject to restrictions as set forth in                   |
 * | subparagraph (c)(1)(ii) of the Rights in Technical        |
 * | Data and Computer Software Clause of DFARS 252.227-7013.  |
 * |         MIPS Computer Systems, Inc.                       |
 * |         950 DeGuigne Avenue                               |
 * |         Sunnyvale, California 94088-3650, USA             |
 * |-----------------------------------------------------------|
 */
#ident "$Header: mutex.h,v 2.1.1.1 92/06/24 13:56:57 marker Exp $"

#ifndef _MUTEX_
#define _MUTEX_

#include "sys/mutextypes.h"

extern mutex_test_set_type	(*_test_and_set) ();
extern mutex_test_set_type	(*_test_then_and) ();
extern mutex_test_set_type	(*_test_then_nand) ();
extern mutex_test_set_type	(*_test_then_not) ();
extern mutex_test_set_type	(*_test_then_nor) ();
extern mutex_test_set_type	(*_test_then_xor) ();
extern mutex_test_set_type	(*_test_then_or) ();
extern mutex_test_set_type	(*_test_then_add) ();
extern mutex_test_set_type	(*_add_then_test) ();
extern mutex_test_set_type	_atomic_op ();

#define	test_and_set(addr,val)	(*_test_and_set)((addr),(val))
#define	test_then_and(addr,val)	(*_test_then_and)((addr),(val))
#define	test_then_nand(addr,val)	(*_test_then_nand)((addr),(val))
#define	test_then_not(addr)	(*_test_then_not)((addr))
#define	test_then_nor(addr,val)	(*_test_then_nor)((addr),(val))
#define	test_then_xor(addr,val)	(*_test_then_xor)((addr),(val))
#define	test_then_or(addr,val)	(*_test_then_or)((addr),(val))
#define	test_then_add(addr,val)	(*_test_then_add)((addr),(val))
#define	add_then_test(addr,val)	(*_add_then_test)((addr),(val))
#define	atomic_op(func,addr,val)	_atomic_op((func),(addr),(val))
#define	atomic_set(addr,val)	(void)(*_test_and_set)((addr),(val))

#endif _MUTEX_
