adjust exec_param to keep track of sp_el0, fix incorrect use sys regs
[lunaix-os.git] / lunaix-os / arch / generic / includes / asm-generic / bits.h
1 #ifndef __LUNAIX_ARCH_GENERIC_BITS_H
2 #define __LUNAIX_ARCH_GENERIC_BITS_H
3
4 #define _BITS_GENMASK(h, l)     \
5         (((1UL << ((h) + 1)) - 1) ^ ((1UL << (l)) - 1))
6
7 #define _BITS_EXTRACT(from, h, l)     \
8         (((from) & (((1UL << (h + 1)) - 1) ^ ((1UL << l) - 1))) >> l)
9
10 #define _BITS_INSERT(to, from, h, l)    \
11         (((to) & ~_BITS_GENMASK(h, l)) | (((from) << l) & _BITS_GENMASK(h, l)))
12
13 #endif /* __LUNAIX_ARCH_BITS_H */