From c867b5ab1ff00fae7f5d89bc0c5f273c40f37f90 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 16 Mar 2016 21:18:33 +0000 Subject: [bitops] Add generic atomic bit test, set, and clear functions Signed-off-by: Michael Brown --- src/include/ipxe/bitops.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/include/ipxe/bitops.h (limited to 'src/include') 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 + +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 */ -- cgit v1.2.3-55-g7522