#ifndef _X86_64_BITOPS_H
#define _X86_64_BITOPS_H

/*
 * Copyright 1992, Linus Torvalds.
 */

extern long find_first_zero_bit(const unsigned long *addr, unsigned long size);
extern long find_first_bit(const unsigned long *addr, unsigned long size);

/* return index of first bet set in val or max when no bit is set */
static inline long __scanbit(unsigned long val, unsigned long max)
{
	asm("bsfq %1,%0 ; cmovz %2,%0" : "=&r" (val) : "r" (val), "r" (max));
	return val;
}

#define find_first_bit(addr, size)					\
	((__builtin_constant_p((size)) && (size) <= BITS_PER_LONG	\
	  ? (__scanbit(*(unsigned long *)(addr), (size)))		\
	  : find_first_bit((addr), (size))))

#define find_first_zero_bit(addr, size)					\
	((__builtin_constant_p((size)) && (size) <= BITS_PER_LONG	\
	  ? (__scanbit(~*(unsigned long *)(addr), (size)))		\
	  : find_first_zero_bit((addr), (size))))

static inline void set_bit_string(unsigned long *bitmap, unsigned long i,
				  int len)
{
	unsigned long end = i + len;
	while (i < end) {
		__set_bit(i, bitmap);
		i++;
	}
}

#ifdef __KERNEL__

#include <asm-generic/bitops/sched.h>

/**
 * fls64 - find last bit set in 64 bit word
 * @x: the word to search
 *
 * This is defined the same way as fls.
 */
static inline int fls64(__u64 x)
{
	if (x == 0)
		return 0;
	return __fls(x) + 1;
}

#define ARCH_HAS_FAST_MULTIPLIER 1

#include <asm-generic/bitops/hweight.h>

#endif /* __KERNEL__ */

#ifdef __KERNEL__

#include <asm-generic/bitops/ext2-non-atomic.h>

#define ext2_set_bit_atomic(lock, nr, addr)			\
	test_and_set_bit((nr), (unsigned long *)(addr))
#define ext2_clear_bit_atomic(lock, nr, addr)			\
	test_and_clear_bit((nr), (unsigned long *)(addr))

#include <asm-generic/bitops/minix.h>

#endif /* __KERNEL__ */

#endif /* _X86_64_BITOPS_H */
