bitmap.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef _SYS_BITMAP_H
#define _SYS_BITMAP_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6 */
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/feature_tests.h>
#if defined(__GNUC__) && defined(_ASM_INLINES)
#endif
/*
* Operations on bitmaps of arbitrary size
* A bitmap is a vector of 1 or more ulong_t's.
* The user of the package is responsible for range checks and keeping
* track of sizes.
*/
#ifdef _LP64
#else
#endif
#ifdef _LP64
#else
#define BT_ULMAXMASK 0xffffffff
#endif
/*
* bitmap is a ulong_t *, bitindex an index_t
*
* The macros BT_WIM and BT_BIW internal; there is no need
* for users of this package to use them.
*/
/*
* word in map
*/
/*
* bit in word
*/
#ifdef _LP64
#endif
/*
* These are public macros
*
* BT_BITOUL == n bits to n ulong_t's
*/
#define BT_SIZEOFMAP(nbits) \
#ifdef _LP64
#define BT_BITOUL32(nbits) \
#define BT_SIZEOFMAP32(nbits) \
#endif /* _LP64 */
/*
* return next available bit index from map with specified number of bits
*/
/*
* find the highest order bit that is on, and is within or below
* the word specified by wx
*/
/*
* Find highest and lowest one bit set.
* Returns bit number + 1 of bit that is set, otherwise returns 0.
* Low order bit is 0, high order bit is 31.
*/
/*
* find the parity
*/
extern int odd_parity(ulong_t);
/*
* Atomic exclusive operations will set "result" to "-1"
* to 0 otherwise.
*/
/*
* Extracts bits between index h (high, inclusive) and l (low, exclusive) from
* u, which must be an unsigned integer.
*/
#endif /* _KERNEL && !_ASM */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_BITMAP_H */