~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sparc/include/asm/bitops_32.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * bitops.h: Bit string operations on the Sparc.
  4  *
  5  * Copyright 1995 David S. Miller (davem@caip.rutgers.edu)
  6  * Copyright 1996 Eddie C. Dost   (ecd@skynet.be)
  7  * Copyright 2001 Anton Blanchard (anton@samba.org)
  8  */
  9 
 10 #ifndef _SPARC_BITOPS_H
 11 #define _SPARC_BITOPS_H
 12 
 13 #include <linux/compiler.h>
 14 #include <asm/byteorder.h>
 15 
 16 #ifdef __KERNEL__
 17 
 18 #ifndef _LINUX_BITOPS_H
 19 #error only <linux/bitops.h> can be included directly
 20 #endif
 21 
 22 unsigned long sp32___set_bit(unsigned long *addr, unsigned long mask);
 23 unsigned long sp32___clear_bit(unsigned long *addr, unsigned long mask);
 24 unsigned long sp32___change_bit(unsigned long *addr, unsigned long mask);
 25 
 26 /*
 27  * Set bit 'nr' in 32-bit quantity at address 'addr' where bit ''
 28  * is in the highest of the four bytes and bit '31' is the high bit
 29  * within the first byte. Sparc is BIG-Endian. Unless noted otherwise
 30  * all bit-ops return 0 if bit was previously clear and != 0 otherwise.
 31  */
 32 static inline int test_and_set_bit(unsigned long nr, volatile unsigned long *addr)
 33 {
 34         unsigned long *ADDR, mask;
 35 
 36         ADDR = ((unsigned long *) addr) + (nr >> 5);
 37         mask = 1 << (nr & 31);
 38 
 39         return sp32___set_bit(ADDR, mask) != 0;
 40 }
 41 
 42 static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
 43 {
 44         unsigned long *ADDR, mask;
 45 
 46         ADDR = ((unsigned long *) addr) + (nr >> 5);
 47         mask = 1 << (nr & 31);
 48 
 49         (void) sp32___set_bit(ADDR, mask);
 50 }
 51 
 52 static inline int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr)
 53 {
 54         unsigned long *ADDR, mask;
 55 
 56         ADDR = ((unsigned long *) addr) + (nr >> 5);
 57         mask = 1 << (nr & 31);
 58 
 59         return sp32___clear_bit(ADDR, mask) != 0;
 60 }
 61 
 62 static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
 63 {
 64         unsigned long *ADDR, mask;
 65 
 66         ADDR = ((unsigned long *) addr) + (nr >> 5);
 67         mask = 1 << (nr & 31);
 68 
 69         (void) sp32___clear_bit(ADDR, mask);
 70 }
 71 
 72 static inline int test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
 73 {
 74         unsigned long *ADDR, mask;
 75 
 76         ADDR = ((unsigned long *) addr) + (nr >> 5);
 77         mask = 1 << (nr & 31);
 78 
 79         return sp32___change_bit(ADDR, mask) != 0;
 80 }
 81 
 82 static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
 83 {
 84         unsigned long *ADDR, mask;
 85 
 86         ADDR = ((unsigned long *) addr) + (nr >> 5);
 87         mask = 1 << (nr & 31);
 88 
 89         (void) sp32___change_bit(ADDR, mask);
 90 }
 91 
 92 #include <asm-generic/bitops/non-atomic.h>
 93 
 94 #include <asm-generic/bitops/ffz.h>
 95 #include <asm-generic/bitops/__ffs.h>
 96 #include <asm-generic/bitops/sched.h>
 97 #include <asm-generic/bitops/ffs.h>
 98 #include <asm-generic/bitops/fls.h>
 99 #include <asm-generic/bitops/__fls.h>
100 #include <asm-generic/bitops/fls64.h>
101 #include <asm-generic/bitops/hweight.h>
102 #include <asm-generic/bitops/lock.h>
103 #include <asm-generic/bitops/le.h>
104 #include <asm-generic/bitops/ext2-atomic.h>
105 
106 #endif /* __KERNEL__ */
107 
108 #endif /* defined(_SPARC_BITOPS_H) */
109 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php