2 * (c) Copyright 1992 by Panagiotis Tsirigotis
3 * (c) Sections Copyright 1998-2001 by Rob Braun
4 * All rights reserved. The file named COPYRIGHT specifies the terms
5 * and conditions for redistribution.
12 * $Id: mask.h,v 1.1.1.1 2003/02/19 17:29:28 bbraun Exp $
21 * Macros about masks - Note: 64 bits is needed because of attr.h
24 typedef uint64_t mask_t;
26 #define MASK_NULL ((mask_t *)0)
28 #define XMASK( v ) ( (mask_t)1 << ( (v)-1 ) )
30 #define M_CLEAR_ALL( mask ) (mask) = 0
31 #define M_ASSIGN( mask1, mask2 ) (mask1) = (mask2)
32 #define M_ARE_ALL_CLEAR( mask ) ( (mask) == 0 )
33 #define M_SET( mask, v ) (mask) |= XMASK(v)
34 #define M_CLEAR( mask, v ) (mask) &= ~XMASK(v)
35 #define M_IS_SET( mask, v ) ( (mask) & XMASK(v) )
36 #define M_IS_CLEAR( mask, v ) ( ! M_IS_SET( mask, v ) )
38 #define M_AND( mres, m1, m2 ) ( (mres) = (m1) & (m2) )
39 #define M_OR( mres, m1, m2 ) ( (mres) = (m1) | (m2) )
40 #define M_XOR( mres, m1, m2 ) ( (mres) = (m1) ^ (m2) )