Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db08bf08 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  asm-generic/io.h: allow people to override individual funcs
  bitops: remove duplicated extern declarations
  bitops: make asm-generic/bitops/find.h more generic
  asm-generic: kdebug.h: Checkpatch cleanup
  asm-generic: fcntl: make exported headers use strict posix types
  asm-generic: cmpxchg does not handle non-long arguments
  asm-generic: make atomic_add_unless a function
parents 092e0e7e 35dbc0e0
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -120,6 +120,7 @@ static inline unsigned long __arch_hweight64(__u64 w)


#include <asm-generic/bitops/const_hweight.h>
#include <asm-generic/bitops/const_hweight.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/lock.h>
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/sched.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/ext2-non-atomic.h>
#include <asm-generic/bitops/minix.h>
#include <asm-generic/bitops/minix.h>
+2 −0
Original line number Original line Diff line number Diff line
@@ -440,6 +440,8 @@ static inline int fls(int x)


#ifdef __KERNEL__
#ifdef __KERNEL__


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

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


#define ARCH_HAS_FAST_MULTIPLIER 1
#define ARCH_HAS_FAST_MULTIPLIER 1
+17 −17
Original line number Original line Diff line number Diff line
@@ -120,14 +120,23 @@ static inline void atomic_dec(atomic_t *v)
#define atomic_dec_and_test(v)		(atomic_sub_return(1, (v)) == 0)
#define atomic_dec_and_test(v)		(atomic_sub_return(1, (v)) == 0)
#define atomic_inc_and_test(v)		(atomic_add_return(1, (v)) == 0)
#define atomic_inc_and_test(v)		(atomic_add_return(1, (v)) == 0)


#define atomic_add_unless(v, a, u)				\
#define atomic_xchg(ptr, v)		(xchg(&(ptr)->counter, (v)))
({								\
#define atomic_cmpxchg(v, old, new)	(cmpxchg(&((v)->counter), (old), (new)))
	int c, old;						\

	c = atomic_read(v);					\
#define cmpxchg_local(ptr, o, n)				  	       \
	while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
	((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
		c = old;					\
			(unsigned long)(n), sizeof(*(ptr))))
	c != (u);						\

})
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))

static inline int atomic_add_unless(atomic_t *v, int a, int u)
{
  int c, old;
  c = atomic_read(v);
  while (c != u && (old = atomic_cmpxchg(v, c, c + a)) != c)
    c = old;
  return c != u;
}


#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)


@@ -141,15 +150,6 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
	raw_local_irq_restore(flags);
	raw_local_irq_restore(flags);
}
}


#define atomic_xchg(ptr, v)		(xchg(&(ptr)->counter, (v)))
#define atomic_cmpxchg(v, old, new)	(cmpxchg(&((v)->counter), (old), (new)))

#define cmpxchg_local(ptr, o, n)				  	       \
	((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
			(unsigned long)(n), sizeof(*(ptr))))

#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))

/* Assume that atomic operations are already serializing */
/* Assume that atomic operations are already serializing */
#define smp_mb__before_atomic_dec()	barrier()
#define smp_mb__before_atomic_dec()	barrier()
#define smp_mb__after_atomic_dec()	barrier()
#define smp_mb__after_atomic_dec()	barrier()
+37 −2
Original line number Original line Diff line number Diff line
#ifndef _ASM_GENERIC_BITOPS_FIND_H_
#ifndef _ASM_GENERIC_BITOPS_FIND_H_
#define _ASM_GENERIC_BITOPS_FIND_H_
#define _ASM_GENERIC_BITOPS_FIND_H_


#ifndef CONFIG_GENERIC_FIND_NEXT_BIT
/**
 * find_next_bit - find the next set bit in a memory region
 * @addr: The address to base the search on
 * @offset: The bitnumber to start searching at
 * @size: The bitmap size in bits
 */
extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
		size, unsigned long offset);
		size, unsigned long offset);


/**
 * find_next_zero_bit - find the next cleared bit in a memory region
 * @addr: The address to base the search on
 * @offset: The bitnumber to start searching at
 * @size: The bitmap size in bits
 */
extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
		long size, unsigned long offset);
		long size, unsigned long offset);
#endif

#ifdef CONFIG_GENERIC_FIND_FIRST_BIT

/**
 * find_first_bit - find the first set bit in a memory region
 * @addr: The address to start the search at
 * @size: The maximum size to search
 *
 * Returns the bit number of the first set bit.
 */
extern unsigned long find_first_bit(const unsigned long *addr,
				    unsigned long size);

/**
 * find_first_zero_bit - find the first cleared bit in a memory region
 * @addr: The address to start the search at
 * @size: The maximum size to search
 *
 * Returns the bit number of the first cleared bit.
 */
extern unsigned long find_first_zero_bit(const unsigned long *addr,
					 unsigned long size);
#else /* CONFIG_GENERIC_FIND_FIRST_BIT */


#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)


#endif /* CONFIG_GENERIC_FIND_FIRST_BIT */

#endif /*_ASM_GENERIC_BITOPS_FIND_H_ */
#endif /*_ASM_GENERIC_BITOPS_FIND_H_ */
+1 −1
Original line number Original line Diff line number Diff line
@@ -122,7 +122,7 @@


struct f_owner_ex {
struct f_owner_ex {
	int	type;
	int	type;
	pid_t	pid;
	__kernel_pid_t	pid;
};
};


/* for F_[GET|SET]FL */
/* for F_[GET|SET]FL */
Loading