The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/i386/pio.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* 
    2  * Mach Operating System
    3  * Copyright (c) 1991,1990 Carnegie Mellon University
    4  * All Rights Reserved.
    5  * 
    6  * Permission to use, copy, modify and distribute this software and its
    7  * documentation is hereby granted, provided that both the copyright
    8  * notice and this permission notice appear in all copies of the
    9  * software, derivative works or modified versions, and any portions
   10  * thereof, and that both notices appear in supporting documentation.
   11  * 
   12  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   13  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
   14  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   15  * 
   16  * Carnegie Mellon requests users of this software to return to
   17  * 
   18  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   19  *  School of Computer Science
   20  *  Carnegie Mellon University
   21  *  Pittsburgh PA 15213-3890
   22  * 
   23  * any improvements or extensions that they make and grant Carnegie Mellon
   24  * the rights to redistribute these changes.
   25  */
   26 /* 
   27  * HISTORY
   28  * $Log:        pio.h,v $
   29  * Revision 2.6  93/01/14  17:29:31  danner
   30  *      altered malformed error message
   31  *      [92/12/18            danner]
   32  *      Took the warning inside ifndef __GNUC__ outside of comments. This
   33  *      will make the compiler find the error instead of having to find
   34  *      out about it manually.
   35  *      Protected against multiple inclusions.
   36  *      [92/11/30            jvh]
   37  * 
   38  * Revision 2.5  91/05/14  16:14:20  mrt
   39  *      Correcting copyright
   40  * 
   41  * Revision 2.4  91/02/05  17:13:56  mrt
   42  *      Changed to new Mach copyright
   43  *      [91/02/01  17:37:08  mrt]
   44  * 
   45  * Revision 2.3  90/12/20  16:36:37  jeffreyh
   46  *      changes for __STDC__
   47  *      [90/12/07            jeffreyh]
   48  * 
   49  * Revision 2.2  90/11/26  14:48:41  rvb
   50  *      Pulled from 2.5
   51  *      [90/11/22  10:09:38  rvb]
   52  * 
   53  *      [90/08/14            mg32]
   54  * 
   55  *      Now we know how types are factor in.
   56  *      Cleaned up a bunch: eliminated ({ for output and flushed unused
   57  *      output variables.
   58  *      [90/08/14            rvb]
   59  * 
   60  *      This is how its done in gcc:
   61  *              Created.
   62  *      [90/03/26            rvb]
   63  * 
   64  */
   65 
   66 #ifndef _I386_PIO_H_
   67 #define _I386_PIO_H_
   68 
   69 #ifndef __GNUC__
   70 #error  You do not stand a chance.  This file is gcc only.
   71 #endif  __GNUC__
   72 
   73 #define inl(y) \
   74 ({ unsigned long _tmp__; \
   75         asm volatile("inl %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
   76         _tmp__; })
   77 
   78 #define inw(y) \
   79 ({ unsigned short _tmp__; \
   80         asm volatile(".byte 0x66; inl %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
   81         _tmp__; })
   82 
   83 #define inb(y) \
   84 ({ unsigned char _tmp__; \
   85         asm volatile("inb %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
   86         _tmp__; })
   87 
   88 
   89 #define outl(x, y) \
   90 { asm volatile("outl %0, %1" : : "a" (y) , "d" ((unsigned short)(x))); }
   91 
   92 
   93 #define outw(x, y) \
   94 {asm volatile(".byte 0x66; outl %0, %1" : : "a" ((unsigned short)(y)) , "d" ((unsigned short)(x))); }
   95 
   96 
   97 #define outb(x, y) \
   98 { asm volatile("outb %0, %1" : : "a" ((unsigned char)(y)) , "d" ((unsigned short)(x))); }
   99 
  100 #endif /* _I386_PIO_H_ */

Cache object: 244d6d52680755ef88ef90569424c173


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.