sigaction.2: Minor tweaks to Peter's patch
[man-pages.git] / man2 / s390_pci_mmio_write.2
blob4e34889dba91646959ed4920bf81170b62a442e2
1 .\" Copyright (c) IBM Corp. 2015
2 .\" Author: Alexey Ishchuk <aishchuk@linux.vnet.ibm.com>
3 .\"
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\" %%%LICENSE_END
24 .\"
25 .TH S390_PCI_MMIO_WRITE 2 2021-03-22 "Linux Programmer's Manual"
26 .SH NAME
27 s390_pci_mmio_write, s390_pci_mmio_read \- transfer data to/from PCI
28 MMIO memory page
29 .SH SYNOPSIS
30 .nf
31 .BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"
32 .B #include <unistd.h>
33 .PP
34 .BI "int syscall(SYS_s390_pci_mmio_write, unsigned long " mmio_addr ,
35 .BI "                       const void *" user_buffer ", size_t " length );
36 .BI "int syscall(SYS_s390_pci_mmio_read, unsigned long " mmio_addr ,
37 .BI "                       void *" user_buffer ", size_t " length );
38 .fi
39 .PP
40 .IR Note :
41 glibc provides no wrappers for these system calls,
42 necessitating the use of
43 .BR syscall (2).
44 .SH DESCRIPTION
45 The
46 .BR s390_pci_mmio_write ()
47 system call writes
48 .IR length
49 bytes of data from the user-space buffer
50 .IR user_buffer
51 to the PCI MMIO memory location specified by
52 .IR mmio_addr .
53 The
54 .BR s390_pci_mmio_read ()
55 system call reads
56 .I length
57 bytes of
58 data from the PCI MMIO memory location specified by
59 .IR mmio_addr
60 to the user-space buffer
61 .IR user_buffer .
62 .PP
63 These system calls must be used instead of the simple assignment
64 or data-transfer operations that are used to access the PCI MMIO
65 memory areas mapped to user space on the Linux System z platform.
66 The address specified by
67 .IR mmio_addr
68 must belong to a PCI MMIO memory page mapping in the caller's address space,
69 and the data being written or read must not cross a page boundary.
70 The
71 .IR length
72 value cannot be greater than the system page size.
73 .SH RETURN VALUE
74 On success,
75 .BR s390_pci_mmio_write ()
76 and
77 .BR s390_pci_mmio_read ()
78 return 0.
79 On failure, \-1 is returned and
80 .IR errno
81 is set to indicate the error.
82 .SH ERRORS
83 .TP
84 .B EFAULT
85 The address in
86 .I mmio_addr
87 is invalid.
88 .TP
89 .B EFAULT
90 .IR user_buffer
91 does not point to a valid location in the caller's address space.
92 .TP
93 .B EINVAL
94 Invalid
95 .I length
96 argument.
97 .TP
98 .B ENODEV
99 PCI support is not enabled.
101 .B ENOMEM
102 Insufficient memory.
103 .SH VERSIONS
104 These system calls are available since Linux 3.19.
105 .SH CONFORMING TO
106 This Linux-specific system call is available only on the s390 architecture.
107 The required PCI support is available beginning with System z EC12.
108 .SH SEE ALSO
109 .BR syscall (2)