LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
tools.h File Reference

Extra kernel utilities. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ROR(x, y)
#define ROL(x, y)

Functions

static unsigned ror (const unsigned x, const unsigned y)
 Rotates a 32-bit value right by a specified number of bits.
static unsigned rol (const unsigned x, const unsigned y)
 Rotates a 32-bit value left by a specified number of bits.

Detailed Description

Extra kernel utilities.

Author
Matheus Boscariol
Since
15/11/2026

Definition in file tools.h.

Macro Definition Documentation

◆ ROL

#define ROL ( x,
y )
Value:
(((unsigned)(x) << (y)) | ((unsigned)(x) >> (32 - (y))))

Definition at line 13 of file tools.h.

◆ ROR

#define ROR ( x,
y )
Value:
(((unsigned)(x) >> (y)) | ((unsigned)(x) << (32 - (y))))

Definition at line 12 of file tools.h.

Function Documentation

◆ rol()

unsigned rol ( const unsigned x,
const unsigned y )
inlinestatic

Rotates a 32-bit value left by a specified number of bits.

Parameters
xThe value to rotate
yThe number of bits to rotate by
Returns
The rotated value

Definition at line 32 of file tools.h.

◆ ror()

unsigned ror ( const unsigned x,
const unsigned y )
inlinestatic

Rotates a 32-bit value right by a specified number of bits.

Parameters
xThe value to rotate
yThe number of bits to rotate by
Returns
The rotated value

Definition at line 21 of file tools.h.