Update copyright notices with scripts/update-copyrights
[jlayton/glibc.git] / ports / sysdeps / unix / sysv / linux / ia64 / sys / io.h
1 /* Copyright (C) 1999-2014 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3      Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
4
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9
10    The GNU C Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, see
17    <http://www.gnu.org/licenses/>.  */
18
19 #ifndef _SYS_IO_H
20 #define _SYS_IO_H       1
21
22 #include <features.h>
23
24 __BEGIN_DECLS
25
26 /* If TURN_ON is TRUE, request for permission to do direct i/o on the
27    port numbers in the range [FROM,FROM+NUM-1].  Otherwise, turn I/O
28    permission off for that range.  This call requires root privileges.
29
30    Portability note: not all Linux platforms support this call.  Most
31    platforms based on the PC I/O architecture probably will, however.
32    E.g., Linux/Alpha for Alpha PCs supports this.  */
33 extern int ioperm (unsigned long int __from, unsigned long int __num,
34                    int __turn_on);
35
36 /* Set the I/O privilege level to LEVEL.  If LEVEL>3, permission to
37    access any I/O port is granted.  This call requires root
38    privileges. */
39 extern int iopl (int __level);
40
41 extern unsigned int _inb (unsigned long int __port);
42 extern unsigned int _inb (unsigned long int __port);
43 extern unsigned int _inw (unsigned long int __port);
44 extern unsigned int _inl (unsigned long int __port);
45 extern void _outb (unsigned char __val, unsigned long int __port);
46 extern void _outw (unsigned short __val, unsigned long int __port);
47 extern void _outl (unsigned int __val, unsigned long int __port);
48
49 #define inb     _inb
50 #define inw     _inw
51 #define inl     _inl
52 #define outb    _outb
53 #define outw    _outw
54 #define outl    _outl
55
56 /* Access PCI space protected from machine checks.  */
57 extern int pciconfig_read (unsigned long int __bus, unsigned long int __dfn,
58                            unsigned long int __off, unsigned long int __len,
59                            unsigned char *__buf);
60
61 extern int pciconfig_write (unsigned long int __bus, unsigned long int __dfn,
62                             unsigned long int __off, unsigned long int __len,
63                             unsigned char *__buf);
64
65 __END_DECLS
66
67 #endif /* _SYS_IO_H */