diff options
author | Toomas Soome <tsoome@me.com> | 2017-11-02 15:42:20 +0200 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2019-01-13 20:01:36 -0500 |
commit | 90c559d0abd58b80b54e9bdcfab3b4382f8b68ec (patch) | |
tree | 72a38907745df549c55a29b17c256526bf074668 /usr/src | |
parent | 9c7c0c4b592ecf39e7c580cc9b779c7202794a11 (diff) | |
download | illumos-joyent-90c559d0abd58b80b54e9bdcfab3b4382f8b68ec.tar.gz |
10200 loader: spinconsole updates
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: John Levon <john.levon@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/boot/sys/boot/i386/libi386/spinconsole.c | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/usr/src/boot/sys/boot/i386/libi386/spinconsole.c b/usr/src/boot/sys/boot/i386/libi386/spinconsole.c index ff59c7e49c..ce2fac360f 100644 --- a/usr/src/boot/sys/boot/i386/libi386/spinconsole.c +++ b/usr/src/boot/sys/boot/i386/libi386/spinconsole.c @@ -63,46 +63,64 @@ struct console spinconsole = { static void spinc_probe(struct console *cp) { - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); + int i; + struct console *parent; + + if (cp->c_private == NULL) { + for (i = 0; consoles[i] != NULL; i++) + if (strcmp(consoles[i]->c_name, "text") == 0) + break; + cp->c_private = consoles[i]; + } + + parent = cp->c_private; + if (parent != NULL) + parent->c_probe(cp); } static int -spinc_init(struct console *cp __unused, int arg __unused) +spinc_init(struct console *cp, int arg) { - return(0); + struct console *parent; + + parent = cp->c_private; + if (parent != NULL) + return (parent->c_init(cp, arg)); + else + return (0); } static void -spinc_putchar(struct console *cp __unused, int c __unused) +spinc_putchar(struct console *cp, int c __unused) { static unsigned tw_chars = 0x5C2D2F7C; /* "\-/|" */ - static time_t lasttime; - int i; + static time_t lasttime = 0; + struct console *parent; time_t now; now = time(NULL); if (now < (lasttime + 1)) return; lasttime = now; - for (i = 0; consoles[i] != NULL; i++) - if (strcmp(consoles[i]->c_name, "text") == 0) - break; - if (consoles[i] == NULL) + parent = cp->c_private; + if (parent == NULL) return; - consoles[i]->c_out(consoles[i], (char)tw_chars); - consoles[i]->c_out(consoles[i], '\b'); + parent->c_out(parent, (char)tw_chars); + parent->c_out(parent, '\b'); tw_chars = (tw_chars >> 8) | ((tw_chars & (unsigned long)0xFF) << 24); } static int spinc_getchar(struct console *cp __unused) { - return(-1); + + return (-1); } static int spinc_ischar(struct console *cp __unused) { - return(0); + + return (0); } |