blob: 745bf3a4d0a6260dffc37b475e3b3479e966ba48 [file] [log] [blame]
Jens Axboeebac4652005-12-08 15:25:21 +01001#ifndef ARCH_H
2#define ARCH_H
3
4enum {
5 arch_x86_64,
6 arch_i386,
7 arch_ppc,
8 arch_ia64,
9 arch_s390,
10 arch_alpha,
11};
12
13static inline unsigned long generic_ffz(unsigned long word)
14{
15 unsigned int i;
16
17 for (i = 0; i < sizeof(word) * 8; i++)
18 if ((word & (1UL << i)) == 0)
19 return i;
20
21 return -1;
22}
23
24#if defined(__i386__)
25#include "arch-x86.h"
26#elif defined(__x86_64__)
27#include "arch-x86_64.h"
28#elif defined(__powerpc__) || defined(__powerpc64__)
29#include "arch-ppc.h"
30#elif defined(__ia64__)
31#include "arch-ia64.h"
32#elif defined(__alpha__)
33#include "arch-alpha.h"
34#elif defined(__s390x__) || defined(__s390__)
35#include "arch-s390.h"
36#else
37#error "Unsupported arch"
38#endif
39
40#define BITS_PER_LONG (__WORDSIZE)
41
42#endif