diff options
author | nyan <nyan@FreeBSD.org> | 2013-06-01 12:27:48 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2013-06-01 12:27:48 +0000 |
commit | bfce0b30fa1e29d33ded21e07c6ecbc40c95de0d (patch) | |
tree | 7b2048e48fb3a48e46cc7c681e027f93ec8e5e19 | |
parent | 6a699f9f06892701293ba27393f246b9cb32ddad (diff) | |
download | FreeBSD-src-bfce0b30fa1e29d33ded21e07c6ecbc40c95de0d.zip FreeBSD-src-bfce0b30fa1e29d33ded21e07c6ecbc40c95de0d.tar.gz |
MFi386: revision 245848
Always update the hw.uart.console hint.
-rw-r--r-- | sys/boot/pc98/libpc98/comconsole.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/sys/boot/pc98/libpc98/comconsole.c b/sys/boot/pc98/libpc98/comconsole.c index 825de8f..e2128a2 100644 --- a/sys/boot/pc98/libpc98/comconsole.c +++ b/sys/boot/pc98/libpc98/comconsole.c @@ -50,7 +50,6 @@ static int comc_init(int arg); static void comc_putchar(int c); static int comc_getchar(void); static int comc_getspeed(void); -static void set_hw_console_hint(void); static int comc_ischar(void); static int comc_parseint(const char *string); static uint32_t comc_parse_pcidev(const char *string); @@ -202,27 +201,14 @@ comc_port_set(struct env_var *ev, int flags, const void *value) } if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && - comc_port != port) { + comc_port != port) comc_setup(comc_curspeed, port); - set_hw_console_hint(); - } env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); return (CMD_OK); } -static void -set_hw_console_hint(void) -{ - char intbuf[64]; - - unsetenv("hw.uart.console"); - sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); - env_setenv("hw.uart.console", EV_VOLATILE, intbuf, - env_noset, env_nounset); -} - /* * Input: bus:dev:func[:bar]. If bar is not specified, it is 0x10. * Output: bar[24:16] bus[15:8] dev[7:3] func[2:0] @@ -288,7 +274,6 @@ comc_pcidev_handle(uint32_t locator) comc_port_set, env_nounset); comc_setup(comc_curspeed, port); - set_hw_console_hint(); comc_locator = locator; return (CMD_OK); @@ -318,8 +303,10 @@ static void comc_setup(int speed, int port) { static int TRY_COUNT = 1000000; + char intbuf[64]; int tries; + unsetenv("hw.uart.console"); comc_curspeed = speed; comc_port = port; @@ -334,9 +321,11 @@ comc_setup(int speed, int port) inb(comc_port + com_data); while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); - if (tries < TRY_COUNT) + if (tries < TRY_COUNT) { comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); - else + sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); + env_setenv("hw.uart.console", EV_VOLATILE, intbuf, NULL, NULL); + } else comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); } |