blob: a47b8a71d6fe126464564e05559e4763f0c006e9 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Arnd Bergmann9858c602009-05-13 22:56:32 +00002#ifndef __ASM_GENERIC_BITOPS_H
3#define __ASM_GENERIC_BITOPS_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
5/*
6 * For the benefit of those who are trying to port Linux to another
Will Deacon5d0c9b02020-02-13 09:39:27 +00007 * architecture, here are some C-language equivalents. They should
8 * generate reasonable code, so take a look at what your compiler spits
9 * out before rolling your own buggy implementation in assembly language.
Arnd Bergmann9858c602009-05-13 22:56:32 +000010 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070011 * C language equivalents written by Theodore Ts'o, 9/26/92
12 */
13
Arnd Bergmann9858c602009-05-13 22:56:32 +000014#include <linux/irqflags.h>
15#include <linux/compiler.h>
Peter Zijlstrafebdbfe2014-02-06 18:16:07 +010016#include <asm/barrier.h>
Arnd Bergmann9858c602009-05-13 22:56:32 +000017
Akinobu Mitaf51a05c2006-03-26 01:39:50 -080018#include <asm-generic/bitops/__ffs.h>
19#include <asm-generic/bitops/ffz.h>
20#include <asm-generic/bitops/fls.h>
Arnd Bergmann9858c602009-05-13 22:56:32 +000021#include <asm-generic/bitops/__fls.h>
Akinobu Mitaf51a05c2006-03-26 01:39:50 -080022#include <asm-generic/bitops/fls64.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Jiri Slaby06245172007-10-18 23:40:26 -070024#ifndef _LINUX_BITOPS_H
25#error only <linux/bitops.h> can be included directly
26#endif
27
Akinobu Mitaf51a05c2006-03-26 01:39:50 -080028#include <asm-generic/bitops/sched.h>
29#include <asm-generic/bitops/ffs.h>
30#include <asm-generic/bitops/hweight.h>
Nick Piggin26333572007-10-18 03:06:39 -070031#include <asm-generic/bitops/lock.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Arnd Bergmann9858c602009-05-13 22:56:32 +000033#include <asm-generic/bitops/atomic.h>
34#include <asm-generic/bitops/non-atomic.h>
Akinobu Mita861b5ae2011-03-23 16:42:02 -070035#include <asm-generic/bitops/le.h>
Akinobu Mitaf51a05c2006-03-26 01:39:50 -080036#include <asm-generic/bitops/ext2-atomic.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Arnd Bergmann9858c602009-05-13 22:56:32 +000038#endif /* __ASM_GENERIC_BITOPS_H */