Blame sysdeps/unix/sysv/linux/ia64/sys/io.h

Packit 6c4009
/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
     Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef	_SYS_IO_H
Packit 6c4009
#define	_SYS_IO_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* If TURN_ON is TRUE, request for permission to do direct i/o on the
Packit 6c4009
   port numbers in the range [FROM,FROM+NUM-1].  Otherwise, turn I/O
Packit 6c4009
   permission off for that range.  This call requires root privileges.
Packit 6c4009
Packit 6c4009
   Portability note: not all Linux platforms support this call.  Most
Packit 6c4009
   platforms based on the PC I/O architecture probably will, however.
Packit 6c4009
   E.g., Linux/Alpha for Alpha PCs supports this.  */
Packit 6c4009
extern int ioperm (unsigned long int __from, unsigned long int __num,
Packit 6c4009
		   int __turn_on);
Packit 6c4009
Packit 6c4009
/* Set the I/O privilege level to LEVEL.  If LEVEL>3, permission to
Packit 6c4009
   access any I/O port is granted.  This call requires root
Packit 6c4009
   privileges. */
Packit 6c4009
extern int iopl (int __level);
Packit 6c4009
Packit 6c4009
extern unsigned int _inb (unsigned long int __port);
Packit 6c4009
extern unsigned int _inb (unsigned long int __port);
Packit 6c4009
extern unsigned int _inw (unsigned long int __port);
Packit 6c4009
extern unsigned int _inl (unsigned long int __port);
Packit 6c4009
extern void _outb (unsigned char __val, unsigned long int __port);
Packit 6c4009
extern void _outw (unsigned short __val, unsigned long int __port);
Packit 6c4009
extern void _outl (unsigned int __val, unsigned long int __port);
Packit 6c4009
Packit 6c4009
#define inb	_inb
Packit 6c4009
#define inw	_inw
Packit 6c4009
#define inl	_inl
Packit 6c4009
#define outb	_outb
Packit 6c4009
#define outw	_outw
Packit 6c4009
#define outl	_outl
Packit 6c4009
Packit 6c4009
/* Access PCI space protected from machine checks.  */
Packit 6c4009
extern int pciconfig_read (unsigned long int __bus, unsigned long int __dfn,
Packit 6c4009
			   unsigned long int __off, unsigned long int __len,
Packit 6c4009
			   unsigned char *__buf);
Packit 6c4009
Packit 6c4009
extern int pciconfig_write (unsigned long int __bus, unsigned long int __dfn,
Packit 6c4009
			    unsigned long int __off, unsigned long int __len,
Packit 6c4009
			    unsigned char *__buf);
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* _SYS_IO_H */