Rename gpxe to .
[grub-extras.git] / src / include / gpxe / rotate.h
blob0371c578b4e049f5aada0f1a810cee858fad9f3f
1 #ifndef _GPXE_ROTATE_H
2 #define _GPXE_ROTATE_H
4 /** @file
6 * Bit operations
7 */
9 FILE_LICENCE ( GPL2_OR_LATER );
11 #include <stdint.h>
13 static inline uint32_t rol32 ( uint32_t data, unsigned int rotation ) {
14 return ( ( data << rotation ) | ( data >> ( 32 - rotation ) ) );
17 static inline uint32_t ror32 ( uint32_t data, unsigned int rotation ) {
18 return ( ( data >> rotation ) | ( data << ( 32 - rotation ) ) );
21 static inline uint64_t rol64 ( uint64_t data, unsigned int rotation ) {
22 return ( ( data << rotation ) | ( data >> ( 64 - rotation ) ) );
25 static inline uint64_t ror64 ( uint64_t data, unsigned int rotation ) {
26 return ( ( data >> rotation ) | ( data << ( 64 - rotation ) ) );
29 #endif /* _GPXE_ROTATE_H */