diff options
author | bde <bde@FreeBSD.org> | 1995-10-22 15:38:08 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-10-22 15:38:08 +0000 |
commit | 2b02753359669b49ee92eeb7a287b8155864a203 (patch) | |
tree | 4c232c41290a8cd7ee09ceaad43f04b760e44d13 /sys/dev/cy | |
parent | 2f9bb19585533ae771443ea1c65fc20318aaff60 (diff) | |
download | FreeBSD-src-2b02753359669b49ee92eeb7a287b8155864a203.zip FreeBSD-src-2b02753359669b49ee92eeb7a287b8155864a203.tar.gz |
sio.c:
Fix the tests for being a console by reverting to the ones that
were used before the the RB_SERIAL changes. RB_SERIAL only needs
to be tested in one place. The initialization of comconsole was
wrong before the RB_SERIAL changes for the COMCONSOLE case. This
may have been the cause of the unnecessary changes.
Start eliminating #includes of <i386/i386/cons.h>. This header is
supposed to be included from <machine> although it should be
completely machine-independent and included from <sys>.
Remove a wrong XXX comment. `comconsole' is used to test for being
a console and even the tests for deciding the default termios state
are necessary (the semi-reentrant i/o routines don't handle ordinary
device i/o).
cy.c:
Sync with sio.c. The console tests are present but always fail.
Diffstat (limited to 'sys/dev/cy')
-rw-r--r-- | sys/dev/cy/cy.c | 25 | ||||
-rw-r--r-- | sys/dev/cy/cy_isa.c | 25 |
2 files changed, 12 insertions, 38 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index ac0a16f..0ac16d6 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/cy.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.14 1995/07/31 18:29:48 bde Exp $ + * $Id: cy.c,v 1.15 1995/10/11 02:41:13 davidg Exp $ */ #include "cy.h" @@ -374,18 +374,7 @@ struct isa_driver siodriver = { sioprobe, sioattach, "cy" }; -#ifdef COMCONSOLE -#undef COMCONSOLE -#define COMCONSOLE 1 -#else -#define COMCONSOLE 0 -#endif - -#ifndef CONUNIT -#define CONUNIT (0) -#endif - -static int comconsole = CONUNIT; +static int comconsole = -1; static speed_t comdefaultrate = TTYDEF_SPEED; static u_int com_events; /* input chars + weighted output completions */ static int commajor; @@ -565,7 +554,7 @@ sioattach(isdp) com->it_in.c_oflag = 0; com->it_in.c_cflag = TTYDEF_CFLAG; com->it_in.c_lflag = 0; - if (unit == comconsole && (COMCONSOLE || boothowto & RB_SERIAL)) { + if (unit == comconsole) { com->it_in.c_iflag = TTYDEF_IFLAG; com->it_in.c_oflag = TTYDEF_OFLAG; com->it_in.c_cflag = TTYDEF_CFLAG | CLOCAL; @@ -897,8 +886,7 @@ comhardclose(com) com->active_out = FALSE; wakeup(&com->active_out); wakeup(TSA_CARR_ON(tp)); /* restart any wopeners */ - if (!(com->state & CS_DTR_OFF) - && !(unit == comconsole && (COMCONSOLE || boothowto & RB_SERIAL))) + if (!(com->state & CS_DTR_OFF) && unit != comconsole) com->kdc.kdc_state = DC_IDLE; splx(s); } @@ -941,8 +929,7 @@ siowrite(dev, uio, flag) * is not the console. In that situation we don't need/want the X * server taking over the console. */ - if (constty && unit == comconsole - && (COMCONSOLE || boothowto & RB_SERIAL)) + if (constty != NULL && unit == comconsole) constty = NULL; #ifdef Smarts /* XXX duplicate ttwrite(), but without so much output processing on @@ -962,7 +949,7 @@ siodtrwakeup(chan) com = (struct com_s *)chan; com->state &= ~CS_DTR_OFF; - if (!(com->unit == comconsole && (COMCONSOLE || boothowto & RB_SERIAL))) + if (com->unit != comconsole) com->kdc.kdc_state = DC_IDLE; wakeup(&com->dtr_wait); } diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c index ac0a16f..0ac16d6 100644 --- a/sys/dev/cy/cy_isa.c +++ b/sys/dev/cy/cy_isa.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.14 1995/07/31 18:29:48 bde Exp $ + * $Id: cy.c,v 1.15 1995/10/11 02:41:13 davidg Exp $ */ #include "cy.h" @@ -374,18 +374,7 @@ struct isa_driver siodriver = { sioprobe, sioattach, "cy" }; -#ifdef COMCONSOLE -#undef COMCONSOLE -#define COMCONSOLE 1 -#else -#define COMCONSOLE 0 -#endif - -#ifndef CONUNIT -#define CONUNIT (0) -#endif - -static int comconsole = CONUNIT; +static int comconsole = -1; static speed_t comdefaultrate = TTYDEF_SPEED; static u_int com_events; /* input chars + weighted output completions */ static int commajor; @@ -565,7 +554,7 @@ sioattach(isdp) com->it_in.c_oflag = 0; com->it_in.c_cflag = TTYDEF_CFLAG; com->it_in.c_lflag = 0; - if (unit == comconsole && (COMCONSOLE || boothowto & RB_SERIAL)) { + if (unit == comconsole) { com->it_in.c_iflag = TTYDEF_IFLAG; com->it_in.c_oflag = TTYDEF_OFLAG; com->it_in.c_cflag = TTYDEF_CFLAG | CLOCAL; @@ -897,8 +886,7 @@ comhardclose(com) com->active_out = FALSE; wakeup(&com->active_out); wakeup(TSA_CARR_ON(tp)); /* restart any wopeners */ - if (!(com->state & CS_DTR_OFF) - && !(unit == comconsole && (COMCONSOLE || boothowto & RB_SERIAL))) + if (!(com->state & CS_DTR_OFF) && unit != comconsole) com->kdc.kdc_state = DC_IDLE; splx(s); } @@ -941,8 +929,7 @@ siowrite(dev, uio, flag) * is not the console. In that situation we don't need/want the X * server taking over the console. */ - if (constty && unit == comconsole - && (COMCONSOLE || boothowto & RB_SERIAL)) + if (constty != NULL && unit == comconsole) constty = NULL; #ifdef Smarts /* XXX duplicate ttwrite(), but without so much output processing on @@ -962,7 +949,7 @@ siodtrwakeup(chan) com = (struct com_s *)chan; com->state &= ~CS_DTR_OFF; - if (!(com->unit == comconsole && (COMCONSOLE || boothowto & RB_SERIAL))) + if (com->unit != comconsole) com->kdc.kdc_state = DC_IDLE; wakeup(&com->dtr_wait); } |