65 #if defined(linux) && (defined(__alpha__) || defined(__ia64__))
76 static __inline__
unsigned int inb(
unsigned long int p) {
return _inb(p); };
77 static __inline__
unsigned int inw(
unsigned long int p) {
return _inw(p); };
78 static __inline__
unsigned int inl(
unsigned long int p) {
return _inl(p); };
79 static __inline__
void outb(
unsigned long int p,
unsigned char v) { _outb(v,p); };
80 static __inline__
void outw(
unsigned long int p,
unsigned short v) { _outw(v,p); };
81 static __inline__
void outl(
unsigned long int p,
unsigned int v) { _outl(v,p); };
85 #if defined(__sparc__)
90 static __inline__
void
95 __asm__ __volatile__(
"stba %0, [%1] %2" : :
"r" (val),
"r" (port),
"i" (ASI_PL));
98 static __inline__
void
103 __asm__ __volatile__(
"stha %0, [%1] %2" : :
"r" (val),
"r" (port),
"i" (ASI_PL));
106 static __inline__
void
111 __asm__ __volatile__(
"sta %0, [%1] %2" : :
"r" (val),
"r" (port),
"i" (ASI_PL));
114 static __inline__
unsigned int
119 __asm__ __volatile__(
"lduba [%1] %2, %0" :
"=r" (ret) :
"r" (port),
"i" (ASI_PL));
123 static __inline__
unsigned int
128 __asm__ __volatile__(
"lduha [%1] %2, %0" :
"=r" (ret) :
"r" (port),
"i" (ASI_PL));
132 static __inline__
unsigned int
137 __asm__ __volatile__(
"lda [%1] %2, %0" :
"=r" (ret) :
"r" (port),
"i" (ASI_PL));
142 unsigned int IOPortBase;
144 static __inline__
void
149 if ((
unsigned short)port >= 0x400)
return;
151 *(
volatile unsigned char*)(((
unsigned short)(port))+IOPortBase) = val;
154 static __inline__
void
159 if ((
unsigned short)port >= 0x400)
return;
161 *(
volatile unsigned short*)(((
unsigned short)(port))+IOPortBase) = val;
164 static __inline__
void
169 if ((
unsigned short)port >= 0x400)
return;
171 *(
volatile unsigned long*)(((
unsigned short)(port))+IOPortBase) = val;
174 static __inline__
unsigned int
178 if ((
unsigned short)port >= 0x400)
return((
unsigned int)-1);
180 return(*(
volatile unsigned char*)(((
unsigned short)(port))+IOPortBase));
183 static __inline__
unsigned int
187 if ((
unsigned short)port >= 0x400)
return((
unsigned int)-1);
189 return(*(
volatile unsigned short*)(((
unsigned short)(port))+IOPortBase));
192 static __inline__
unsigned int
196 if ((
unsigned short)port >= 0x400)
return((
unsigned int)-1);
198 return(*(
volatile unsigned long*)(((
unsigned short)(port))+IOPortBase));
201 #if defined(Lynx) && defined(__powerpc__)
202 extern unsigned char *ioBase;
207 __asm__ __volatile__ (
"eieio");
215 *(uchar *)(ioBase + port) = value; eieio();
221 unsigned short value;
223 *(
unsigned short *)(ioBase + port) = value; eieio();
231 *(
unsigned long *)(ioBase + port) = value; eieio();
240 val = *((
unsigned char *)(ioBase + port)); eieio();
244 static unsigned short
250 val = *((
unsigned short *)(ioBase + port)); eieio();
260 val = *((
unsigned long *)(ioBase + port)); eieio();
265 #if defined(__FreeBSD__) && defined(__alpha__)
267 #include <sys/types.h>
269 extern void outb(u_int32_t port, u_int8_t val);
270 extern void outw(u_int32_t port, u_int16_t val);
271 extern void outl(u_int32_t port, u_int32_t val);
272 extern u_int8_t inb(u_int32_t port);
273 extern u_int16_t inw(u_int32_t port);
274 extern u_int32_t inl(u_int32_t port);
278 static __inline__
void
283 __asm__ __volatile__(
"outb %0,%1" : :
"a" (val),
"d" (port));
286 static __inline__
void
291 __asm__ __volatile__(
"outw %0,%1" : :
"a" (val),
"d" (port));
294 static __inline__
void
299 __asm__ __volatile__(
"outl %0,%1" : :
"a" (val),
"d" (port));
302 static __inline__
unsigned int
307 __asm__ __volatile__(
"inb %1,%0" :
313 static __inline__
unsigned int
318 __asm__ __volatile__(
"inw %1,%0" :
324 static __inline__
unsigned int
329 __asm__ __volatile__(
"inl %1,%0" :
337 static __inline__
void
342 __asm__ __volatile__(
"out%B0 (%1)" : :
"a" (val),
"d" (port));
345 static __inline__
void
350 __asm__ __volatile__(
"out%W0 (%1)" : :
"a" (val),
"d" (port));
353 static __inline__
void
358 __asm__ __volatile__(
"out%L0 (%1)" : :
"a" (val),
"d" (port));
361 static __inline__
unsigned int
366 __asm__ __volatile__(
"in%B0 (%1)" :
372 static __inline__
unsigned int
377 __asm__ __volatile__(
"in%W0 (%1)" :
383 static __inline__
unsigned int
388 __asm__ __volatile__(
"in%L0 (%1)" :
401 #if defined(linux) || defined(__arm32__) || (defined(Lynx) && defined(__powerpc__))
403 #define intr_disable()
404 #define intr_enable()
408 static __inline__
void
411 __asm__ __volatile__(
"cli");
414 static __inline__
void
417 __asm__ __volatile__(
"sti");
424 #if defined(_MINIX) && defined(_ACK)
430 void outb(U16_t, U8_t);
432 void outw(U16_t, U16_t);
434 void outl(U16_t, U32_t);
438 # if defined(__STDC__) && (__STDC__ == 1)
444 # include <sys/types.h>
450 # include <sys/inline.h>
452 # include "../common/scoasm.h"
454 #define intr_disable() asm("cli")
455 #define intr_enable() asm("sti")