Files
mckernel/lib/include/bitops-set_bit.h
Tomoki Shirasawa b0096a2740 fix REQ-51
2016-03-26 12:23:51 +09:00

15 lines
335 B
C

/* bitops-set_bit.h COPYRIGHT FUJITSU LIMITED 2014 */
#ifndef INCLUDE_BITOPS_SET_BIT_H
#define INCLUDE_BITOPS_SET_BIT_H
static inline void set_bit(int nr, volatile unsigned long *addr)
{
unsigned long mask = (1UL << (nr % BITS_PER_LONG));
unsigned long *p = ((unsigned long *)addr) + (nr / BITS_PER_LONG);
*p |= mask;
}
#endif