LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
tools.h
Go to the documentation of this file.
1
9#ifndef KERNEL_KERNEL_TOOLS_H
10#define KERNEL_KERNEL_TOOLS_H
11
12#define ROR(x,y) (((unsigned)(x) >> (y)) | ((unsigned)(x) << (32 - (y))))
13#define ROL(x,y) (((unsigned)(x) << (y)) | ((unsigned)(x) >> (32 - (y))))
14
21static inline unsigned ror(const unsigned x, const unsigned y)
22{
23 return ROR(x, y);
24}
25
32static inline unsigned rol(const unsigned x, const unsigned y)
33{
34 return ROL(x, y);
35}
36
37#endif
static unsigned rol(const unsigned x, const unsigned y)
Rotates a 32-bit value left by a specified number of bits.
Definition tools.h:32
static unsigned ror(const unsigned x, const unsigned y)
Rotates a 32-bit value right by a specified number of bits.
Definition tools.h:21