NeKernel dev
Loading...
Searching...
No Matches
BitManip.h
Go to the documentation of this file.
1/* ========================================
2
3 Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
4
5======================================== */
6
7#ifndef __BITMANIP_H__
8#define __BITMANIP_H__
9
12
13#define bk_set_bit(X, O) X = (1 << O) | X
14#define bk_clear_bit(X, O) X = ~(1 << O) & X
15#define bk_toogle(X, O) X = (1 << O) ^ X
16#define bk_lsb(X) X = X & -X
17#define bk_msb(X) X = -(mp_lsb(X)) & X
18#define bk_look_for_bit(X, O) (1 << O) | X
19
20#endif // ifndef __BITMANIP_H__