Xenomai 3.3.2
Loading...
Searching...
No Matches
arith.h
1
20#ifndef _COBALT_ARITH_H
21#define _COBALT_ARITH_H
22
23#include <stddef.h>
24#include <endian.h>
25
26#if __BYTE_ORDER == __BIG_ENDIAN
27#define endianstruct { unsigned int _h; unsigned int _l; }
28#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
29#define endianstruct { unsigned int _l; unsigned int _h; }
30#endif /* __BYTE_ORDER == __LITTLE_ENDIAN */
31
32static inline unsigned xnarch_do_div(unsigned long long *a, unsigned d)
33{
34 unsigned int r = *a % d;
35 *a /= d;
36
37 return r;
38}
39
40#define do_div(a, d) xnarch_do_div(&(a), (d))
41
42#include <asm/xenomai/features.h>
43#include <asm/xenomai/uapi/arith.h>
44
45#endif /* !_COBALT_ARITH_H */