summaryrefslogtreecommitdiffstats
path: root/sys/sun4v
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2006-10-13 06:45:50 +0000
committerkmacy <kmacy@FreeBSD.org>2006-10-13 06:45:50 +0000
commit9d0d5260181cb9fa20820e0cdfb6e2e0cbbabd2e (patch)
treeb5234e8b9e52f463696a207505a3c3d410e2d8fe /sys/sun4v
parent915020c78c3c30b731c403ebafc1e87793b33212 (diff)
downloadFreeBSD-src-9d0d5260181cb9fa20820e0cdfb6e2e0cbbabd2e.zip
FreeBSD-src-9d0d5260181cb9fa20820e0cdfb6e2e0cbbabd2e.tar.gz
Fix console and update to new api.
The style changes are required as a result of the CONSOLE_DRIVER macro. Approved by: rwatson (mentor)
Diffstat (limited to 'sys/sun4v')
-rw-r--r--sys/sun4v/sun4v/hvcons.c48
1 files changed, 23 insertions, 25 deletions
diff --git a/sys/sun4v/sun4v/hvcons.c b/sys/sun4v/sun4v/hvcons.c
index e08916b..359b0be 100644
--- a/sys/sun4v/sun4v/hvcons.c
+++ b/sys/sun4v/sun4v/hvcons.c
@@ -84,15 +84,14 @@ static int hvcn_tty_param(struct tty *, struct termios *);
static void hvcn_tty_stop(struct tty *, int);
static void hvcn_timeout(void *);
-static cn_probe_t hvcnprobe;
-static cn_init_t hvcninit;
-static cn_getc_t hvcngetc;
-static cn_checkc_t hvcncheckc;
-static cn_putc_t hvcnputc;
+static cn_probe_t hvcn_cnprobe;
+static cn_init_t hvcn_cninit;
+static cn_getc_t hvcn_cngetc;
+static cn_putc_t hvcn_cnputc;
+static cn_term_t hvcn_cnterm;
-CONS_DRIVER(hvcn, hvcnprobe, hvcninit, NULL, hvcngetc,
- hvcncheckc, hvcnputc, NULL);
+CONSOLE_DRIVER(hvcn);
static int
@@ -159,7 +158,7 @@ hvcn_close(struct cdev *dev, int flag, int mode, struct thread *td)
}
static void
-hvcnprobe(struct consdev *cp)
+hvcn_cnprobe(struct consdev *cp)
{
#if 0
@@ -190,13 +189,13 @@ done:
}
static void
-hvcninit(struct consdev *cp)
+hvcn_cninit(struct consdev *cp)
{
sprintf(cp->cn_name, "hvcn");
}
static int
-hvcngetc(struct consdev *cp)
+hvcn_cngetc(struct consdev *cp)
{
unsigned char ch;
int l;
@@ -222,7 +221,7 @@ hvcngetc(struct consdev *cp)
}
static int
-hvcncheckc(struct consdev *cp)
+hvcn_cncheckc(struct consdev *cp)
{
unsigned char ch;
int l;
@@ -242,7 +241,13 @@ hvcncheckc(struct consdev *cp)
static void
-hvcnputc(struct consdev *cp, int c)
+hvcn_cnterm(struct consdev *cp)
+{
+ ;
+}
+
+static void
+hvcn_cnputc(struct consdev *cp, int c)
{
int error;
@@ -309,7 +314,7 @@ hvcn_intr(void *v)
tp = (struct tty *)v;
- while ((c = hvcncheckc(NULL)) != -1)
+ while ((c = hvcn_cncheckc(NULL)) != -1)
if (tp->t_state & TS_ISOPEN)
ttyld_rint(tp, c);
@@ -327,7 +332,7 @@ hvcn_timeout(void *v)
static int
-hvcn_probe(device_t dev)
+hvcn_dev_probe(device_t dev)
{
if (strcmp(mdesc_bus_get_name(dev), "console"))
@@ -340,11 +345,10 @@ hvcn_probe(device_t dev)
static int
-hvcn_attach(device_t dev)
+hvcn_dev_attach(device_t dev)
{
struct cdev *cdev;
- char output[32];
int error, rid;
/* belongs in attach - but attach is getting called multiple times
@@ -354,14 +358,8 @@ hvcn_attach(device_t dev)
if (hvcn_consdev.cn_pri == CN_DEAD ||
hvcn_consdev.cn_name[0] == '\0')
return (ENXIO);
-#if 0
- if ((options = OF_finddevice("/options")) == -1 ||
- OF_getprop(options, "output-device", output,
- sizeof(output)) == -1)
- return (ENXIO);
-#endif
- cdev = make_dev(&hvcn_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "%s", output);
+ cdev = make_dev(&hvcn_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "ttyv%r", 1);
make_dev_alias(cdev, "hvcn");
rid = 0;
@@ -386,8 +384,8 @@ fail:
}
static device_method_t hvcn_methods[] = {
- DEVMETHOD(device_probe, hvcn_probe),
- DEVMETHOD(device_attach, hvcn_attach),
+ DEVMETHOD(device_probe, hvcn_dev_probe),
+ DEVMETHOD(device_attach, hvcn_dev_attach),
{0, 0}
};
OpenPOWER on IntegriCloud