Xenomai  3.1
machine.h
1 
23 #ifndef _COBALT_ARM_ASM_MACHINE_H
24 #define _COBALT_ARM_ASM_MACHINE_H
25 
26 #include <linux/version.h>
27 #include <asm/byteorder.h>
28 
29 #define XNARCH_HOST_TICK_IRQ __ipipe_hrtimer_irq
30 
31 #include <asm/barrier.h>
32 #include <asm/compiler.h>
33 #include <asm/cmpxchg.h>
34 #include <asm/switch_to.h>
35 #include <asm/system_info.h>
36 #include <asm/system_misc.h>
37 #include <asm/timex.h>
38 #include <asm/processor.h>
39 #include <asm/ipipe.h>
40 #include <asm/mach/irq.h>
41 #include <asm/cacheflush.h>
42 
43 #define xnarch_cache_aliasing() cache_is_vivt()
44 
45 #if __LINUX_ARM_ARCH__ < 5
46 static inline __attribute_const__ unsigned long ffnz(unsigned long x)
47 {
48  int r = 0;
49 
50  if (!x)
51  return 0;
52  if (!(x & 0xffff)) {
53  x >>= 16;
54  r += 16;
55  }
56  if (!(x & 0xff)) {
57  x >>= 8;
58  r += 8;
59  }
60  if (!(x & 0xf)) {
61  x >>= 4;
62  r += 4;
63  }
64  if (!(x & 3)) {
65  x >>= 2;
66  r += 2;
67  }
68  if (!(x & 1)) {
69  x >>= 1;
70  r += 1;
71  }
72  return r;
73 }
74 #else
75 static inline __attribute_const__ unsigned long ffnz(unsigned long ul)
76 {
77  int __r;
78  __asm__("clz\t%0, %1" : "=r" (__r) : "r"(ul & (-ul)) : "cc");
79  return 31 - __r;
80 }
81 #endif
82 
83 #include <asm-generic/xenomai/machine.h>
84 
85 #endif /* !_COBALT_ARM_ASM_MACHINE_H */