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

Commit d475f942 authored by Michael Holzheu's avatar Michael Holzheu Committed by Martin Schwidefsky
Browse files

s390/sclp: Add SCLP character device driver



Add a character misc device "sclp_ctl" that allows to run SCCBs
from user space using the SCLP_CTL_SCCB ioctl.

Signed-off-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent e9a8f32a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ Code Seq#(hex) Include File Comments
0x06	all	linux/lp.h
0x09	all	linux/raid/md_u.h
0x10	00-0F	drivers/char/s390/vmcp.h
0x10	10-1F	arch/s390/include/uapi/sclp_ctl.h
0x12	all	linux/fs.h
		linux/blkpg.h
0x1b	all	InfiniBand Subsystem	<http://infiniband.sourceforge.net/>
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ header-y += siginfo.h
header-y += signal.h
header-y += socket.h
header-y += sockios.h
header-y += sclp_ctl.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
+24 −0
Original line number Diff line number Diff line
/*
 * IOCTL interface for SCLP
 *
 * Copyright IBM Corp. 2012
 *
 * Author: Michael Holzheu <holzheu@linux.vnet.ibm.com>
 */

#ifndef _ASM_SCLP_CTL_H
#define _ASM_SCLP_CTL_H

#include <linux/types.h>

struct sclp_ctl_sccb {
	__u32	cmdw;
	__u64	sccb;
} __attribute__((packed));

#define SCLP_CTL_IOCTL_MAGIC 0x10

#define SCLP_CTL_SCCB \
	_IOWR(SCLP_CTL_IOCTL_MAGIC, 0x10, struct sclp_ctl_sccb)

#endif
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
#

obj-y += ctrlchar.o keyboard.o defkeymap.o sclp.o sclp_rw.o sclp_quiesce.o \
	 sclp_cmd.o sclp_config.o sclp_cpi_sys.o sclp_ocf.o
	 sclp_cmd.o sclp_config.o sclp_cpi_sys.o sclp_ocf.o sclp_ctl.o

obj-$(CONFIG_TN3270) += raw3270.o
obj-$(CONFIG_TN3270_CONSOLE) += con3270.o
+10 −5
Original line number Diff line number Diff line
@@ -148,14 +148,19 @@ static int sclp_init(void);
int
sclp_service_call(sclp_cmdw_t command, void *sccb)
{
	int cc;
	int cc = 4; /* Initialize for program check handling */

	asm volatile(
		"	.insn	rre,0xb2200000,%1,%2\n"  /* servc %1,%2 */
		"	ipm	%0\n"
		"	srl	%0,28"
		: "=&d" (cc) : "d" (command), "a" (__pa(sccb))
		"0:	.insn	rre,0xb2200000,%1,%2\n"  /* servc %1,%2 */
		"1:	ipm	%0\n"
		"	srl	%0,28\n"
		"2:\n"
		EX_TABLE(0b, 2b)
		EX_TABLE(1b, 2b)
		: "+&d" (cc) : "d" (command), "a" (__pa(sccb))
		: "cc", "memory");
	if (cc == 4)
		return -EINVAL;
	if (cc == 3)
		return -EIO;
	if (cc == 2)
Loading