From 921457fd65cc0f98c0f4b94e553f91d6527abc84 Mon Sep 17 00:00:00 2001 From: szaka Date: Sun, 2 Sep 2007 12:36:33 +0000 Subject: [PATCH] add ntfs_rol32 and ntfs_ror32 --- include/ntfs-3g/bitmap.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/ntfs-3g/bitmap.h b/include/ntfs-3g/bitmap.h index 56d1f64e..10b5f6c5 100644 --- a/include/ntfs-3g/bitmap.h +++ b/include/ntfs-3g/bitmap.h @@ -70,5 +70,27 @@ static __inline__ int ntfs_bitmap_clear_bit(ntfs_attr *na, s64 bit) return ntfs_bitmap_clear_run(na, bit, 1); } +/* + * rol32 - rotate a 32-bit value left + * + * @word: value to rotate + * @shift: bits to roll + */ +static __inline__ u32 ntfs_rol32(u32 word, unsigned int shift) +{ + return (word << shift) | (word >> (32 - shift)); +} + +/* + * ror32 - rotate a 32-bit value right + * + * @word: value to rotate + * @shift: bits to roll + */ +static __inline__ u32 ntfs_ror32(u32 word, unsigned int shift) +{ + return (word >> shift) | (word << (32 - shift)); +} + #endif /* defined _NTFS_BITMAP_H */