]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/i386/include/pio.h
This is the Linux generic soundcard driver, version 1.0c. Supports
[FreeBSD/FreeBSD.git] / sys / i386 / include / pio.h
1 /* 
2  * Mach Operating System
3  * Copyright (c) 1990 Carnegie-Mellon University
4  * All rights reserved.  The CMU software License Agreement specifies
5  * the terms and conditions for use and redistribution.
6  *
7  *      from: Mach, unknown, 386BSD patch kit
8  *      $Id$
9  */
10
11 #define inl(y) \
12 ({ unsigned long _tmp__; \
13         asm volatile("inl %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
14         _tmp__; })
15
16 #define inw(y) \
17 ({ unsigned short _tmp__; \
18         asm volatile(".byte 0x66; inl %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
19         _tmp__; })
20
21 /*
22  * only do this if it has not already be defined.. this is a crock for the
23  * patch kit for right now.  Need to clean up all the inx, outx stuff for
24  * 0.1.5 to use 1 common header file, that has Bruces fast mode inb/outb
25  * stuff in it.  Rgrimes 5/27/93
26  */
27 #ifndef inb
28 #define inb(y) \
29 ({ unsigned char _tmp__; \
30         asm volatile("inb %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
31         _tmp__; })
32 #endif
33
34
35 #define outl(x, y) \
36 { asm volatile("outl %0, %1" : : "a" (y) , "d" ((unsigned short)(x))); }
37
38
39 #define outw(x, y) \
40 {asm volatile(".byte 0x66; outl %0, %1" : : "a" ((unsigned short)(y)) , "d" ((unsigned short)(x))); }
41
42
43 #define outb(x, y) \
44 { asm volatile("outb %0, %1" : : "a" ((unsigned char)(y)) , "d" ((unsigned short)(x))); }