/ src / rtapi / rtapi_io.h
rtapi_io.h
 1  //    Copyright 2014 Jeff Epler
 2  //
 3  //    This program is free software; you can redistribute it and/or modify
 4  //    it under the terms of the GNU General Public License as published by
 5  //    the Free Software Foundation; either version 2 of the License, or
 6  //    (at your option) any later version.
 7  //
 8  //    This program is distributed in the hope that it will be useful,
 9  //    but WITHOUT ANY WARRANTY; without even the implied warranty of
10  //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  //    GNU General Public License for more details.
12  //
13  //    You should have received a copy of the GNU General Public License
14  //    along with this program; if not, write to the Free Software
15  //    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  #ifndef RTAPI_IO_H
17  #define RTAPI_IO_H
18  
19  #include <rtapi.h>
20  
21  #ifdef __KERNEL__
22  #include <asm/io.h>
23  #elif defined(__i386) || defined(__x86_64)
24  #include <sys/io.h>
25  #endif
26  
27  #if defined(__i386) || defined(__x86_64)
28  #define rtapi_inb inb
29  #define rtapi_inw inw
30  #define rtapi_inl inl
31  
32  #define rtapi_outb outb
33  #define rtapi_outw outw
34  #define rtapi_outl outl
35  #else
36  #define rtapi_inb(x) (0)
37  #define rtapi_inw(x) (0)
38  #define rtapi_inl(x) (0)
39  #define rtapi_outb(x,y) ((void)0)
40  #define rtapi_outw(x,y) ((void)0)
41  #define rtapi_outl(x,y) ((void)0)
42  #endif
43  
44  #endif