Merge branch 'master' into isa/arm64
[lunaix-os.git] / lunaix-os / arch / generic / includes / asm-generic / muldiv64.h
1 #ifndef __LUNAIX_ARCH_GENERIC_MULDIV64_H
2 #define __LUNAIX_ARCH_GENERIC_MULDIV64_H
3
4 #include <lunaix/types.h>
5
6 #ifdef CONFIG_ARCH_BITS_64
7 static inline u64_t
8 udiv64(u64_t n, unsigned int base)
9 {
10     return n / base;
11 }
12
13 static inline unsigned int
14 umod64(u64_t n, unsigned int base)
15 {
16     return n % base;
17 }
18 #else
19 #error "no generic muldiv64 for 32 bits arch"
20 #endif
21
22
23 #endif /* __LUNAIX_ARCH_MULDIV64_H */