Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * bitops.h: Bit string operations on the V9.
0004  *
0005  * Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
0006  */
0007 
0008 #ifndef _SPARC64_BITOPS_H
0009 #define _SPARC64_BITOPS_H
0010 
0011 #ifndef _LINUX_BITOPS_H
0012 #error only <linux/bitops.h> can be included directly
0013 #endif
0014 
0015 #include <linux/compiler.h>
0016 #include <asm/byteorder.h>
0017 #include <asm/barrier.h>
0018 
0019 int test_and_set_bit(unsigned long nr, volatile unsigned long *addr);
0020 int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr);
0021 int test_and_change_bit(unsigned long nr, volatile unsigned long *addr);
0022 void set_bit(unsigned long nr, volatile unsigned long *addr);
0023 void clear_bit(unsigned long nr, volatile unsigned long *addr);
0024 void change_bit(unsigned long nr, volatile unsigned long *addr);
0025 
0026 int fls(unsigned int word);
0027 int __fls(unsigned long word);
0028 
0029 #include <asm-generic/bitops/non-atomic.h>
0030 
0031 #include <asm-generic/bitops/fls64.h>
0032 
0033 #ifdef __KERNEL__
0034 
0035 int ffs(int x);
0036 unsigned long __ffs(unsigned long);
0037 
0038 #include <asm-generic/bitops/ffz.h>
0039 #include <asm-generic/bitops/sched.h>
0040 
0041 /*
0042  * hweightN: returns the hamming weight (i.e. the number
0043  * of bits set) of a N-bit word
0044  */
0045 
0046 unsigned long __arch_hweight64(__u64 w);
0047 unsigned int __arch_hweight32(unsigned int w);
0048 unsigned int __arch_hweight16(unsigned int w);
0049 unsigned int __arch_hweight8(unsigned int w);
0050 
0051 #include <asm-generic/bitops/const_hweight.h>
0052 #include <asm-generic/bitops/lock.h>
0053 #endif /* __KERNEL__ */
0054 
0055 #ifdef __KERNEL__
0056 
0057 #include <asm-generic/bitops/le.h>
0058 
0059 #include <asm-generic/bitops/ext2-atomic-setbit.h>
0060 
0061 #endif /* __KERNEL__ */
0062 
0063 #endif /* defined(_SPARC64_BITOPS_H) */