summaryrefslogtreecommitdiffstats
path: root/sys/dev/cy
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2001-08-13 07:00:21 +0000
committerbde <bde@FreeBSD.org>2001-08-13 07:00:21 +0000
commit91054a15a01c58988d11094d93f2bc02adc96001 (patch)
treef556690158d7c28742b1078af47040a1013bd9f6 /sys/dev/cy
parent24fb11b75c2fb56a4793d795e37287e57f5676b7 (diff)
downloadFreeBSD-src-91054a15a01c58988d11094d93f2bc02adc96001.zip
FreeBSD-src-91054a15a01c58988d11094d93f2bc02adc96001.tar.gz
Use ttymalloc() instead of a static array of `struct tty'. This will
be a regression until `pstat -t' actually understands the results of ttymalloc(). Submitted by: mostly by yokota
Diffstat (limited to 'sys/dev/cy')
-rw-r--r--sys/dev/cy/cy.c17
-rw-r--r--sys/dev/cy/cy_isa.c17
2 files changed, 4 insertions, 30 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index c6fd06c..52d9fc4 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -137,7 +137,6 @@ extern struct mtx com_mtx;
#define comspeed cyspeed
#define comstart cystart
#define comwakeup cywakeup
-#define nsio_tty ncy_tty
#define p_com_addr p_cy_addr
#define sioattach cyattach
#define sioclose cyclose
@@ -159,7 +158,6 @@ extern struct mtx com_mtx;
#define sio_timeout cy_timeout
#define sio_timeout_handle cy_timeout_handle
#define sio_timeouts_until_log cy_timeouts_until_log
-#define sio_tty cy_tty
#define CY_MAX_PORTS (CD1400_NO_OF_CHANNELS * CY_MAX_CD1400s)
@@ -418,12 +416,6 @@ static int sio_timeout;
static int sio_timeouts_until_log;
static struct callout_handle sio_timeout_handle
= CALLOUT_HANDLE_INITIALIZER(&sio_timeout_handle);
-#if 0 /* XXX */
-static struct tty *sio_tty[NSIO];
-#else
-static struct tty sio_tty[NSIO];
-#endif
-static const int nsio_tty = NSIO;
#ifdef CyDebug
static u_int cd_inbs;
@@ -681,12 +673,7 @@ sioopen(dev, flag, mode, p)
return (ENXIO);
if (mynor & CONTROL_MASK)
return (0);
-#if 0 /* XXX */
- tp = com->tp = sio_tty[unit] = ttymalloc(sio_tty[unit]);
-#else
- tp = com->tp = &sio_tty[unit];
-#endif
- dev->si_tty = tp;
+ tp = dev->si_tty = com->tp = ttymalloc(com->tp);
s = spltty();
/*
* We jump to this label after all non-interrupted sleeps to pick
@@ -878,7 +865,7 @@ sioclose(dev, flag, mode, p)
splx(s);
#ifdef broken /* session holds a ref to the tty; can't deallocate */
ttyfree(tp);
- com->tp = sio_tty[unit] = NULL;
+ com->tp = NULL;
#endif
return (0);
}
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index c6fd06c..52d9fc4 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -137,7 +137,6 @@ extern struct mtx com_mtx;
#define comspeed cyspeed
#define comstart cystart
#define comwakeup cywakeup
-#define nsio_tty ncy_tty
#define p_com_addr p_cy_addr
#define sioattach cyattach
#define sioclose cyclose
@@ -159,7 +158,6 @@ extern struct mtx com_mtx;
#define sio_timeout cy_timeout
#define sio_timeout_handle cy_timeout_handle
#define sio_timeouts_until_log cy_timeouts_until_log
-#define sio_tty cy_tty
#define CY_MAX_PORTS (CD1400_NO_OF_CHANNELS * CY_MAX_CD1400s)
@@ -418,12 +416,6 @@ static int sio_timeout;
static int sio_timeouts_until_log;
static struct callout_handle sio_timeout_handle
= CALLOUT_HANDLE_INITIALIZER(&sio_timeout_handle);
-#if 0 /* XXX */
-static struct tty *sio_tty[NSIO];
-#else
-static struct tty sio_tty[NSIO];
-#endif
-static const int nsio_tty = NSIO;
#ifdef CyDebug
static u_int cd_inbs;
@@ -681,12 +673,7 @@ sioopen(dev, flag, mode, p)
return (ENXIO);
if (mynor & CONTROL_MASK)
return (0);
-#if 0 /* XXX */
- tp = com->tp = sio_tty[unit] = ttymalloc(sio_tty[unit]);
-#else
- tp = com->tp = &sio_tty[unit];
-#endif
- dev->si_tty = tp;
+ tp = dev->si_tty = com->tp = ttymalloc(com->tp);
s = spltty();
/*
* We jump to this label after all non-interrupted sleeps to pick
@@ -878,7 +865,7 @@ sioclose(dev, flag, mode, p)
splx(s);
#ifdef broken /* session holds a ref to the tty; can't deallocate */
ttyfree(tp);
- com->tp = sio_tty[unit] = NULL;
+ com->tp = NULL;
#endif
return (0);
}
OpenPOWER on IntegriCloud