- supported.conf: Added sparse_keymap (eeepc_laptop depends on it)
[linux-flexiantxendom0-3.2.10.git] / drivers / xen / sfc_netback / ci / compat / sysdep.h
1 /****************************************************************************
2  * Copyright 2002-2005: Level 5 Networks Inc.
3  * Copyright 2005-2008: Solarflare Communications Inc,
4  *                      9501 Jeronimo Road, Suite 250,
5  *                      Irvine, CA 92618, USA
6  *
7  * Maintained by Solarflare Communications
8  *  <linux-xen-drivers@solarflare.com>
9  *  <onload-dev@solarflare.com>
10  *
11  * This program is free software; you can redistribute it and/or modify it
12  * under the terms of the GNU General Public License version 2 as published
13  * by the Free Software Foundation, incorporated herein by reference.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23  ****************************************************************************
24  */
25
26 /*! \cidoxg_include_ci_compat  */
27
28 #ifndef __CI_COMPAT_SYSDEP_H__
29 #define __CI_COMPAT_SYSDEP_H__
30
31
32 /**********************************************************************
33  * Platform definition fixups.
34  */
35
36 #if defined(__ci_ul_driver__) && !defined(__ci_driver__)
37 # define __ci_driver__
38 #endif
39
40 #if defined(__ci_driver__) && !defined(__ci_ul_driver__) && \
41    !defined(__KERNEL__)
42 # define __KERNEL__
43 #endif
44
45
46 /**********************************************************************
47  * Sanity checks (no cheating!)
48  */
49
50 #if defined(__KERNEL__) && !defined(__ci_driver__)
51 # error Insane.
52 #endif
53
54 #if defined(__KERNEL__) && defined(__ci_ul_driver__)
55 # error Madness.
56 #endif
57
58 #if defined(__unix__) && defined(_WIN32)
59 # error Strange.
60 #endif
61
62 #if defined(__GNUC__) && defined(_MSC_VER)
63 # error Crazy.
64 #endif
65
66
67 /**********************************************************************
68  * Compiler and processor dependencies.
69  */
70
71 #if defined(__GNUC__)
72
73 # include <ci/compat/gcc.h>
74
75 # if defined(__i386__)
76 #  include <ci/compat/x86.h>
77 #  include <ci/compat/gcc_x86.h>
78 # elif defined(__x86_64__)
79 #  include <ci/compat/x86_64.h>
80 #  include <ci/compat/gcc_x86.h>
81 # elif defined(__PPC__)
82 #  include <ci/compat/ppc.h>
83 #  include <ci/compat/gcc_ppc.h>
84 # elif defined(__ia64__)
85 #  include <ci/compat/ia64.h>
86 #  include <ci/compat/gcc_ia64.h>
87 # else
88 #  error Unknown processor - GNU C
89 # endif
90
91 #elif defined(_MSC_VER)
92
93 # include <ci/compat/msvc.h>
94
95 # if defined(__i386__)
96 #  include <ci/compat/x86.h>
97 #  include <ci/compat/msvc_x86.h>
98 # elif defined(__x86_64__)
99 #  include <ci/compat/x86_64.h>
100 #  include <ci/compat/msvc_x86_64.h>
101 # else
102 #  error Unknown processor MSC
103 # endif
104
105 #elif defined(__PGI)
106
107 # include <ci/compat/x86.h>
108 # include <ci/compat/pg_x86.h>
109
110 #elif defined(__INTEL_COMPILER)
111
112 /* Intel compilers v7 claim to be very gcc compatible. */
113 # if __INTEL_COMPILER >= 700
114 #  include <ci/compat/gcc.h>
115 #  include <ci/compat/x86.h>
116 #  include <ci/compat/gcc_x86.h>
117 # else
118 #  error Old Intel compiler not supported.  Yet.
119 # endif
120
121 #else
122 # error Unknown compiler.
123 #endif
124
125
126 /**********************************************************************
127  * Misc stuff (that probably shouldn't be here).
128  */
129
130 #ifdef __sun
131 # ifdef __KERNEL__
132 #  define _KERNEL
133 #  define _SYSCALL32
134 #  ifdef _LP64
135 #   define _SYSCALL32_IMPL
136 #  endif
137 # else
138 #  define _REENTRANT
139 # endif
140 #endif
141
142
143 /**********************************************************************
144  * Defaults for anything left undefined.
145  */
146
147 #ifndef  CI_LIKELY
148 # define CI_LIKELY(t)    (t)
149 # define CI_UNLIKELY(t)  (t)
150 #endif
151
152 #ifndef  ci_restrict
153 # define ci_restrict
154 #endif
155
156 #ifndef  ci_inline
157 # define ci_inline  static inline
158 #endif
159
160 #ifndef  ci_noinline
161 # define ci_noinline  static
162 #endif
163
164 #endif  /* __CI_COMPAT_SYSDEP_H__ */
165
166 /*! \cidoxg_end */