Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/sun PR port-sparc64/52622: mark the parent device as...
details: https://anonhg.NetBSD.org/src/rev/a5a29d4783b1
branches: trunk
changeset: 357206:a5a29d4783b1
user: martin <martin%NetBSD.org@localhost>
date: Tue Oct 31 10:46:47 2017 +0000
description:
PR port-sparc64/52622: mark the parent device as TS_KERN_ONLY,
so userland will not touch it (and change serial params w/o our
controll).
diffstat:
sys/dev/sun/sunkbd.c | 7 +++++--
sys/dev/sun/sunms.c | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diffs (84 lines):
diff -r 0940d8dcb95c -r a5a29d4783b1 sys/dev/sun/sunkbd.c
--- a/sys/dev/sun/sunkbd.c Tue Oct 31 10:45:19 2017 +0000
+++ b/sys/dev/sun/sunkbd.c Tue Oct 31 10:46:47 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunkbd.c,v 1.29 2013/09/15 14:10:04 martin Exp $ */
+/* $NetBSD: sunkbd.c,v 1.30 2017/10/31 10:46:47 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.29 2013/09/15 14:10:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunkbd.c,v 1.30 2017/10/31 10:46:47 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -145,6 +145,7 @@
KASSERT(tp->t_linesw == &sunkbd_disc);
tp->t_oflag &= ~OPOST;
tp->t_dev = args->kmta_dev;
+ SET(tp->t_state, TS_KERN_ONLY);
/* link the structures together. */
k->k_priv = tp;
@@ -218,6 +219,7 @@
int error;
/* Open the lower device */
+ CLR(tp->t_state, TS_KERN_ONLY);
if ((error = cdev_open(tp->t_dev, O_NONBLOCK|flags,
0/* ignored? */, l)) != 0)
return (error);
@@ -228,6 +230,7 @@
t.c_ospeed = sunkbd_bps;
t.c_cflag = CLOCAL|CS8;
(*tp->t_param)(tp, &t);
+ SET(tp->t_state, TS_KERN_ONLY);
return (0);
}
diff -r 0940d8dcb95c -r a5a29d4783b1 sys/dev/sun/sunms.c
--- a/sys/dev/sun/sunms.c Tue Oct 31 10:45:19 2017 +0000
+++ b/sys/dev/sun/sunms.c Tue Oct 31 10:46:47 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunms.c,v 1.32 2013/09/15 14:13:19 martin Exp $ */
+/* $NetBSD: sunms.c,v 1.33 2017/10/31 10:46:47 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunms.c,v 1.32 2013/09/15 14:13:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunms.c,v 1.33 2017/10/31 10:46:47 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -162,6 +162,7 @@
tp->t_linesw = ttyldisc_lookup(sunms_disc.l_name);
KASSERT(tp->t_linesw == &sunms_disc);
tp->t_oflag &= ~OPOST;
+ SET(tp->t_state, TS_KERN_ONLY);
/* Initialize translator. */
ms->ms_byteno = -1;
@@ -192,6 +193,7 @@
int error;
/* Open the lower device */
+ CLR(tp->t_state, TS_KERN_ONLY);
if ((error = cdev_open(tp->t_dev, O_NONBLOCK|flags,
0/* ignored? */, l)) != 0)
return (error);
@@ -202,6 +204,7 @@
t.c_ospeed = sunms_bps;
t.c_cflag = CLOCAL|CS8;
(*tp->t_param)(tp, &t);
+ SET(tp->t_state, TS_KERN_ONLY);
return (0);
}
Home |
Main Index |
Thread Index |
Old Index