From owner-svn-src-projects@FreeBSD.ORG Tue Jul 10 00:31:06 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A524B106564A; Tue, 10 Jul 2012 00:31:06 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FAA48FC15; Tue, 10 Jul 2012 00:31:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6A0V6bL048834; Tue, 10 Jul 2012 00:31:06 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6A0V6fc048832; Tue, 10 Jul 2012 00:31:06 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201207100031.q6A0V6fc048832@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 10 Jul 2012 00:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238321 - projects/altix2/sys/ia64/sgisn X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 00:31:06 -0000 Author: marcel Date: Tue Jul 10 00:31:06 2012 New Revision: 238321 URL: http://svn.freebsd.org/changeset/base/238321 Log: o Match the low-level console name to the device name. o Remove the SWI handler. It's not used nor needed. o Implement the tsw_outwakeup function. This now works for userspace as well. Modified: projects/altix2/sys/ia64/sgisn/sgisn_console.c Modified: projects/altix2/sys/ia64/sgisn/sgisn_console.c ============================================================================== --- projects/altix2/sys/ia64/sgisn/sgisn_console.c Tue Jul 10 00:23:25 2012 (r238320) +++ projects/altix2/sys/ia64/sgisn/sgisn_console.c Tue Jul 10 00:31:06 2012 (r238321) @@ -48,7 +48,6 @@ struct sncon_softc { struct tty *sc_tp; struct resource *sc_ires; void *sc_icookie; - void *sc_softih; int sc_irid; int sc_altbrk; }; @@ -104,7 +103,7 @@ sncon_cnprobe(struct consdev *cp) if (r.sal_status != 0) return; - strcpy(cp->cn_name, "sncon0"); + strcpy(cp->cn_name, "ttys0"); cp->cn_pri = CN_INTERNAL; } @@ -168,19 +167,13 @@ sncon_tty_free(void *arg) static void sncon_tty_inwakeup(struct tty *tp) { - struct sncon_softc *sc; - - sc = tty_softc(tp); - /* - * Re-start reception. - */ } static int sncon_tty_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) { - return (ENOTTY); + return (ENOIOCTL); } static int @@ -200,12 +193,17 @@ sncon_tty_open(struct tty *tp) static void sncon_tty_outwakeup(struct tty *tp) { - struct sncon_softc *sc; + char buf[80]; + struct ia64_sal_result r; + size_t len; - sc = tty_softc(tp); - /* - * Re-start transmission. - */ + while (1) { + len = ttydisc_getc(tp, buf, sizeof(buf)); + if (len == 0) + break; + r = ia64_sal_entry(SAL_SGISN_TXBUF, (uintptr_t)buf, len, + 0, 0, 0, 0, 0); + } } static int @@ -247,13 +245,16 @@ static void sncon_rx_intr(void *arg) { struct sncon_softc *sc = arg; + struct tty *tp = sc->sc_tp; struct ia64_sal_result r; - struct tty *tp; int ch, count; +#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) + int kdb; +#endif - count = 0; - tp = sc->sc_tp; tty_lock(tp); + + count = 0; do { r = ia64_sal_entry(SAL_SGISN_POLL, 0, 0, 0, 0, 0, 0, 0); if (r.sal_status || r.sal_result[0] == 0) @@ -266,24 +267,21 @@ sncon_rx_intr(void *arg) ch = r.sal_result[0]; #if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) - do { - int kdb; - kdb = kdb_alt_break(ch, &sc->sc_altbrk); - if (kdb != 0) { - switch (kdb) { - case KDB_REQ_DEBUGGER: - kdb_enter(KDB_WHY_BREAK, - "Break sequence on console"); - break; - case KDB_REQ_PANIC: - kdb_panic("Panic sequence on console"); - break; - case KDB_REQ_REBOOT: - kdb_reboot(); - break; - } + kdb = kdb_alt_break(ch, &sc->sc_altbrk); + if (kdb != 0) { + switch (kdb) { + case KDB_REQ_DEBUGGER: + kdb_enter(KDB_WHY_BREAK, + "Break sequence on console"); + break; + case KDB_REQ_PANIC: + kdb_panic("Panic sequence on console"); + break; + case KDB_REQ_REBOOT: + kdb_reboot(); + break; } - } while (0); + } #endif ttydisc_rint(tp, ch, 0); @@ -294,11 +292,6 @@ sncon_rx_intr(void *arg) tty_unlock(tp); } -static void -sncon_tx_intr(void *arg) -{ -} - static int sncon_attach(device_t dev) { @@ -331,9 +324,6 @@ sncon_attach(device_t dev) r = ia64_sal_entry(SAL_SGISN_CON_INTR, 2, (sc->sc_ires != NULL) ? 1 : 0, 0, 0, 0, 0, 0); - swi_add(&tty_intr_event, sncon_name, sncon_tx_intr, sc, SWI_TTY, - INTR_TYPE_TTY, &sc->sc_softih); - sc->sc_tp = tty_alloc(&sncon_tty_class, sc); if (sncon_is_console) tty_init_console(sc->sc_tp, 0); @@ -352,7 +342,6 @@ sncon_detach(device_t dev) tp = sc->sc_tp; tty_lock(tp); - swi_remove(sc->sc_softih); tty_rel_gone(tp); if (sc->sc_ires != NULL) {