summaryrefslogtreecommitdiffstats
path: root/sys/pc98
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-20 20:54:45 +0000
committerphk <phk@FreeBSD.org>2003-02-20 20:54:45 +0000
commit72688ad7fe6ac65cbfc2c4d260ba7d901bf1bcc2 (patch)
treefe84e49e8fed83b0535fa5e72d7341488cc6b288 /sys/pc98
parentf5440b21c3c89d9d1d989bbed1147a6d7e678e41 (diff)
downloadFreeBSD-src-72688ad7fe6ac65cbfc2c4d260ba7d901bf1bcc2.zip
FreeBSD-src-72688ad7fe6ac65cbfc2c4d260ba7d901bf1bcc2.tar.gz
Change the console interface to pass a "struct consdev *" instead of a
dev_t to the method functions. The dev_t can still be found at struct consdev *->cn_dev. Add a void *cn_arg element to struct consdev which the drivers can use for retrieving their softc.
Diffstat (limited to 'sys/pc98')
-rw-r--r--sys/pc98/cbus/sio.c26
-rw-r--r--sys/pc98/pc98/sio.c26
-rw-r--r--sys/pc98/pc98/syscons.c8
3 files changed, 36 insertions, 24 deletions
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index 7d497db..18f1483 100644
--- a/sys/pc98/cbus/sio.c
+++ b/sys/pc98/cbus/sio.c
@@ -4003,6 +4003,7 @@ CONS_DRIVER(sio, siocnprobe, siocninit, siocnterm, siocngetc, siocncheckc,
/* To get the GDB related variables */
#if DDB > 0
#include <ddb/ddb.h>
+struct consdev gdbconsdev;
#endif
static void
@@ -4212,7 +4213,8 @@ siocnprobe(cp)
siogdbiobase = iobase;
siogdbunit = unit;
#if DDB > 0
- gdb_arg = makedev(CDEV_MAJOR, unit);
+ gdbconsdev.cn_dev = makedev(CDEV_MAJOR, unit);
+ gdb_arg = &gdbconsdev;
gdb_getc = siocngetc;
gdb_putc = siocnputc;
#endif
@@ -4233,7 +4235,8 @@ siocnprobe(cp)
printf("configuration file (currently sio only).\n");
siogdbiobase = siocniobase;
siogdbunit = siocnunit;
- gdb_arg = makedev(CDEV_MAJOR, siocnunit);
+ gdbconsdev.cn_dev = makedev(CDEV_MAJOR, siocnunit);
+ gdb_arg = &gdbconsdev;
gdb_getc = siocngetc;
gdb_putc = siocnputc;
}
@@ -4320,7 +4323,8 @@ siogdbattach(port, speed)
printf("sio%d: gdb debugging port\n", unit);
siogdbunit = unit;
#if DDB > 0
- gdb_arg = makedev(CDEV_MAJOR, unit);
+ gdbconsdev.cn_dev = makedev(CDEV_MAJOR, unit);
+ gdb_arg = &gdbconsdev;
gdb_getc = siocngetc;
gdb_putc = siocnputc;
#endif
@@ -4352,15 +4356,16 @@ siogdbattach(port, speed)
#endif
static int
-siocncheckc(dev)
- dev_t dev;
+siocncheckc(struct consdev *cd)
{
int c;
+ dev_t dev;
Port_t iobase;
int s;
struct siocnstate sp;
speed_t speed;
+ dev = cd->cn_dev;
if (minor(dev) == siocnunit) {
iobase = siocniobase;
speed = comdefaultrate;
@@ -4381,15 +4386,16 @@ siocncheckc(dev)
static int
-siocngetc(dev)
- dev_t dev;
+siocngetc(struct consdev *cd)
{
int c;
+ dev_t dev;
Port_t iobase;
int s;
struct siocnstate sp;
speed_t speed;
+ dev = cd->cn_dev;
if (minor(dev) == siocnunit) {
iobase = siocniobase;
speed = comdefaultrate;
@@ -4408,16 +4414,16 @@ siocngetc(dev)
}
static void
-siocnputc(dev, c)
- dev_t dev;
- int c;
+siocnputc(struct consdev *cd, int c)
{
int need_unlock;
int s;
+ dev_t dev;
struct siocnstate sp;
Port_t iobase;
speed_t speed;
+ dev = cd->cn_dev;
if (minor(dev) == siocnunit) {
iobase = siocniobase;
speed = comdefaultrate;
diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c
index 7d497db..18f1483 100644
--- a/sys/pc98/pc98/sio.c
+++ b/sys/pc98/pc98/sio.c
@@ -4003,6 +4003,7 @@ CONS_DRIVER(sio, siocnprobe, siocninit, siocnterm, siocngetc, siocncheckc,
/* To get the GDB related variables */
#if DDB > 0
#include <ddb/ddb.h>
+struct consdev gdbconsdev;
#endif
static void
@@ -4212,7 +4213,8 @@ siocnprobe(cp)
siogdbiobase = iobase;
siogdbunit = unit;
#if DDB > 0
- gdb_arg = makedev(CDEV_MAJOR, unit);
+ gdbconsdev.cn_dev = makedev(CDEV_MAJOR, unit);
+ gdb_arg = &gdbconsdev;
gdb_getc = siocngetc;
gdb_putc = siocnputc;
#endif
@@ -4233,7 +4235,8 @@ siocnprobe(cp)
printf("configuration file (currently sio only).\n");
siogdbiobase = siocniobase;
siogdbunit = siocnunit;
- gdb_arg = makedev(CDEV_MAJOR, siocnunit);
+ gdbconsdev.cn_dev = makedev(CDEV_MAJOR, siocnunit);
+ gdb_arg = &gdbconsdev;
gdb_getc = siocngetc;
gdb_putc = siocnputc;
}
@@ -4320,7 +4323,8 @@ siogdbattach(port, speed)
printf("sio%d: gdb debugging port\n", unit);
siogdbunit = unit;
#if DDB > 0
- gdb_arg = makedev(CDEV_MAJOR, unit);
+ gdbconsdev.cn_dev = makedev(CDEV_MAJOR, unit);
+ gdb_arg = &gdbconsdev;
gdb_getc = siocngetc;
gdb_putc = siocnputc;
#endif
@@ -4352,15 +4356,16 @@ siogdbattach(port, speed)
#endif
static int
-siocncheckc(dev)
- dev_t dev;
+siocncheckc(struct consdev *cd)
{
int c;
+ dev_t dev;
Port_t iobase;
int s;
struct siocnstate sp;
speed_t speed;
+ dev = cd->cn_dev;
if (minor(dev) == siocnunit) {
iobase = siocniobase;
speed = comdefaultrate;
@@ -4381,15 +4386,16 @@ siocncheckc(dev)
static int
-siocngetc(dev)
- dev_t dev;
+siocngetc(struct consdev *cd)
{
int c;
+ dev_t dev;
Port_t iobase;
int s;
struct siocnstate sp;
speed_t speed;
+ dev = cd->cn_dev;
if (minor(dev) == siocnunit) {
iobase = siocniobase;
speed = comdefaultrate;
@@ -4408,16 +4414,16 @@ siocngetc(dev)
}
static void
-siocnputc(dev, c)
- dev_t dev;
- int c;
+siocnputc(struct consdev *cd, int c)
{
int need_unlock;
int s;
+ dev_t dev;
struct siocnstate sp;
Port_t iobase;
speed_t speed;
+ dev = cd->cn_dev;
if (minor(dev) == siocnunit) {
iobase = siocniobase;
speed = comdefaultrate;
diff --git a/sys/pc98/pc98/syscons.c b/sys/pc98/pc98/syscons.c
index 55ce644..91d55a1 100644
--- a/sys/pc98/pc98/syscons.c
+++ b/sys/pc98/pc98/syscons.c
@@ -1469,7 +1469,7 @@ sccnattach(void)
#endif /* __alpha__ */
static void
-sccnputc(dev_t dev, int c)
+sccnputc(struct consdev *cd, int c)
{
u_char buf[1];
scr_stat *scp = sc_console;
@@ -1511,19 +1511,19 @@ sccnputc(dev_t dev, int c)
}
static int
-sccngetc(dev_t dev)
+sccngetc(struct consdev *cd)
{
return sccngetch(0);
}
static int
-sccncheckc(dev_t dev)
+sccncheckc(struct consdev *cd)
{
return sccngetch(SCGETC_NONBLOCK);
}
static void
-sccndbctl(dev_t dev, int on)
+sccndbctl(struct consdev *cd, int on)
{
/* try to switch to the kernel console screen */
if (on && debugger == 0) {
OpenPOWER on IntegriCloud