add ntfs_rol32 and ntfs_ror32

master
szaka 2007-09-02 12:36:33 +00:00
parent 8e86ba6e8f
commit 921457fd65
1 changed files with 22 additions and 0 deletions

View File

@ -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 */