mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
arm: bitops: fixed bitops to access more than 32 bits
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
c97911a5f2
commit
1ef1c80f3d
@@ -20,22 +20,26 @@
|
||||
#define ADDR BITOP_ADDR(addr)
|
||||
|
||||
static inline void set_bit(int nr, volatile unsigned long *addr) {
|
||||
*addr |= (1 << nr);
|
||||
addr += nr / BITS_PER_LONG;
|
||||
*addr |= (1 << (nr % BITS_PER_LONG));
|
||||
}
|
||||
|
||||
static inline void change_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
*addr ^= (1 << nr);
|
||||
addr += nr / BITS_PER_LONG;
|
||||
*addr ^= (1 << (nr % BITS_PER_LONG));
|
||||
}
|
||||
|
||||
static inline int test_bit(int nr, volatile const unsigned long *addr)
|
||||
{
|
||||
return (*addr & (1 << nr)) ? -1 : 0;
|
||||
addr += nr / BITS_PER_LONG;
|
||||
return (*addr & (1 << (nr % BITS_PER_LONG))) ? -1 : 0;
|
||||
}
|
||||
|
||||
static inline void clear_bit(int nr, volatile unsigned long *addr)
|
||||
{
|
||||
*addr &= ~(1 << nr);
|
||||
addr += nr / BITS_PER_LONG;
|
||||
*addr &= ~(1 << (nr % BITS_PER_LONG));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user