Add common way to access bit ranges, log all NVMe devices on startup
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
|
||||
#define NUL 0 // TODO Fix VSCode thinking `NULL` conflicts with some other definition.
|
||||
|
||||
#define ONES(h, l) ((1ULL << ((h) - (l) + 1)) - 1)
|
||||
#define BITS_R(s, h, l) (((s) >> (l)) & ONES(h, l))
|
||||
#define BITS_W(s, h, l, v) ((s) = (__typeof__(s))(((s) & ~(ONES(h, l) << (l))) | (((v) & ONES(h, l)) << (l))))
|
||||
|
||||
#define STDIN 0
|
||||
#define STDOUT 1
|
||||
#define STDERR 2
|
||||
|
||||
Reference in New Issue
Block a user