- supported.conf: Added sparse_keymap (eeepc_laptop depends on it)
[linux-flexiantxendom0-3.2.10.git] / drivers / net / sfc / sfc_resource / ci / efhw / hardware_sysdep.h
1 /****************************************************************************
2  * Driver for Solarflare network controllers -
3  *          resource management for Xen backend, OpenOnload, etc
4  *           (including support for SFE4001 10GBT NIC)
5  *
6  * This file provides version-independent Linux kernel API for header files
7  * with hardware-related definitions (in ci/driver/efab/hardware*).
8  * Only kernels >=2.6.9 are supported.
9  *
10  * Copyright 2005-2007: Solarflare Communications Inc,
11  *                      9501 Jeronimo Road, Suite 250,
12  *                      Irvine, CA 92618, USA
13  *
14  * Developed and maintained by Solarflare Communications:
15  *                      <linux-xen-drivers@solarflare.com>
16  *                      <onload-dev@solarflare.com>
17  *
18  * Certain parts of the driver were implemented by
19  *          Alexandra Kossovsky <Alexandra.Kossovsky@oktetlabs.ru>
20  *          OKTET Labs Ltd, Russia,
21  *          http://oktetlabs.ru, <info@oktetlabs.ru>
22  *          by request of Solarflare Communications
23  *
24  *
25  * This program is free software; you can redistribute it and/or modify it
26  * under the terms of the GNU General Public License version 2 as published
27  * by the Free Software Foundation, incorporated herein by reference.
28  *
29  * This program is distributed in the hope that it will be useful,
30  * but WITHOUT ANY WARRANTY; without even the implied warranty of
31  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32  * GNU General Public License for more details.
33  *
34  * You should have received a copy of the GNU General Public License
35  * along with this program; if not, write to the Free Software
36  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
37  ****************************************************************************
38  */
39
40 #ifndef __CI_EFHW_HARDWARE_LINUX_H__
41 #define __CI_EFHW_HARDWARE_LINUX_H__
42
43 #include <linux/io.h>
44
45 #if defined(__LITTLE_ENDIAN)
46 #define EFHW_IS_LITTLE_ENDIAN
47 #elif defined(__BIG_ENDIAN)
48 #define EFHW_IS_BIG_ENDIAN
49 #else
50 #error Unknown endianness
51 #endif
52
53 #ifndef readq
54 static inline uint64_t __readq(volatile void __iomem *addr)
55 {
56         return *(volatile uint64_t *)addr;
57 }
58 #define readq(x) __readq(x)
59 #endif
60
61 #ifndef writeq
62 static inline void __writeq(uint64_t v, volatile void __iomem *addr)
63 {
64         *(volatile uint64_t *)addr = v;
65 }
66 #define writeq(val, addr) __writeq((val), (addr))
67 #endif
68
69 #endif /* __CI_EFHW_HARDWARE_LINUX_H__ */