summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2016-03-16 22:18:33 +0100
committerMichael Brown2016-03-16 23:33:40 +0100
commitc867b5ab1ff00fae7f5d89bc0c5f273c40f37f90 (patch)
treecd90bd4d94a1576c9cb15aa9ced285373ad8adee /src/include
parent[pseudobit] Rename bitops.h to pseudobit.h (diff)
downloadipxe-c867b5ab1ff00fae7f5d89bc0c5f273c40f37f90.tar.gz
ipxe-c867b5ab1ff00fae7f5d89bc0c5f273c40f37f90.tar.xz
ipxe-c867b5ab1ff00fae7f5d89bc0c5f273c40f37f90.zip
[bitops] Add generic atomic bit test, set, and clear functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/bitops.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/include/ipxe/bitops.h b/src/include/ipxe/bitops.h
new file mode 100644
index 000000000..7366cd9f1
--- /dev/null
+++ b/src/include/ipxe/bitops.h
@@ -0,0 +1,19 @@
+#ifndef _IPXE_BITOPS_H
+#define _IPXE_BITOPS_H
+
+/** @file
+ *
+ * Bit operations
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#include <bits/bitops.h>
+
+void set_bit ( unsigned int bit, volatile void *bits );
+void clear_bit ( unsigned int bit, volatile void *bits );
+int test_and_set_bit ( unsigned int bit, volatile void *bits );
+int test_and_clear_bit ( unsigned int bit, volatile void *bits );
+
+#endif /* _IPXE_BITOPS_H */