Add common way to access bit ranges, log all NVMe devices on startup

This commit is contained in:
2026-07-27 20:45:00 +03:00
parent 572cb7647f
commit a2128de3e2
5 changed files with 134 additions and 33 deletions
+4
View File
@@ -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