Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | /* * Copyright (c) 2000-2007 AppleInc. All rights reserved. */ /* * @OSF_COPYRIGHT@ */ /* * HISTORY * * Revision 1.2 1998/09/30 21:20:45 wsanchez * Merged in IntelMerge1 (mburg: Intel support) * * Revision 1.1.2.1 1998/09/30 18:18:50 mburg * Changes for Intel port * * Revision 1.1.1.1 1998/03/07 02:25:38 wsanchez * Import of OSF Mach kernel (~mburg) * * Revision 1.1.8.2 1996/07/31 09:46:36 paire * Merged with nmk20b7_shared (1.1.11.2 -> 1.1.11.1) * [96/06/10 paire] * * Revision 1.1.11.2 1996/06/13 12:38:25 bernadat * Do not use inline macros when MACH_ASSERT is configured. * [96/05/24 bernadat] * * Revision 1.1.11.1 1996/05/14 13:50:23 paire * Added new linl and loutl __inline__. * Added conditional compilation for [l]{in|oub}[bwl]() __inline__. * [95/11/24 paire] * * Revision 1.1.8.1 1994/09/23 02:00:28 ezf * change marker to not FREE * [1994/09/22 21:25:52 ezf] * * Revision 1.1.4.5 1993/08/09 19:40:41 dswartz * Add ANSI prototypes - CR#9523 * [1993/08/06 17:45:57 dswartz] * * Revision 1.1.4.4 1993/06/11 15:17:37 jeffc * CR9176 - ANSI C violations: inb/outb macros must be changed from * ({ ... }) to inline functions, with proper type definitions. Callers * must pass proper types to these functions: 386 I/O port addresses * are unsigned shorts (not pointers). * [1993/06/10 14:26:10 jeffc] * * Revision 1.1.4.3 1993/06/07 22:09:28 jeffc * CR9176 - ANSI C violations: trailing tokens on CPP * directives, extra semicolons after decl_ ..., asm keywords * [1993/06/07 19:00:26 jeffc] * * Revision 1.1.4.2 1993/06/04 15:28:45 jeffc * CR9176 - ANSI problems - * Added casts to get macros to take caddr_t as an I/O space address. * [1993/06/04 13:45:55 jeffc] * * Revision 1.1 1992/09/30 02:25:51 robert * Initial revision * * $EndLog$ */ /* CMU_HIST */ /* * Revision 2.5 91/05/14 16:14:20 mrt * Correcting copyright * * Revision 2.4 91/02/05 17:13:56 mrt * Changed to new Mach copyright * [91/02/01 17:37:08 mrt] * * Revision 2.3 90/12/20 16:36:37 jeffreyh * changes for __STDC__ * [90/12/07 jeffreyh] * * Revision 2.2 90/11/26 14:48:41 rvb * Pulled from 2.5 * [90/11/22 10:09:38 rvb] * * [90/08/14 mg32] * * Now we know how types are factor in. * Cleaned up a bunch: eliminated ({ for output and flushed unused * output variables. * [90/08/14 rvb] * * This is how its done in gcc: * Created. * [90/03/26 rvb] * */ /* CMU_ENDHIST */ /* * Mach Operating System * Copyright (c) 1991,1990 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ #ifndef ARM_PIO_H #define ARM_PIO_H typedef unsigned short i386_ioport_t; /* read a longword */ extern unsigned long inl( i386_ioport_t port); /* read a shortword */ extern unsigned short inw( i386_ioport_t port); /* read a byte */ extern unsigned char inb( i386_ioport_t port); /* write a longword */ extern void outl( i386_ioport_t port, unsigned long datum); /* write a word */ extern void outw( i386_ioport_t port, unsigned short datum); /* write a longword */ extern void outb( i386_ioport_t port, unsigned char datum); /* input an array of longwords */ extern void linl( i386_ioport_t port, int * data, int count); /* output an array of longwords */ extern void loutl( i386_ioport_t port, int * data, int count); /* input an array of words */ extern void linw( i386_ioport_t port, int * data, int count); /* output an array of words */ extern void loutw( i386_ioport_t port, int * data, int count); /* input an array of bytes */ extern void linb( i386_ioport_t port, char * data, int count); /* output an array of bytes */ extern void loutb( i386_ioport_t port, char * data, int count); extern __inline__ unsigned long inl( i386_ioport_t port) { unsigned long datum; __asm__ volatile("inl %1, %0" : "=a" (datum) : "d" (port)); return(datum); } extern __inline__ unsigned short inw( i386_ioport_t port) { unsigned short datum; __asm__ volatile(".byte 0x66; inl %1, %0" : "=a" (datum) : "d" (port)); return(datum); } extern __inline__ unsigned char inb( i386_ioport_t port) { unsigned char datum; __asm__ volatile("inb %1, %0" : "=a" (datum) : "d" (port)); return(datum); } extern __inline__ void outl( i386_ioport_t port, unsigned long datum) { __asm__ volatile("outl %0, %1" : : "a" (datum), "d" (port)); } extern __inline__ void outw( i386_ioport_t port, unsigned short datum) { __asm__ volatile(".byte 0x66; outl %0, %1" : : "a" (datum), "d" (port)); } extern __inline__ void outb( i386_ioport_t port, unsigned char datum) { __asm__ volatile("outb %0, %1" : : "a" (datum), "d" (port)); } #endif /* ARM_PIO_H */ |