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
7 * Maintained by Solarflare Communications
8 * <linux-xen-drivers@solarflare.com>
9 * <onload-dev@solarflare.com>
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.
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.
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 ****************************************************************************
26 /*! \cidoxg_include_ci_tools */
28 #ifndef __CI_TOOLS_SYSDEP_H__
29 #define __CI_TOOLS_SYSDEP_H__
31 /* Make this header self-sufficient */
32 #include <ci/compat.h>
33 #include <ci/tools/log.h>
34 #include <ci/tools/debug.h>
37 /**********************************************************************
38 * Platform dependencies.
41 #if defined(__KERNEL__)
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>
50 # error Unknown platform.
55 # include <ci/tools/platform/win32.h>
57 #elif defined(__unix__)
59 # include <ci/tools/platform/unix.h>
63 # error Unknown platform.
67 #if defined(__linux__)
68 /*! Linux sendfile() support enable/disable. */
69 # define CI_HAVE_SENDFILE /* provide sendfile i/f */
71 # define CI_HAVE_OS_NOPAGE
75 # define CI_HAVE_SENDFILE /* provide sendfile i/f */
76 # define CI_HAVE_SENDFILEV /* provide sendfilev i/f */
78 # define CI_IOCTL_SENDFILE /* use efrm CI_SENDFILEV ioctl */
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 */
90 /**********************************************************************
91 * Compiler and processor dependencies.
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>
103 # error Unknown processor.
106 #elif defined(_MSC_VER)
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>
113 # error Unknown processor.
118 # include <ci/tools/platform/pg_x86.h>
120 #elif defined(__INTEL_COMPILER)
122 /* Intel compilers v7 claim to be very gcc compatible. */
123 # include <ci/tools/platform/gcc_x86.h>
126 # error Unknown compiler.
130 #endif /* __CI_TOOLS_SYSDEP_H__ */