]>
Commit | Line | Data |
---|---|---|
a698082e AI |
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 | .\" | |
4b8c67d9 | 25 | .TH S390_PCI_MMIO_WRITE 2 2017-09-15 "Linux Programmer's Manual" |
a698082e AI |
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 | .B #include <asm/unistd.h> | |
dbfe9c70 | 32 | .PP |
a698082e | 33 | .BI "int s390_pci_mmio_write(unsigned long " mmio_addr ", |
18eff6b9 | 34 | .BI " void *" user_buffer ", size_t " length "); |
a698082e | 35 | .BI "int s390_pci_mmio_read(unsigned long " mmio_addr ", |
18eff6b9 | 36 | .BI " void *" user_buffer ", size_t " length "); |
a698082e AI |
37 | .fi |
38 | .SH DESCRIPTION | |
39 | The | |
40 | .BR s390_pci_mmio_write () | |
18eff6b9 | 41 | system call writes |
a698082e | 42 | .IR length |
18eff6b9 | 43 | bytes of data from the user-space buffer |
a698082e | 44 | .IR user_buffer |
18eff6b9 MK |
45 | to the PCI MMIO memory location specified by |
46 | .IR mmio_addr . | |
a698082e AI |
47 | The |
48 | .BR s390_pci_mmio_read () | |
18eff6b9 MK |
49 | system call reads |
50 | .I length | |
51 | bytes of | |
52 | data from the PCI MMIO memory location specified by | |
53 | .IR mmio_addr | |
54 | to the user-space buffer | |
55 | .IR user_buffer . | |
efeece04 | 56 | .PP |
a698082e | 57 | These system calls must be used instead of the simple assignment |
18eff6b9 MK |
58 | or data-transfer operations that are used to access the PCI MMIO |
59 | memory areas mapped to user space on the Linux System z platform. | |
60 | The address specified by | |
a698082e | 61 | .IR mmio_addr |
18eff6b9 MK |
62 | must belong to a PCI MMIO memory page mapping in the caller's address space, |
63 | and the data being written or read must not cross a page boundary. | |
c1eb8ec5 | 64 | The |
a698082e | 65 | .IR length |
18eff6b9 | 66 | value cannot be greater than the system page size. |
a698082e AI |
67 | .SH RETURN VALUE |
68 | On success, | |
69 | .BR s390_pci_mmio_write () | |
70 | and | |
71 | .BR s390_pci_mmio_read () | |
72 | return 0. | |
771e13d4 | 73 | On error, \-1 is returned and |
a698082e AI |
74 | .IR errno |
75 | is set to one of the error codes listed below. | |
76 | .SH ERRORS | |
77 | .TP | |
18eff6b9 MK |
78 | .B EFAULT |
79 | The address in | |
80 | .I mmio_addr | |
81 | is invalid. | |
82 | .TP | |
83 | .B EFAULT | |
84 | .IR user_buffer | |
85 | does not point to a valid location in the caller's address space. | |
86 | .TP | |
87 | .B EINVAL | |
88 | Invalid | |
89 | .I length | |
90 | argument. | |
91 | .TP | |
a698082e AI |
92 | .B ENODEV |
93 | PCI support is not enabled. | |
94 | .TP | |
95 | .B ENOMEM | |
96 | Insufficient memory. | |
a698082e AI |
97 | .SH VERSIONS |
98 | These system calls are available since Linux 3.19. | |
99 | .SH CONFORMING TO | |
c1eb8ec5 MK |
100 | This Linux-specific system call is available only on the s390 architecture. |
101 | The required PCI support is available beginning with System z EC12. | |
a698082e AI |
102 | .SH NOTES |
103 | Glibc does not provide a wrapper for this system call, use | |
104 | .BR syscall (2) | |
105 | to call it. | |
106 | .SH SEE ALSO | |
107 | .BR syscall (2) |