From owner-svn-src-projects@FreeBSD.ORG Mon Nov 11 06:22:30 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B2A09EC5; Mon, 11 Nov 2013 06:22:30 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FD3E2CB4; Mon, 11 Nov 2013 06:22:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAB6MU47014964; Mon, 11 Nov 2013 06:22:30 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAB6MU5x014962; Mon, 11 Nov 2013 06:22:30 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201311110622.rAB6MU5x014962@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 11 Nov 2013 06:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r257944 - in projects/altix2/sys/ia64: include sgisn X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 11 Nov 2013 06:22:30 -0000 Author: marcel Date: Mon Nov 11 06:22:29 2013 New Revision: 257944 URL: http://svnweb.freebsd.org/changeset/base/257944 Log: Fix the L1 console, broken for the Altix 450. Using POLL and GETC apparently does return any characters. Special SAL calls exists for when the console is asynchronous. Replace the poll call with getting the interrupt status and replace the getc call with an interrupt read. It is not known if this change breaks the Altix 350, but it is assumed that it will not harm. testing will tell us... Modified: projects/altix2/sys/ia64/include/sgisn.h projects/altix2/sys/ia64/sgisn/sgisn_console.c Modified: projects/altix2/sys/ia64/include/sgisn.h ============================================================================== --- projects/altix2/sys/ia64/include/sgisn.h Mon Nov 11 05:39:42 2013 (r257943) +++ projects/altix2/sys/ia64/include/sgisn.h Mon Nov 11 06:22:29 2013 (r257944) @@ -38,6 +38,7 @@ #define SAL_SGISN_POLL 0x02000026 #define SAL_SGISN_CON_INTR 0x02000027 #define SAL_SGISN_TXBUF 0x02000028 +#define SAL_SGISN_CON_IREAD 0x0200002b #define SAL_SGISN_IOHUB_INFO 0x02000055 #define SAL_SGISN_IOBUS_INFO 0x02000056 #define SAL_SGISN_IODEV_INFO 0x02000057 Modified: projects/altix2/sys/ia64/sgisn/sgisn_console.c ============================================================================== --- projects/altix2/sys/ia64/sgisn/sgisn_console.c Mon Nov 11 05:39:42 2013 (r257943) +++ projects/altix2/sys/ia64/sgisn/sgisn_console.c Mon Nov 11 06:22:29 2013 (r257944) @@ -247,23 +247,21 @@ sncon_rx_intr(void *arg) struct sncon_softc *sc = arg; struct tty *tp = sc->sc_tp; struct ia64_sal_result r; - int ch, count; + int ch, cnt; #if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) int kdb; #endif 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) - break; - - r = ia64_sal_entry(SAL_SGISN_GETC, 0, 0, 0, 0, 0, 0, 0); - if (r.sal_status != 0) + cnt = 0; + r = ia64_sal_entry(SAL_SGISN_CON_INTR, 0, 2 /* status */, + 0, 0, 0, 0, 0); + while (cnt < 128 && r.sal_status == 0 && (r.sal_result[0] & 2) == 2) { + r.sal_result[0] = ~0UL; + r = ia64_sal_entry(SAL_SGISN_CON_IREAD, 0, 0, 0, 0, 0, 0, 0); + if (r.sal_result[0] == ~0UL) break; - ch = r.sal_result[0]; #if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) @@ -285,9 +283,11 @@ sncon_rx_intr(void *arg) #endif ttydisc_rint(tp, ch, 0); - count++; - } while (count < 128); - if (count > 0) + cnt++; + r = ia64_sal_entry(SAL_SGISN_CON_INTR, 0, 2 /* status */, + 0, 0, 0, 0, 0); + } + if (cnt > 0) ttydisc_rint_done(tp); tty_unlock(tp); } @@ -321,8 +321,8 @@ sncon_attach(device_t dev) } while (0); /* Enable or disable RX interrupts appropriately. */ - r = ia64_sal_entry(SAL_SGISN_CON_INTR, 2, - (sc->sc_ires != NULL) ? 1 : 0, 0, 0, 0, 0, 0); + r = ia64_sal_entry(SAL_SGISN_CON_INTR, 2 /* recv */, + (sc->sc_ires != NULL) ? 1 : 0 /* on/off */, 0, 0, 0, 0, 0); sc->sc_tp = tty_alloc(&sncon_tty_class, sc); if (sncon_is_console) @@ -346,7 +346,8 @@ sncon_detach(device_t dev) if (sc->sc_ires != NULL) { /* Disable RX interrupts. */ - r = ia64_sal_entry(SAL_SGISN_CON_INTR, 2, 0, 0, 0, 0, 0, 0); + r = ia64_sal_entry(SAL_SGISN_CON_INTR, 2 /* recv */, + 0 /* off */, 0, 0, 0, 0, 0); bus_teardown_intr(dev, sc->sc_ires, sc->sc_icookie); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irid,