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