share/mk/: Fix includes
[man-pages.git] / man2 / s390_pci_mmio_write.2
blob00875f20a05c1b76cc2c9ded546fbad1a78440df
1 .\" Copyright (c) IBM Corp. 2015
2 .\" Author: Alexey Ishchuk <aishchuk@linux.vnet.ibm.com>
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .TH s390_pci_mmio_write 2 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 s390_pci_mmio_write, s390_pci_mmio_read \- transfer data to/from PCI
9 MMIO memory page
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ", " \-lc )
13 .SH SYNOPSIS
14 .nf
15 .BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"
16 .B #include <unistd.h>
18 .BI "int syscall(SYS_s390_pci_mmio_write, unsigned long " mmio_addr ,
19 .BI "                       const void " user_buffer [. length "], \
20 size_t " length );
21 .BI "int syscall(SYS_s390_pci_mmio_read, unsigned long " mmio_addr ,
22 .BI "                       void " user_buffer [. length "], size_t " length );
23 .fi
25 .IR Note :
26 glibc provides no wrappers for these system calls,
27 necessitating the use of
28 .BR syscall (2).
29 .SH DESCRIPTION
30 The
31 .BR s390_pci_mmio_write ()
32 system call writes
33 .I length
34 bytes of data from the user-space buffer
35 .I user_buffer
36 to the PCI MMIO memory location specified by
37 .IR mmio_addr .
38 The
39 .BR s390_pci_mmio_read ()
40 system call reads
41 .I length
42 bytes of
43 data from the PCI MMIO memory location specified by
44 .I mmio_addr
45 to the user-space buffer
46 .IR user_buffer .
48 These system calls must be used instead of the simple assignment
49 or data-transfer operations that are used to access the PCI MMIO
50 memory areas mapped to user space on the Linux System z platform.
51 The address specified by
52 .I mmio_addr
53 must belong to a PCI MMIO memory page mapping in the caller's address space,
54 and the data being written or read must not cross a page boundary.
55 The
56 .I length
57 value cannot be greater than the system page size.
58 .SH RETURN VALUE
59 On success,
60 .BR s390_pci_mmio_write ()
61 and
62 .BR s390_pci_mmio_read ()
63 return 0.
64 On failure, \-1 is returned and
65 .I errno
66 is set to indicate the error.
67 .SH ERRORS
68 .TP
69 .B EFAULT
70 The address in
71 .I mmio_addr
72 is invalid.
73 .TP
74 .B EFAULT
75 .I user_buffer
76 does not point to a valid location in the caller's address space.
77 .TP
78 .B EINVAL
79 Invalid
80 .I length
81 argument.
82 .TP
83 .B ENODEV
84 PCI support is not enabled.
85 .TP
86 .B ENOMEM
87 Insufficient memory.
88 .SH STANDARDS
89 Linux on s390.
90 .SH HISTORY
91 Linux 3.19.
92 System z EC12.
93 .SH SEE ALSO
94 .BR syscall (2)