summaryrefslogtreecommitdiffstats
path: root/sys/dev/cfe
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2009-07-04 02:50:33 +0000
committerimp <imp@FreeBSD.org>2009-07-04 02:50:33 +0000
commiteef46435c0a0407ec0d46b03bce68680c398662e (patch)
tree551b2c30cd281b1965c5369365f8b916823d8f62 /sys/dev/cfe
parentbec6efe4f7bb6de047f744f362b313d6c1eba6ce (diff)
downloadFreeBSD-src-eef46435c0a0407ec0d46b03bce68680c398662e.zip
FreeBSD-src-eef46435c0a0407ec0d46b03bce68680c398662e.tar.gz
Fix various conolse issues with cfe after MPSAFE tty.
Fix a bug with getting env on cfe...
Diffstat (limited to 'sys/dev/cfe')
-rw-r--r--sys/dev/cfe/cfe_api.c2
-rw-r--r--sys/dev/cfe/cfe_console.c22
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/dev/cfe/cfe_api.c b/sys/dev/cfe/cfe_api.c
index 15f6ae7..bf3fa66 100644
--- a/sys/dev/cfe/cfe_api.c
+++ b/sys/dev/cfe/cfe_api.c
@@ -160,7 +160,7 @@ cfe_enumenv(int idx, char *name, int namelen, char *val, int vallen)
{
cfe_xiocb_t xiocb;
- xiocb.xiocb_fcode = CFE_CMD_ENV_SET;
+ xiocb.xiocb_fcode = CFE_CMD_ENV_ENUM;
xiocb.xiocb_status = 0;
xiocb.xiocb_handle = 0;
xiocb.xiocb_flags = 0;
diff --git a/sys/dev/cfe/cfe_console.c b/sys/dev/cfe/cfe_console.c
index 2c38096..1461ef2 100644
--- a/sys/dev/cfe/cfe_console.c
+++ b/sys/dev/cfe/cfe_console.c
@@ -84,14 +84,12 @@ CONSOLE_DRIVER(cfe);
static void
cn_drvinit(void *unused)
{
- char output[32];
struct tty *tp;
if (cfe_consdev.cn_pri != CN_DEAD &&
cfe_consdev.cn_name[0] != '\0') {
tp = tty_alloc(&cfe_ttydevsw, NULL);
- tty_makedev(tp, NULL, "%s", output);
- tty_makealias(tp, "cfecons");
+ tty_makedev(tp, NULL, "cfecons");
}
}
@@ -117,15 +115,21 @@ cfe_tty_close(struct tty *tp)
static void
cfe_tty_outwakeup(struct tty *tp)
{
- int len;
+ int len, written, rc;
u_char buf[CFEBURSTLEN];
for (;;) {
len = ttydisc_getc(tp, buf, sizeof buf);
if (len == 0)
break;
- while (cfe_write(conhandle, buf, len) == 0)
- continue;
+
+ written = 0;
+ while (written < len) {
+ rc = cfe_write(conhandle, &buf[written], len - written);
+ if (rc < 0)
+ break;
+ written += rc;
+ }
}
}
@@ -184,13 +188,9 @@ cfe_cnterm(struct consdev *cp)
static int
cfe_cngetc(struct consdev *cp)
{
- int result;
unsigned char ch;
- while ((result = cfe_read(conhandle, &ch, 1)) == 0)
- continue;
-
- if (result > 0) {
+ if (cfe_read(conhandle, &ch, 1) == 1) {
#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER)
int kdb_brk;
OpenPOWER on IntegriCloud