[BACK]Return to xfs_bit.h CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / fs / xfs

File: [Development] / linux-2.6-xfs / fs / xfs / xfs_bit.h (download)

Revision 1.3, Thu May 11 01:22:56 1995 UTC (22 years, 5 months ago) by ajs
Branch: MAIN
Changes since 1.2: +2 -2 lines

272139 - Change xFS to XFS

#ifndef _FS_XFS_BIT_H
#define	_FS_XFS_BIT_H

#ident "$Revision: 1.2 $"

/*
 * XFS bit manipulation routines.
 */

/*
 * masks with n high/low bits set, 32-bit values & 64-bit values
 */
#define	XFS_MASK32HI(n)		((__uint32_t)-1 << (32 - (n)))
#define	XFS_MASK64HI(n)		((__uint64_t)-1 << (64 - (n)))
#define	XFS_MASK32LO(n)		(((__uint32_t)1 << (n)) - 1)
#define	XFS_MASK64LO(n)		(((__uint64_t)1 << (n)) - 1)

/*
 * Index of low bit number in byte, -1 for none set, 0..7 otherwise.
 */
extern const char xfs_lowbit[256];

/*
 * Index of high bit number in byte, -1 for none set, 0..7 otherwise.
 */
extern const char xfs_highbit[256];

/*
 * Count of bits set in byte, 0..8.
 */
extern const char xfs_countbit[256];

/*
 * xfs_lowbit32: get low bit set out of 32-bit argument, -1 if none set.
 */
extern int xfs_lowbit32(__uint32_t v);

/*
 * xfs_highbit32: get high bit set out of 32-bit argument, -1 if none set.
 */
extern int xfs_highbit32(__uint32_t v);

/*
 * xfs_lowbit64: get low bit set out of 64-bit argument, -1 if none set.
 */
extern int xfs_lowbit64(__uint64_t v);

/*
 * xfs_highbit64: get high bit set out of 64-bit argument, -1 if none set.
 */
extern int xfs_highbit64(__uint64_t);

#endif	/* _FS_XFS_BIT_H */