arch.h revision d3cc4ebf58ec05037c3b0dd7c83c075a56f1dc62
1#ifndef ARCH_H
2#define ARCH_H
3
4#ifdef __WORDSIZE
5#define BITS_PER_LONG	__WORDSIZE
6#else
7#define BITS_PER_LONG	32
8#endif
9
10enum {
11	arch_x86_64,
12	arch_i386,
13	arch_ppc,
14	arch_ia64,
15	arch_s390,
16	arch_alpha,
17	arch_sparc,
18	arch_sparc64,
19	arch_arm,
20	arch_sh,
21	arch_hppa,
22
23	arch_generic,
24};
25
26#if defined(__i386__)
27#include "arch-x86.h"
28#elif defined(__x86_64__)
29#include "arch-x86_64.h"
30#elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__)
31#include "arch-ppc.h"
32#elif defined(__ia64__)
33#include "arch-ia64.h"
34#elif defined(__alpha__)
35#include "arch-alpha.h"
36#elif defined(__s390x__) || defined(__s390__)
37#include "arch-s390.h"
38#elif defined(__sparc__)
39#include "arch-sparc.h"
40#elif defined(__sparc64__)
41#include "arch-sparc64.h"
42#elif defined(__arm__)
43#include "arch-arm.h"
44#elif defined(__mips__) || defined(__mips64__)
45#include "arch-mips.h"
46#elif defined(__sh__)
47#include "arch-sh.h"
48#elif defined(__hppa__)
49#include "arch-hppa.h"
50#else
51#warning "Unknown architecture, attempting to use generic model."
52#include "arch-generic.h"
53#endif
54
55#ifdef ARCH_HAVE_FFZ
56#define ffz(bitmask)	arch_ffz(bitmask)
57#else
58#include "../lib/ffz.h"
59#endif
60
61#ifndef ARCH_HAVE_INIT
62static inline int arch_init(char *envp[])
63{
64	return 0;
65}
66#endif
67
68enum {
69	ARCH_FLAG_1	= 1 << 0,
70	ARCH_FLAG_2	= 1 << 1,
71	ARCH_FLAG_3	= 1 << 2,
72	ARCH_FLAG_4	= 1 << 3,
73};
74
75#endif
76