Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4eafad7f authored by Alexey Ishchuk's avatar Alexey Ishchuk Committed by Martin Schwidefsky
Browse files

s390/kernel: add system calls for PCI memory access



Add the new __NR_s390_pci_mmio_write and __NR_s390_pci_mmio_read
system calls to allow user space applications to access device PCI I/O
memory pages on s390x platform.

[ Martin Schwidefsky: some code beautification ]

Signed-off-by: default avatarAlexey Ishchuk <aishchuk@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 86c558e8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -287,7 +287,9 @@
#define __NR_getrandom		349
#define __NR_memfd_create	350
#define __NR_bpf		351
#define NR_syscalls 352
#define __NR_s390_pci_mmio_write	352
#define __NR_s390_pci_mmio_read		353
#define NR_syscalls 354

/* 
 * There are some system calls that are not present on 64 bit, some
+2 −0
Original line number Diff line number Diff line
@@ -218,3 +218,5 @@ COMPAT_SYSCALL_WRAP3(seccomp, unsigned int, op, unsigned int, flags, const char
COMPAT_SYSCALL_WRAP3(getrandom, char __user *, buf, size_t, count, unsigned int, flags)
COMPAT_SYSCALL_WRAP2(memfd_create, const char __user *, uname, unsigned int, flags)
COMPAT_SYSCALL_WRAP3(bpf, int, cmd, union bpf_attr *, attr, unsigned int, size);
COMPAT_SYSCALL_WRAP3(s390_pci_mmio_write, const unsigned long, mmio_addr, const void __user *, user_buffer, const size_t, length);
COMPAT_SYSCALL_WRAP3(s390_pci_mmio_read, const unsigned long, mmio_addr, void __user *, user_buffer, const size_t, length);
+2 −0
Original line number Diff line number Diff line
@@ -74,4 +74,6 @@ struct old_sigaction;
long sys_s390_personality(unsigned int personality);
long sys_s390_runtime_instr(int command, int signum);

long sys_s390_pci_mmio_write(unsigned long, const void __user *, size_t);
long sys_s390_pci_mmio_read(unsigned long, void __user *, size_t);
#endif /* _ENTRY_H */
+2 −0
Original line number Diff line number Diff line
@@ -360,3 +360,5 @@ SYSCALL(sys_seccomp,sys_seccomp,compat_sys_seccomp)
SYSCALL(sys_getrandom,sys_getrandom,compat_sys_getrandom)
SYSCALL(sys_memfd_create,sys_memfd_create,compat_sys_memfd_create) /* 350 */
SYSCALL(sys_bpf,sys_bpf,compat_sys_bpf)
SYSCALL(sys_ni_syscall,sys_s390_pci_mmio_write,compat_sys_s390_pci_mmio_write)
SYSCALL(sys_ni_syscall,sys_s390_pci_mmio_read,compat_sys_s390_pci_mmio_read)
+1 −1
Original line number Diff line number Diff line
@@ -3,4 +3,4 @@
#

obj-$(CONFIG_PCI)	+= pci.o pci_dma.o pci_clp.o pci_sysfs.o \
			   pci_event.o pci_debug.o pci_insn.o
			   pci_event.o pci_debug.o pci_insn.o pci_mmio.o
Loading