ia64/linux-2.6.18-xen.hg

annotate drivers/char/rio/rio_linux.h @ 893:f994bfe9b93b

linux/blktap2: reduce TLB flush scope

c/s 885 added very coarse TLB flushing. Since these flushes always
follow single page updates, single page flushes (when available) are
sufficient.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 04 10:32:57 2009 +0100 (2009-06-04)
parents 831230e53067
children
rev   line source
ian@0 1
ian@0 2 /*
ian@0 3 * rio_linux.h
ian@0 4 *
ian@0 5 * Copyright (C) 1998,1999,2000 R.E.Wolff@BitWizard.nl
ian@0 6 *
ian@0 7 * This program is free software; you can redistribute it and/or modify
ian@0 8 * it under the terms of the GNU General Public License as published by
ian@0 9 * the Free Software Foundation; either version 2 of the License, or
ian@0 10 * (at your option) any later version.
ian@0 11 *
ian@0 12 * This program is distributed in the hope that it will be useful,
ian@0 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ian@0 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ian@0 15 * GNU General Public License for more details.
ian@0 16 *
ian@0 17 * You should have received a copy of the GNU General Public License
ian@0 18 * along with this program; if not, write to the Free Software
ian@0 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
ian@0 20 *
ian@0 21 * RIO serial driver.
ian@0 22 *
ian@0 23 * Version 1.0 -- July, 1999.
ian@0 24 *
ian@0 25 */
ian@0 26
ian@0 27 #define RIO_NBOARDS 4
ian@0 28 #define RIO_PORTSPERBOARD 128
ian@0 29 #define RIO_NPORTS (RIO_NBOARDS * RIO_PORTSPERBOARD)
ian@0 30
ian@0 31 #define MODEM_SUPPORT
ian@0 32
ian@0 33 #ifdef __KERNEL__
ian@0 34
ian@0 35 #define RIO_MAGIC 0x12345678
ian@0 36
ian@0 37
ian@0 38 struct vpd_prom {
ian@0 39 unsigned short id;
ian@0 40 char hwrev;
ian@0 41 char hwass;
ian@0 42 int uniqid;
ian@0 43 char myear;
ian@0 44 char mweek;
ian@0 45 char hw_feature[5];
ian@0 46 char oem_id;
ian@0 47 char identifier[16];
ian@0 48 };
ian@0 49
ian@0 50
ian@0 51 #define RIO_DEBUG_ALL 0xffffffff
ian@0 52
ian@0 53 #define O_OTHER(tty) \
ian@0 54 ((O_OLCUC(tty)) ||\
ian@0 55 (O_ONLCR(tty)) ||\
ian@0 56 (O_OCRNL(tty)) ||\
ian@0 57 (O_ONOCR(tty)) ||\
ian@0 58 (O_ONLRET(tty)) ||\
ian@0 59 (O_OFILL(tty)) ||\
ian@0 60 (O_OFDEL(tty)) ||\
ian@0 61 (O_NLDLY(tty)) ||\
ian@0 62 (O_CRDLY(tty)) ||\
ian@0 63 (O_TABDLY(tty)) ||\
ian@0 64 (O_BSDLY(tty)) ||\
ian@0 65 (O_VTDLY(tty)) ||\
ian@0 66 (O_FFDLY(tty)))
ian@0 67
ian@0 68 /* Same for input. */
ian@0 69 #define I_OTHER(tty) \
ian@0 70 ((I_INLCR(tty)) ||\
ian@0 71 (I_IGNCR(tty)) ||\
ian@0 72 (I_ICRNL(tty)) ||\
ian@0 73 (I_IUCLC(tty)) ||\
ian@0 74 (L_ISIG(tty)))
ian@0 75
ian@0 76
ian@0 77 #endif /* __KERNEL__ */
ian@0 78
ian@0 79
ian@0 80 #define RIO_BOARD_INTR_LOCK 1
ian@0 81
ian@0 82
ian@0 83 #ifndef RIOCTL_MISC_MINOR
ian@0 84 /* Allow others to gather this into "major.h" or something like that */
ian@0 85 #define RIOCTL_MISC_MINOR 169
ian@0 86 #endif
ian@0 87
ian@0 88
ian@0 89 /* Allow us to debug "in the field" without requiring clients to
ian@0 90 recompile.... */
ian@0 91 #if 1
ian@0 92 #define rio_spin_lock_irqsave(sem, flags) do { \
ian@0 93 rio_dprintk (RIO_DEBUG_SPINLOCK, "spinlockirqsave: %p %s:%d\n", \
ian@0 94 sem, __FILE__, __LINE__);\
ian@0 95 spin_lock_irqsave(sem, flags);\
ian@0 96 } while (0)
ian@0 97
ian@0 98 #define rio_spin_unlock_irqrestore(sem, flags) do { \
ian@0 99 rio_dprintk (RIO_DEBUG_SPINLOCK, "spinunlockirqrestore: %p %s:%d\n",\
ian@0 100 sem, __FILE__, __LINE__);\
ian@0 101 spin_unlock_irqrestore(sem, flags);\
ian@0 102 } while (0)
ian@0 103
ian@0 104 #define rio_spin_lock(sem) do { \
ian@0 105 rio_dprintk (RIO_DEBUG_SPINLOCK, "spinlock: %p %s:%d\n",\
ian@0 106 sem, __FILE__, __LINE__);\
ian@0 107 spin_lock(sem);\
ian@0 108 } while (0)
ian@0 109
ian@0 110 #define rio_spin_unlock(sem) do { \
ian@0 111 rio_dprintk (RIO_DEBUG_SPINLOCK, "spinunlock: %p %s:%d\n",\
ian@0 112 sem, __FILE__, __LINE__);\
ian@0 113 spin_unlock(sem);\
ian@0 114 } while (0)
ian@0 115 #else
ian@0 116 #define rio_spin_lock_irqsave(sem, flags) \
ian@0 117 spin_lock_irqsave(sem, flags)
ian@0 118
ian@0 119 #define rio_spin_unlock_irqrestore(sem, flags) \
ian@0 120 spin_unlock_irqrestore(sem, flags)
ian@0 121
ian@0 122 #define rio_spin_lock(sem) \
ian@0 123 spin_lock(sem)
ian@0 124
ian@0 125 #define rio_spin_unlock(sem) \
ian@0 126 spin_unlock(sem)
ian@0 127
ian@0 128 #endif
ian@0 129
ian@0 130
ian@0 131
ian@0 132 #ifdef CONFIG_RIO_OLDPCI
ian@0 133 static inline void __iomem *rio_memcpy_toio(void __iomem *dummy, void __iomem *dest, void *source, int n)
ian@0 134 {
ian@0 135 char __iomem *dst = dest;
ian@0 136 char *src = source;
ian@0 137
ian@0 138 while (n--) {
ian@0 139 writeb(*src++, dst++);
ian@0 140 (void) readb(dummy);
ian@0 141 }
ian@0 142
ian@0 143 return dest;
ian@0 144 }
ian@0 145
ian@0 146 static inline void __iomem *rio_copy_toio(void __iomem *dest, void *source, int n)
ian@0 147 {
ian@0 148 char __iomem *dst = dest;
ian@0 149 char *src = source;
ian@0 150
ian@0 151 while (n--)
ian@0 152 writeb(*src++, dst++);
ian@0 153
ian@0 154 return dest;
ian@0 155 }
ian@0 156
ian@0 157
ian@0 158 static inline void *rio_memcpy_fromio(void *dest, void __iomem *source, int n)
ian@0 159 {
ian@0 160 char *dst = dest;
ian@0 161 char __iomem *src = source;
ian@0 162
ian@0 163 while (n--)
ian@0 164 *dst++ = readb(src++);
ian@0 165
ian@0 166 return dest;
ian@0 167 }
ian@0 168
ian@0 169 #else
ian@0 170 #define rio_memcpy_toio(dummy,dest,source,n) memcpy_toio(dest, source, n)
ian@0 171 #define rio_copy_toio memcpy_toio
ian@0 172 #define rio_memcpy_fromio memcpy_fromio
ian@0 173 #endif
ian@0 174
ian@0 175 #define DEBUG 1
ian@0 176
ian@0 177
ian@0 178 /*
ian@0 179 This driver can spew a whole lot of debugging output at you. If you
ian@0 180 need maximum performance, you should disable the DEBUG define. To
ian@0 181 aid in debugging in the field, I'm leaving the compile-time debug
ian@0 182 features enabled, and disable them "runtime". That allows me to
ian@0 183 instruct people with problems to enable debugging without requiring
ian@0 184 them to recompile...
ian@0 185 */
ian@0 186
ian@0 187 #ifdef DEBUG
ian@0 188 #define rio_dprintk(f, str...) do { if (rio_debug & f) printk (str);} while (0)
ian@0 189 #define func_enter() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter %s\n", __FUNCTION__)
ian@0 190 #define func_exit() rio_dprintk (RIO_DEBUG_FLOW, "rio: exit %s\n", __FUNCTION__)
ian@0 191 #define func_enter2() rio_dprintk (RIO_DEBUG_FLOW, "rio: enter %s (port %d)\n",__FUNCTION__, port->line)
ian@0 192 #else
ian@0 193 #define rio_dprintk(f, str...) /* nothing */
ian@0 194 #define func_enter()
ian@0 195 #define func_exit()
ian@0 196 #define func_enter2()
ian@0 197 #endif