diff options
Diffstat (limited to 'ast27x0/include/io.h')
-rw-r--r-- | ast27x0/include/io.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ast27x0/include/io.h b/ast27x0/include/io.h index fab6546..6813940 100644 --- a/ast27x0/include/io.h +++ b/ast27x0/include/io.h @@ -27,4 +27,12 @@ #define writel(value, addr) (*(volatile unsigned int *)(addr) = (unsigned int)(value)) #define writeq(value, addr) (*(volatile unsigned long long *)(addr) = (unsigned long long)(value)) +#define BITS_PER_LONG (sizeof(unsigned long) * 8) +#define GENMASK(h, l) \ + (((~0UL) >> (BITS_PER_LONG - ((h) - (l) + 1))) << (l)) + +#define BIT(x) (1UL << (x)) + +#define ALIGN_UP(x, align) (((x) + ((align) - 1)) & ~((align) - 1)) + #endif /* __AST27X0_INCLUDE_IO_H__ */ |