2015-01-19 14:22:52 +00:00
|
|
|
.\" Copyright (c) IBM Corp. 2015
|
|
|
|
.\" Author: Alexey Ishchuk <aishchuk@linux.vnet.ibm.com>
|
|
|
|
.\"
|
|
|
|
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
|
|
|
|
.\" This is free documentation; you can redistribute it and/or
|
|
|
|
.\" modify it under the terms of the GNU General Public License as
|
|
|
|
.\" published by the Free Software Foundation; either version 2 of
|
|
|
|
.\" the License, or (at your option) any later version.
|
|
|
|
.\"
|
|
|
|
.\" The GNU General Public License's references to "object code"
|
|
|
|
.\" and "executables" are to be interpreted as the output of any
|
|
|
|
.\" document formatting or typesetting system, including
|
|
|
|
.\" intermediate and printed output.
|
|
|
|
.\"
|
|
|
|
.\" This manual is distributed in the hope that it will be useful,
|
|
|
|
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
.\" GNU General Public License for more details.
|
|
|
|
.\"
|
|
|
|
.\" You should have received a copy of the GNU General Public
|
|
|
|
.\" License along with this manual; if not, see
|
|
|
|
.\" <http://www.gnu.org/licenses/>.
|
|
|
|
.\" %%%LICENSE_END
|
|
|
|
.\"
|
|
|
|
.TH S390_PCI_MMIO_WRITE 2 2015-01-15 "Linux Programmer's Manual"
|
|
|
|
.SH NAME
|
|
|
|
s390_pci_mmio_write, s390_pci_mmio_read \- transfer data to/from PCI
|
|
|
|
MMIO memory page
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <asm/unistd.h>
|
|
|
|
|
|
|
|
.BI "int s390_pci_mmio_write(unsigned long " mmio_addr ",
|
2015-01-19 15:09:04 +00:00
|
|
|
.BI " void *" user_buffer ", size_t " length ");
|
2015-01-19 14:22:52 +00:00
|
|
|
.br
|
|
|
|
.BI "int s390_pci_mmio_read(unsigned long " mmio_addr ",
|
2015-01-19 15:09:04 +00:00
|
|
|
.BI " void *" user_buffer ", size_t " length ");
|
2015-01-19 14:22:52 +00:00
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
|
|
|
The
|
|
|
|
.BR s390_pci_mmio_write ()
|
2015-01-19 15:09:04 +00:00
|
|
|
system call writes
|
2015-01-19 14:22:52 +00:00
|
|
|
.IR length
|
2015-01-19 15:09:04 +00:00
|
|
|
bytes of data from the user-space buffer
|
2015-01-19 14:22:52 +00:00
|
|
|
.IR user_buffer
|
2015-01-19 15:09:04 +00:00
|
|
|
to the PCI MMIO memory location specified by
|
|
|
|
.IR mmio_addr .
|
2015-01-19 14:22:52 +00:00
|
|
|
The
|
|
|
|
.BR s390_pci_mmio_read ()
|
2015-01-19 15:09:04 +00:00
|
|
|
system call reads
|
|
|
|
.I length
|
|
|
|
bytes of
|
|
|
|
data from the PCI MMIO memory location specified by
|
|
|
|
.IR mmio_addr
|
|
|
|
to the user-space buffer
|
|
|
|
.IR user_buffer .
|
2015-01-19 14:22:52 +00:00
|
|
|
|
|
|
|
These system calls must be used instead of the simple assignment
|
2015-01-19 15:09:04 +00:00
|
|
|
or data-transfer operations that are used to access the PCI MMIO
|
|
|
|
memory areas mapped to user space on the Linux System z platform.
|
|
|
|
The address specified by
|
2015-01-19 14:22:52 +00:00
|
|
|
.IR mmio_addr
|
2015-01-19 15:09:04 +00:00
|
|
|
must belong to a PCI MMIO memory page mapping in the caller's address space,
|
|
|
|
and the data being written or read must not cross a page boundary.
|
2015-01-19 15:02:03 +00:00
|
|
|
The
|
2015-01-19 14:22:52 +00:00
|
|
|
.IR length
|
2015-01-19 15:09:04 +00:00
|
|
|
value cannot be greater than the system page size.
|
2015-01-19 14:22:52 +00:00
|
|
|
.SH RETURN VALUE
|
|
|
|
On success,
|
|
|
|
.BR s390_pci_mmio_write ()
|
|
|
|
and
|
|
|
|
.BR s390_pci_mmio_read ()
|
|
|
|
return 0.
|
2015-01-22 22:36:33 +00:00
|
|
|
On error, \-1 is returned and
|
2015-01-19 14:22:52 +00:00
|
|
|
.IR errno
|
|
|
|
is set to one of the error codes listed below.
|
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
2015-01-19 15:09:04 +00:00
|
|
|
.B EFAULT
|
|
|
|
The address in
|
|
|
|
.I mmio_addr
|
|
|
|
is invalid.
|
|
|
|
.TP
|
|
|
|
.B EFAULT
|
|
|
|
.IR user_buffer
|
|
|
|
does not point to a valid location in the caller's address space.
|
|
|
|
.TP
|
|
|
|
.B EINVAL
|
|
|
|
Invalid
|
|
|
|
.I length
|
|
|
|
argument.
|
|
|
|
.TP
|
2015-01-19 14:22:52 +00:00
|
|
|
.B ENODEV
|
|
|
|
PCI support is not enabled.
|
|
|
|
.TP
|
|
|
|
.B ENOMEM
|
|
|
|
Insufficient memory.
|
|
|
|
.SH VERSIONS
|
|
|
|
These system calls are available since Linux 3.19.
|
|
|
|
.SH CONFORMING TO
|
2015-01-19 15:02:03 +00:00
|
|
|
This Linux-specific system call is available only on the s390 architecture.
|
|
|
|
The required PCI support is available beginning with System z EC12.
|
2015-01-19 14:22:52 +00:00
|
|
|
.SH NOTES
|
|
|
|
Glibc does not provide a wrapper for this system call, use
|
|
|
|
.BR syscall (2)
|
|
|
|
to call it.
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR syscall (2)
|