Update to 3.4-final.
[linux-flexiantxendom0-3.2.10.git] / drivers / xen / sfc_netback / ci / tools / 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_tools */
27
28 #ifndef __CI_TOOLS_SYSDEP_H__
29 #define __CI_TOOLS_SYSDEP_H__
30
31 /* Make this header self-sufficient */
32 #include <ci/compat.h>
33 #include <ci/tools/log.h>
34 #include <ci/tools/debug.h>
35
36
37 /**********************************************************************
38  * Platform dependencies.
39  */
40
41 #if defined(__KERNEL__)
42
43 # if defined(__linux__)
44 #  include <ci/tools/platform/linux_kernel.h>
45 # elif defined(_WIN32)
46 #  include <ci/tools/platform/win32_kernel.h>
47 # elif defined(__sun__)
48 #  include <ci/tools/platform/sunos_kernel.h>
49 # else
50 #  error Unknown platform.
51 # endif
52
53 #elif defined(_WIN32)
54
55 # include <ci/tools/platform/win32.h>
56
57 #elif defined(__unix__)
58
59 # include <ci/tools/platform/unix.h>
60
61 #else
62
63 # error Unknown platform.
64
65 #endif
66
67 #if defined(__linux__)
68 /*! Linux sendfile() support enable/disable. */
69 # define CI_HAVE_SENDFILE            /* provide sendfile i/f */
70
71 # define CI_HAVE_OS_NOPAGE
72 #endif
73
74 #if defined(__sun__)
75 # define CI_HAVE_SENDFILE            /* provide sendfile i/f */
76 # define CI_HAVE_SENDFILEV           /* provide sendfilev i/f */
77
78 # define CI_IOCTL_SENDFILE           /*  use efrm CI_SENDFILEV ioctl */
79 #endif
80
81 #if defined(_WIN32)
82 typedef ci_uint32 ci_uerr_t; /* range of OS user-mode return codes */
83 typedef ci_uint32 ci_kerr_t; /* range of OS kernel-mode return codes */
84 #elif defined(__unix__)
85 typedef ci_int32 ci_uerr_t; /* range of OS user-mode return codes */
86 typedef ci_int32 ci_kerr_t; /* range of OS kernel-mode return codes */
87 #endif
88
89
90 /**********************************************************************
91  * Compiler and processor dependencies.
92  */
93
94 #if defined(__GNUC__)
95
96 #if defined(__i386__) || defined(__x86_64__)
97 # include <ci/tools/platform/gcc_x86.h>
98 #elif defined(__PPC__)
99 #  include <ci/tools/platform/gcc_ppc.h>
100 #elif defined(__ia64__)
101 #  include <ci/tools/platform/gcc_ia64.h>
102 #else
103 # error Unknown processor.
104 #endif
105
106 #elif defined(_MSC_VER)
107
108 #if defined(__i386__)
109 # include <ci/tools/platform/msvc_x86.h>
110 # elif defined(__x86_64__)
111 # include <ci/tools/platform/msvc_x86_64.h>
112 #else
113 # error Unknown processor.
114 #endif
115
116 #elif defined(__PGI)
117
118 # include <ci/tools/platform/pg_x86.h>
119
120 #elif defined(__INTEL_COMPILER)
121
122 /* Intel compilers v7 claim to be very gcc compatible. */
123 # include <ci/tools/platform/gcc_x86.h>
124
125 #else
126 # error Unknown compiler.
127 #endif
128
129
130 #endif  /* __CI_TOOLS_SYSDEP_H__ */
131
132 /*! \cidoxg_end */