move syscall_nr to generic for sharing between arch impls
[lunaix-os.git] / lunaix-os / arch / generic / includes / asm-generic / bits.h
index 430e3954669c566d114bfbdfb1475cb5ed1b371d..e736f0dde0db5bc5292b37e08c22703d999cc757 100644 (file)
@@ -2,12 +2,15 @@
 #define __LUNAIX_ARCH_GENERIC_BITS_H
 
 #define _BITS_GENMASK(h, l)     \
-        (((1UL << ((h) + 1)) - 1) ^ ((1UL << (l)) - 1))
+        (((1 << ((h) + 1)) - 1) ^ ((1 << (l)) - 1))
 
 #define _BITS_EXTRACT(from, h, l)     \
-        (((from) & (((1UL << (h + 1)) - 1) ^ ((1UL << l) - 1))) >> l)
+        (((from) & (((1 << (h + 1)) - 1) ^ ((1 << (l)) - 1))) >> (l))
 
 #define _BITS_INSERT(to, from, h, l)    \
-        (((to) & ~_BITS_GENMASK(h, l)) | (((from) << l) & _BITS_GENMASK(h, l)))
+        (((to) & ~_BITS_GENMASK(h, l)) | (((from) << (l)) & _BITS_GENMASK(h, l)))
+
+#define _BITS_STATIC(val, h, l)         \
+        (((val) & _BITS_GENMASK(h, l)) << (l))
 
 #endif /* __LUNAIX_ARCH_BITS_H */