[bitops] Add generic atomic bit test, set, and clear functions

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2016-03-16 21:18:33 +00:00
parent 2246a6b274
commit c867b5ab1f
4 changed files with 216 additions and 0 deletions

19
src/include/ipxe/bitops.h Normal file
View File

@@ -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 */