Home | History | Annotate | Line # | Download | only in include
pio.h revision 1.3
      1 /*	$NetBSD: pio.h,v 1.3 1994/10/26 08:46:38 cgd Exp $	*/
      2 
      3 /*
      4  * Mach Operating System
      5  * Copyright (c) 1990 Carnegie-Mellon University
      6  * All rights reserved.  The CMU software License Agreement specifies
      7  * the terms and conditions for use and redistribution.
      8  */
      9 
     10 #define inl(y) \
     11 ({ unsigned long _tmp__; \
     12 	asm volatile("inl %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
     13 	_tmp__; })
     14 
     15 #define inw(y) \
     16 ({ unsigned short _tmp__; \
     17 	asm volatile(".byte 0x66; inl %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
     18 	_tmp__; })
     19 
     20 #define inb(y) \
     21 ({ unsigned char _tmp__; \
     22 	asm volatile("inb %1, %0" : "=a" (_tmp__) : "d" ((unsigned short)(y))); \
     23 	_tmp__; })
     24 
     25 
     26 #define outl(x, y) \
     27 { asm volatile("outl %0, %1" : : "a" (y) , "d" ((unsigned short)(x))); }
     28 
     29 
     30 #define outw(x, y) \
     31 {asm volatile(".byte 0x66; outl %0, %1" : : "a" ((unsigned short)(y)) , "d" ((unsigned short)(x))); }
     32 
     33 
     34 #define outb(x, y) \
     35 { asm volatile("outb %0, %1" : : "a" ((unsigned char)(y)) , "d" ((unsigned short)(x))); }
     36