From 9b9cce608499ac2fe9ab25c91d519d1dadb4c35b Mon Sep 17 00:00:00 2001 From: mycroft Date: Mon, 3 Nov 1997 06:55:54 +0000 Subject: [PATCH] Mostly cosmetic and performance changes: * Make the ring buffer size and water marks patchable, and allocate the buffer separately. * Do the ttymalloc() at attach time. * Reorganize the receive buffer so the status and data pair are next to each other. This is slightly faster. * Make sure we actually do turn off interrupts in comclose() if we have DDB configured and it's not the console. (D'oh!!!!) * When we exhaust the current transmit run, turn off transmit interrupts in comintr(), so we're fairly sure we don't get another one. * Nuke the silly lsrmap[] idea; it's slower in the normal case. * Cache the l_rint pointer in the soft interrupt routine. --- sys/dev/ic/comvar.h | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/sys/dev/ic/comvar.h b/sys/dev/ic/comvar.h index 6f58493906d6..7228053def39 100644 --- a/sys/dev/ic/comvar.h +++ b/sys/dev/ic/comvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: comvar.h,v 1.18 1997/10/19 14:26:23 fvdl Exp $ */ +/* $NetBSD: comvar.h,v 1.19 1997/11/03 06:55:54 mycroft Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -52,20 +52,13 @@ int com_is_console __P((bus_space_tag_t, int, bus_space_handle_t *)); #define COM_HW_KGDB 0x80 /* Buffer size for character buffer */ -#define RXBUFSIZE 2048 /* More than enough.. */ -#define RXBUFMASK (RXBUFSIZE - 1) /* Only iff previous is a power of 2 */ -#define RXHIWAT ((RXBUFSIZE * 1) / 4) -#define RXLOWAT ((RXBUFSIZE * 3) / 4) +#define COM_RING_SIZE 2048 struct com_softc { struct device sc_dev; void *sc_si; struct tty *sc_tty; - int sc_overflows; - int sc_floods; - int sc_errors; - int sc_iobase; /* XXX ISA-centric name */ int sc_frequency; @@ -73,25 +66,25 @@ struct com_softc { bus_space_handle_t sc_ioh; bus_space_handle_t sc_hayespioh; - u_char sc_hwflags; - u_char sc_swflags; - int sc_fifolen; + u_int sc_overflows, + sc_floods, + sc_errors; - u_char sc_msr, sc_msr_delta, sc_msr_mask, sc_mcr, sc_mcr_active, sc_lcr, - sc_ier, sc_fifo, sc_dlbl, sc_dlbh, sc_efr; - u_char sc_mcr_dtr, sc_mcr_rts, sc_msr_cts, sc_msr_dcd; + int sc_hwflags, + sc_swflags; + u_int sc_fifolen; - int sc_r_hiwat; - int sc_r_lowat; - volatile u_int sc_rbget; - volatile u_int sc_rbput; - volatile u_int sc_rbavail; - u_char sc_rbuf[RXBUFSIZE]; - u_char sc_lbuf[RXBUFSIZE]; + u_int sc_r_hiwat, + sc_r_lowat; + u_char *volatile sc_rbget, + *volatile sc_rbput; + volatile u_int sc_rbavail; + u_char *sc_rbuf, + *sc_ebuf; u_char *sc_tba; - int sc_tbc, - sc_heldtbc; + u_int sc_tbc, + sc_heldtbc; volatile u_char sc_rx_flags, #define RX_TTY_BLOCKED 0x01 @@ -106,6 +99,10 @@ struct com_softc { sc_rx_ready; volatile u_char sc_heldchange; + volatile u_char sc_msr, sc_msr_delta, sc_msr_mask, sc_mcr, + sc_mcr_active, sc_lcr, sc_ier, sc_fifo, sc_dlbl, sc_dlbh, sc_efr; + u_char sc_mcr_dtr, sc_mcr_rts, sc_msr_cts, sc_msr_dcd; + #if NRND > 0 && defined(RND_COM) rndsource_element_t rnd_source; #endif