[BACK]Return to atomic.h CVS log [TXT][DIR] Up to [local] / sys / arch / vax / include

File: [local] / sys / arch / vax / include / atomic.h (download)

Revision 1.1, Tue Mar 4 16:08:39 2008 UTC (16 years, 3 months ago) by nbrk
Branch point for: MAIN

Initial revision

/*	$OpenBSD: atomic.h,v 1.3 2007/04/05 17:33:50 miod Exp $	*/

/* Public Domain */

#ifndef __VAX_ATOMIC_H__
#define __VAX_ATOMIC_H__

#if defined(_KERNEL)

#include <machine/mtpr.h>

static __inline void
atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
{
	int s;

	s = splhigh();
	*uip |= v;
	splx(s);
}

static __inline void
atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
{
	int s;

	s = splhigh();
	*uip &= ~v;
	splx(s);
}

#endif /* defined(_KERNEL) */
#endif /* __VAX_ATOMIC_H__ */