diff options
author | phk <phk@FreeBSD.org> | 2003-02-20 20:54:45 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-02-20 20:54:45 +0000 |
commit | 72688ad7fe6ac65cbfc2c4d260ba7d901bf1bcc2 (patch) | |
tree | fe84e49e8fed83b0535fa5e72d7341488cc6b288 /sys/dev/sio | |
parent | f5440b21c3c89d9d1d989bbed1147a6d7e678e41 (diff) | |
download | FreeBSD-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/dev/sio')
-rw-r--r-- | sys/dev/sio/sio.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 7efb668..8d7f95a 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -2773,6 +2773,8 @@ CONS_DRIVER(sio, siocnprobe, siocninit, siocnterm, siocngetc, siocncheckc, /* To get the GDB related variables */ #if DDB > 0 #include <ddb/ddb.h> +static struct consdev gdbconsdev; + #endif static void @@ -2982,7 +2984,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 @@ -3003,7 +3006,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; } @@ -3090,7 +3094,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 @@ -3122,15 +3127,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; @@ -3151,15 +3157,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; @@ -3178,16 +3185,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; |