Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/linux/arch/i386 Add ptyfs pty device number trans...
details: https://anonhg.NetBSD.org/src/rev/3b86b092160f
branches: trunk
changeset: 571185:3b86b092160f
user: christos <christos%NetBSD.org@localhost>
date: Sat Nov 13 07:20:54 2004 +0000
description:
Add ptyfs pty device number translation.
diffstat:
sys/compat/linux/arch/i386/linux_machdep.c | 14 +++++++++++---
sys/compat/linux/arch/i386/linux_machdep.h | 11 +++++++----
2 files changed, 18 insertions(+), 7 deletions(-)
diffs (68 lines):
diff -r f27e2f3b60d2 -r 3b86b092160f sys/compat/linux/arch/i386/linux_machdep.c
--- a/sys/compat/linux/arch/i386/linux_machdep.c Sat Nov 13 07:20:35 2004 +0000
+++ b/sys/compat/linux/arch/i386/linux_machdep.c Sat Nov 13 07:20:54 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_machdep.c,v 1.103 2004/10/20 04:20:05 thorpej Exp $ */
+/* $NetBSD: linux_machdep.c,v 1.104 2004/11/13 07:20:54 christos Exp $ */
/*-
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.103 2004/10/20 04:20:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.104 2004/11/13 07:20:54 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vm86.h"
@@ -740,14 +740,22 @@
dev_t dev;
int raw;
{
+ extern const struct cdevsw ptc_cdevsw, pts_cdevsw;
+ const struct cdevsw *cd = cdevsw_lookup(dev);
+
if (raw) {
#if (NWSDISPLAY > 0)
extern const struct cdevsw wsdisplay_cdevsw;
- if (cdevsw_lookup(dev) == &wsdisplay_cdevsw)
+ if (cd == &wsdisplay_cdevsw)
return makedev(LINUX_CONS_MAJOR, (minor(dev) + 1));
#endif
}
+ if (cd == &ptc_cdevsw)
+ return makedev(LINUX_PTC_MAJOR, minor(dev));
+ if (cd == &pts_cdevsw)
+ return makedev(LINUX_PTS_MAJOR, minor(dev));
+
return dev;
}
diff -r f27e2f3b60d2 -r 3b86b092160f sys/compat/linux/arch/i386/linux_machdep.h
--- a/sys/compat/linux/arch/i386/linux_machdep.h Sat Nov 13 07:20:35 2004 +0000
+++ b/sys/compat/linux/arch/i386/linux_machdep.h Sat Nov 13 07:20:54 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_machdep.h,v 1.27 2003/09/06 22:09:21 christos Exp $ */
+/* $NetBSD: linux_machdep.h,v 1.28 2004/11/13 07:20:54 christos Exp $ */
/*-
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@@ -155,10 +155,13 @@
};
/*
- * Major device numbers of VT device on both Linux and NetBSD. Used in
- * ugly patch to fake device numbers.
+ * Used in ugly patch to fake device numbers.
*/
-#define LINUX_CONS_MAJOR 4
+/* Major device numbers for new style ptys. */
+#define LINUX_PTC_MAJOR 2
+#define LINUX_PTS_MAJOR 3
+/* Major device numbers of VT device on both Linux and NetBSD. */
+#define LINUX_CONS_MAJOR 4
/*
* Linux ioctl calls for the keyboard.
Home |
Main Index |
Thread Index |
Old Index