]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/s390_pci_mmio_write.2
c6e3c6300f5ba954fafd2be2dc851e6735d6db7e
[thirdparty/man-pages.git] / man2 / s390_pci_mmio_write.2
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 2021-03-22 "Linux Programmer's Manual"
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>
17 .PP
18 .BI "int syscall(SYS_s390_pci_mmio_write, unsigned long " mmio_addr ,
19 .BI " const void *" user_buffer ", size_t " length );
20 .BI "int syscall(SYS_s390_pci_mmio_read, unsigned long " mmio_addr ,
21 .BI " void *" user_buffer ", size_t " length );
22 .fi
23 .PP
24 .IR Note :
25 glibc provides no wrappers for these system calls,
26 necessitating the use of
27 .BR syscall (2).
28 .SH DESCRIPTION
29 The
30 .BR s390_pci_mmio_write ()
31 system call writes
32 .IR length
33 bytes of data from the user-space buffer
34 .IR user_buffer
35 to the PCI MMIO memory location specified by
36 .IR mmio_addr .
37 The
38 .BR s390_pci_mmio_read ()
39 system call reads
40 .I length
41 bytes of
42 data from the PCI MMIO memory location specified by
43 .IR mmio_addr
44 to the user-space buffer
45 .IR user_buffer .
46 .PP
47 These system calls must be used instead of the simple assignment
48 or data-transfer operations that are used to access the PCI MMIO
49 memory areas mapped to user space on the Linux System z platform.
50 The address specified by
51 .IR mmio_addr
52 must belong to a PCI MMIO memory page mapping in the caller's address space,
53 and the data being written or read must not cross a page boundary.
54 The
55 .IR length
56 value cannot be greater than the system page size.
57 .SH RETURN VALUE
58 On success,
59 .BR s390_pci_mmio_write ()
60 and
61 .BR s390_pci_mmio_read ()
62 return 0.
63 On failure, \-1 is returned and
64 .IR errno
65 is set to indicate the error.
66 .SH ERRORS
67 .TP
68 .B EFAULT
69 The address in
70 .I mmio_addr
71 is invalid.
72 .TP
73 .B EFAULT
74 .IR user_buffer
75 does not point to a valid location in the caller's address space.
76 .TP
77 .B EINVAL
78 Invalid
79 .I length
80 argument.
81 .TP
82 .B ENODEV
83 PCI support is not enabled.
84 .TP
85 .B ENOMEM
86 Insufficient memory.
87 .SH VERSIONS
88 These system calls are available since Linux 3.19.
89 .SH CONFORMING TO
90 This Linux-specific system call is available only on the s390 architecture.
91 The required PCI support is available beginning with System z EC12.
92 .SH SEE ALSO
93 .BR syscall (2)