mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-23 18:37:50 +00:00
Acked-by: Mike Rapoport <rppt@linux.ibm.com> Signed-off-by: Adrian Reber <areber@redhat.com>
24 lines
497 B
C
24 lines
497 B
C
#ifndef __CR_COMMON_BITOPS_H__
|
|
#define __CR_COMMON_BITOPS_H__
|
|
#include "common/asm/bitops.h"
|
|
|
|
#include "common/bitsperlong.h"
|
|
#include <endian.h>
|
|
|
|
#if __BYTE_ORDER == __BIG_ENDIAN
|
|
#define BITOP_LE_SWIZZLE ((BITS_PER_LONG - 1) & ~0x7)
|
|
#else
|
|
#define BITOP_LE_SWIZZLE 0
|
|
#endif
|
|
|
|
static inline int test_and_set_bit_le(int nr, void *addr)
|
|
{
|
|
return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
|
|
}
|
|
|
|
static inline void clear_bit_le(int nr, void *addr)
|
|
{
|
|
clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
|
|
}
|
|
#endif
|