bitops.h (27eb2c4b3d3e13f376a359e293c212a2e9407af5) | bitops.h (e22a22740c1ac23aaa10835f026b3549ee3e4e75) |
---|---|
1/* 2 * PowerPC atomic bit operations. 3 * 4 * Merged version by David Gibson <david@gibson.dropbear.id.au>. 5 * Based on ppc64 versions by: Dave Engebretsen, Todd Inglett, Don 6 * Reed, Pat McCarthy, Peter Bergner, Anton Blanchard. They 7 * originally took it from the ppc32 code. 8 * --- 32 unchanged lines hidden (view full) --- 41#ifndef _LINUX_BITOPS_H 42#error only <linux/bitops.h> can be included directly 43#endif 44 45#include <linux/compiler.h> 46#include <asm/asm-compat.h> 47#include <asm/synch.h> 48 | 1/* 2 * PowerPC atomic bit operations. 3 * 4 * Merged version by David Gibson <david@gibson.dropbear.id.au>. 5 * Based on ppc64 versions by: Dave Engebretsen, Todd Inglett, Don 6 * Reed, Pat McCarthy, Peter Bergner, Anton Blanchard. They 7 * originally took it from the ppc32 code. 8 * --- 32 unchanged lines hidden (view full) --- 41#ifndef _LINUX_BITOPS_H 42#error only <linux/bitops.h> can be included directly 43#endif 44 45#include <linux/compiler.h> 46#include <asm/asm-compat.h> 47#include <asm/synch.h> 48 |
49/* PPC bit number conversion */ 50#define PPC_BITLSHIFT(be) (BITS_PER_LONG - 1 - (be)) 51#define PPC_BIT(bit) (1UL << PPC_BITLSHIFT(bit)) 52#define PPC_BITMASK(bs, be) ((PPC_BIT(bs) - PPC_BIT(be)) | PPC_BIT(bs)) 53 |
|
49/* 50 * clear_bit doesn't imply a memory barrier 51 */ 52#define smp_mb__before_clear_bit() smp_mb() 53#define smp_mb__after_clear_bit() smp_mb() 54 55/* Macro for generating the ***_bits() functions */ 56#define DEFINE_BITOP(fn, op, prefix) \ --- 232 unchanged lines hidden --- | 54/* 55 * clear_bit doesn't imply a memory barrier 56 */ 57#define smp_mb__before_clear_bit() smp_mb() 58#define smp_mb__after_clear_bit() smp_mb() 59 60/* Macro for generating the ***_bits() functions */ 61#define DEFINE_BITOP(fn, op, prefix) \ --- 232 unchanged lines hidden --- |