From owner-p4-projects@FreeBSD.ORG Thu Jun 29 03:01:01 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 100EE16A412; Thu, 29 Jun 2006 03:01:01 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E07DB16A40F for ; Thu, 29 Jun 2006 03:01:00 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 535FD43E0E for ; Thu, 29 Jun 2006 03:01:00 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5T310AU094208 for ; Thu, 29 Jun 2006 03:01:00 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5T310dD094199 for perforce@freebsd.org; Thu, 29 Jun 2006 03:01:00 GMT (envelope-from kmacy@freebsd.org) Date: Thu, 29 Jun 2006 03:01:00 GMT Message-Id: <200606290301.k5T310dD094199@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 100249 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2006 03:01:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=100249 Change 100249 by kmacy@kmacy_storage:sun4v_work_stable on 2006/06/29 03:00:01 integrate console and DMA tag fixes Affected files ... .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/bge/if_bge.c#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/hcall.S#2 integrate .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/hvcons.c#2 integrate Differences ... ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/bge/if_bge.c#2 (text+ko) ==== @@ -1726,7 +1726,7 @@ /* * Allocate the parent bus DMA tag appropriate for PCI. */ - error = bus_dma_tag_create(NULL, /* parent */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev),/* parent */ PAGE_SIZE, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/hcall.S#2 (text+ko) ==== @@ -402,9 +402,8 @@ ENTRY(hv_cnputchar) mov CONS_WRITE, %o5 ta FAST_TRAP - tst %o0 retl - movnz %xcc, -1, %o0 + nop SET_SIZE(hv_cnputchar) /* ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/hvcons.c#2 (text+ko) ==== @@ -46,7 +46,7 @@ #include #include -#define HVCN_POLL_FREQ 4 +#define HVCN_POLL_FREQ 10 static d_open_t hvcn_open; @@ -60,10 +60,14 @@ .d_flags = D_TTY | D_NEEDGIANT, }; +#define PCBURST 16 static struct tty *hvcn_tp = NULL; static struct resource *hvcn_irq; static void *hvcn_intrhand; +static int bufindex; +static int buflen; +static u_char buf[PCBURST]; static int polltime; static struct callout_handle hvcn_timeouthandle = CALLOUT_HANDLE_INITIALIZER(&hvcn_timeouthandle); @@ -243,7 +247,6 @@ int error; error = 0; - do { if (c == '\n') error = hv_cnputchar('\r'); @@ -266,21 +269,26 @@ static void hvcn_tty_start(struct tty *tp) { - int error; - - if (tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP)) { - ttwwakeup(tp); - return; - } - tp->t_state |= TS_BUSY; - error = 0; - while (tp->t_outq.c_cc != 0 && error != H_EWOULDBLOCK) - error = hv_cnputchar(getc(&tp->t_outq)); + if (!(tp->t_state & (TS_TIMEOUT | TS_BUSY | TS_TTSTOP))) { + tp->t_state |= TS_BUSY; - tp->t_state &= ~TS_BUSY; - - ttwwakeup(tp); + do { + if (buflen == 0) { + buflen = q_to_b(&tp->t_outq, buf, PCBURST); + bufindex = 0; + } + while (buflen) { + if (hv_cnputchar(buf[bufindex]) == H_EWOULDBLOCK) + goto done; + bufindex++; + buflen--; + } + } while (tp->t_outq.c_cc != 0); + done: + tp->t_state &= ~TS_BUSY; + ttwwakeup(tp); + } } static void @@ -303,8 +311,9 @@ while ((c = hvcncheckc(NULL)) != -1) if (tp->t_state & TS_ISOPEN) ttyld_rint(tp, c); - + if (tp->t_outq.c_cc != 0 || buflen != 0) + hvcn_tty_start(tp); } static void