summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-11-02 10:58:29 +0100
committerIngo Molnar <mingo@kernel.org>2017-11-02 10:58:29 +0100
commit50da9d439392fdd91601d36e7f05728265bff262 (patch)
tree6ca48c415676d32ffc0ee18a6cf048044a829a04 /include
parent3357b0d3c7323d73806571192e9f633bb6ba3d54 (diff)
parentc128dbfa0f879f8ce7b79054037889b0b2240728 (diff)
Merge branch 'x86/fpu' into x86/asm
We are about to commit complex rework of various x86 entry code details - create a unified base tree (with FPU commits included) before doing that. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bitops.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 8fbe259b197c..36794f058ba6 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -227,6 +227,32 @@ static inline unsigned long __ffs64(u64 word)
return __ffs((unsigned long)word);
}
+/*
+ * clear_bit32 - Clear a bit in memory for u32 array
+ * @nr: Bit to clear
+ * @addr: u32 * address of bitmap
+ *
+ * Same as clear_bit, but avoids needing casts for u32 arrays.
+ */
+
+static __always_inline void clear_bit32(long nr, volatile u32 *addr)
+{
+ clear_bit(nr, (volatile unsigned long *)addr);
+}
+
+/*
+ * set_bit32 - Set a bit in memory for u32 array
+ * @nr: Bit to clear
+ * @addr: u32 * address of bitmap
+ *
+ * Same as set_bit, but avoids needing casts for u32 arrays.
+ */
+
+static __always_inline void set_bit32(long nr, volatile u32 *addr)
+{
+ set_bit(nr, (volatile unsigned long *)addr);
+}
+
#ifdef __KERNEL__
#ifndef set_mask_bits