Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/linuxkpi/common/include/linux/bitmap.h
Show All 24 Lines | |||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _LINUX_BITMAP_H_ | #ifndef _LINUX_BITMAP_H_ | ||||
#define _LINUX_BITMAP_H_ | #define _LINUX_BITMAP_H_ | ||||
#include <linux/bitops.h> | #include <linux/bitops.h> | ||||
#include <linux/slab.h> | |||||
static inline void | static inline void | ||||
bitmap_zero(unsigned long *addr, const unsigned int size) | bitmap_zero(unsigned long *addr, const unsigned int size) | ||||
{ | { | ||||
memset(addr, 0, BITS_TO_LONGS(size) * sizeof(long)); | memset(addr, 0, BITS_TO_LONGS(size) * sizeof(long)); | ||||
} | } | ||||
static inline void | static inline void | ||||
▲ Show 20 Lines • Show All 261 Lines • ▼ Show 20 Lines | |||||
bitmap_xor(unsigned long *dst, const unsigned long *src1, | bitmap_xor(unsigned long *dst, const unsigned long *src1, | ||||
const unsigned long *src2, const unsigned int size) | const unsigned long *src2, const unsigned int size) | ||||
{ | { | ||||
const unsigned int end = BITS_TO_LONGS(size); | const unsigned int end = BITS_TO_LONGS(size); | ||||
unsigned int i; | unsigned int i; | ||||
for (i = 0; i != end; i++) | for (i = 0; i != end; i++) | ||||
dst[i] = src1[i] ^ src2[i]; | dst[i] = src1[i] ^ src2[i]; | ||||
} | |||||
static inline void | |||||
bitmap_free(const unsigned long *bitmap) | |||||
{ | |||||
kfree(bitmap); | |||||
} | } | ||||
#endif /* _LINUX_BITMAP_H_ */ | #endif /* _LINUX_BITMAP_H_ */ |