Debian Codegraph @

upstream/debian-unstable/man2/s390_pci_mmio_write.2

raw
1 .\" Copyright 2015, International Business Machines Corp.
2 .\" Copyright, the authors of the Linux man-pages project
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .TH s390_pci_mmio_write 2 2026-02-08 "Linux man-pages 6.18"
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 .P
18 .BR "int syscall(" "size_t length;"
19 .BI " SYS_s390_pci_mmio_write, unsigned long " mmio_addr ,
20 .BI " const void " user_buffer [ length "], size_t " length );
21 .BR "int syscall(" "size_t length;"
22 .BI " SYS_s390_pci_mmio_read, unsigned long " mmio_addr ,
23 .BI " void " user_buffer [ length "], size_t " length );
24 .fi
25 .P
26 .IR Note :
27 glibc provides no wrappers for these system calls,
28 necessitating the use of
29 .BR syscall (2).
30 .SH DESCRIPTION
31 The
32 .BR s390_pci_mmio_write ()
33 system call writes
34 .I length
35 bytes of data from the user-space buffer
36 .I user_buffer
37 to the PCI MMIO memory location specified by
38 .IR mmio_addr .
39 The
40 .BR s390_pci_mmio_read ()
41 system call reads
42 .I length
43 bytes of
44 data from the PCI MMIO memory location specified by
45 .I mmio_addr
46 to the user-space buffer
47 .IR user_buffer .
48 .P
49 These system calls must be used instead of the simple assignment
50 or data-transfer operations that are used to access the PCI MMIO
51 memory areas mapped to user space on the Linux System z platform.
52 The address specified by
53 .I mmio_addr
54 must belong to a PCI MMIO memory page mapping in the caller's address space,
55 and the data being written or read must not cross a page boundary.
56 The
57 .I length
58 value cannot be greater than the system page size.
59 .SH RETURN VALUE
60 On success,
61 .BR s390_pci_mmio_write ()
62 and
63 .BR s390_pci_mmio_read ()
64 return 0.
65 On failure, \-1 is returned and
66 .I errno
67 is set to indicate the error.
68 .SH ERRORS
69 .TP
70 .B EFAULT
71 The address in
72 .I mmio_addr
73 is invalid.
74 .TP
75 .B EFAULT
76 .I user_buffer
77 does not point to a valid location in the caller's address space.
78 .TP
79 .B EINVAL
80 Invalid
81 .I length
82 argument.
83 .TP
84 .B ENODEV
85 PCI support is not enabled.
86 .TP
87 .B ENOMEM
88 Insufficient memory.
89 .SH STANDARDS
90 Linux on s390.
91 .SH HISTORY
92 Linux 3.19.
93 System z EC12.
94 .SH SEE ALSO
95 .BR syscall (2)