Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Provide locking required by the interrupt handlers runni...
details: https://anonhg.NetBSD.org/src/rev/2a4f1f1d5405
branches: trunk
changeset: 542420:2a4f1f1d5405
user: pk <pk%NetBSD.org@localhost>
date: Tue Jan 28 12:35:31 2003 +0000
description:
Provide locking required by the interrupt handlers running at IPL_SERIAL.
diffstat:
sys/arch/cesfic/dev/zs.c | 3 +-
sys/arch/mac68k/dev/zs.c | 3 +-
sys/arch/macppc/dev/zs.c | 3 +-
sys/arch/mipsco/obio/zs.c | 3 +-
sys/arch/mvme68k/dev/zs.c | 3 +-
sys/arch/news68k/dev/zs.c | 4 +-
sys/arch/newsmips/apbus/zs_ap.c | 3 +-
sys/arch/newsmips/dev/zs_hb.c | 3 +-
sys/arch/next68k/dev/zs.c | 3 +-
sys/arch/sgimips/dev/zs.c | 3 +-
sys/arch/sparc/dev/zs.c | 3 +-
sys/arch/sparc64/dev/zs.c | 3 +-
sys/arch/sun2/dev/zs.c | 3 +-
sys/arch/sun3/dev/zs.c | 3 +-
sys/arch/x68k/dev/zs.c | 3 +-
sys/dev/ic/z8530sc.c | 13 ++++-
sys/dev/ic/z8530sc.h | 4 +-
sys/dev/ic/z8530tty.c | 100 +++++++++++++++++++++++++--------------
18 files changed, 109 insertions(+), 54 deletions(-)
diffs (truncated from 669 to 300 lines):
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/cesfic/dev/zs.c
--- a/sys/arch/cesfic/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/cesfic/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.5 2003/01/01 01:26:40 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.6 2003/01/28 12:35:31 pk Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -141,6 +141,7 @@
cs->cs_defspeed = 9600;
}
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_defcflag = CREAD | CS8 | HUPCL;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/mac68k/dev/zs.c
--- a/sys/arch/mac68k/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/mac68k/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.41 2003/01/06 13:05:02 wiz Exp $ */
+/* $NetBSD: zs.c,v 1.42 2003/01/28 12:35:32 pk Exp $ */
/*
* Copyright (c) 1996-1998 Bill Studenmund
@@ -284,6 +284,7 @@
cs = &xcs->xzs_cs;
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/macppc/dev/zs.c
--- a/sys/arch/macppc/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/macppc/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.24 2003/01/01 01:47:30 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.25 2003/01/28 12:35:32 pk Exp $ */
/*
* Copyright (c) 1996, 1998 Bill Studenmund
@@ -269,6 +269,7 @@
cs = &xcs->xzs_cs;
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/mipsco/obio/zs.c
--- a/sys/arch/mipsco/obio/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/mipsco/obio/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.15 2003/01/01 01:49:56 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.16 2003/01/28 12:35:32 pk Exp $ */
/*-
* Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -232,6 +232,7 @@
ch = &zsc->zsc_cs_store[channel];
cs = zsc->zsc_cs[channel] = (struct zs_chanstate *)ch;
+ simple_lock_init(&cs->cs_lock);
cs->cs_reg_csr = NULL;
cs->cs_reg_data = NULL;
cs->cs_channel = channel;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/mvme68k/dev/zs.c
--- a/sys/arch/mvme68k/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/mvme68k/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.30 2003/01/01 01:51:24 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.31 2003/01/28 12:35:33 pk Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -151,6 +151,7 @@
zsc_args.hwflags = zs_hwflags[zsc_unit][channel];
cs = &zsc->zsc_cs_store[channel];
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
/*
* If we're the console, copy the channel state, and
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/news68k/dev/zs.c
--- a/sys/arch/news68k/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/news68k/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.12 2003/01/11 16:00:48 tsutsui Exp $ */
+/* $NetBSD: zs.c,v 1.13 2003/01/28 12:35:33 pk Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -215,6 +215,8 @@
for (channel = 0; channel < 2; channel++) {
zsc_args.channel = channel;
cs = &zsc->zsc_cs_store[channel];
+ simple_lock_init(&cs->cs_lock);
+
zsc->zsc_cs[channel] = cs;
zc = (channel == 0) ? &zs->zs_chan_a : &zs->zs_chan_b;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/newsmips/apbus/zs_ap.c
--- a/sys/arch/newsmips/apbus/zs_ap.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/newsmips/apbus/zs_ap.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs_ap.c,v 1.8 2002/10/02 04:27:51 thorpej Exp $ */
+/* $NetBSD: zs_ap.c,v 1.9 2003/01/28 12:35:34 pk Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -255,6 +255,7 @@
cs = &zsc->zsc_cs_store[channel];
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/newsmips/dev/zs_hb.c
--- a/sys/arch/newsmips/dev/zs_hb.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/newsmips/dev/zs_hb.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs_hb.c,v 1.7 2002/10/02 04:27:52 thorpej Exp $ */
+/* $NetBSD: zs_hb.c,v 1.8 2003/01/28 12:35:34 pk Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -237,6 +237,7 @@
cs = &zsc->zsc_cs_store[channel];
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/next68k/dev/zs.c
--- a/sys/arch/next68k/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/next68k/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.21 2003/01/01 01:57:16 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.22 2003/01/28 12:35:35 pk Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -240,6 +240,7 @@
cs = &zsc->zsc_cs_store[channel];
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/sgimips/dev/zs.c
--- a/sys/arch/sgimips/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/sgimips/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.17 2003/01/01 02:10:08 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.18 2003/01/28 12:35:35 pk Exp $ */
/*-
* Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -244,6 +244,7 @@
ch = &zsc->zsc_cs_store[channel];
cs = zsc->zsc_cs[channel] = (struct zs_chanstate *)ch;
+ simple_lock_init(&cs->cs_lock);
cs->cs_reg_csr = NULL;
cs->cs_reg_data = NULL;
cs->cs_channel = channel;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/sparc/dev/zs.c
--- a/sys/arch/sparc/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/sparc/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.96 2003/01/22 22:00:39 pk Exp $ */
+/* $NetBSD: zs.c,v 1.97 2003/01/28 12:35:35 pk Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -445,6 +445,7 @@
cs = &zsc->zsc_cs_store[channel];
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/sparc64/dev/zs.c
--- a/sys/arch/sparc64/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/sparc64/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.45 2003/01/01 02:22:56 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.46 2003/01/28 12:35:36 pk Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -292,6 +292,7 @@
cs = &zsc->zsc_cs_store[channel];
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/sun2/dev/zs.c
--- a/sys/arch/sun2/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/sun2/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.6 2003/01/01 02:23:45 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.7 2003/01/28 12:35:37 pk Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -177,6 +177,7 @@
cs = &zsc->zsc_cs_store[channel];
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/sun3/dev/zs.c
--- a/sys/arch/sun3/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/sun3/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.70 2003/01/01 02:26:13 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.71 2003/01/28 12:35:37 pk Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -287,6 +287,7 @@
cs = &zsc->zsc_cs_store[channel];
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/arch/x68k/dev/zs.c
--- a/sys/arch/x68k/dev/zs.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/arch/x68k/dev/zs.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.23 2003/01/01 02:31:14 thorpej Exp $ */
+/* $NetBSD: zs.c,v 1.24 2003/01/28 12:35:38 pk Exp $ */
/*-
* Copyright (c) 1998 Minoura Makoto
@@ -211,6 +211,7 @@
cs = &zsc->zsc_cs_store[channel];
zsc->zsc_cs[channel] = cs;
+ simple_lock_init(&cs->cs_lock);
cs->cs_channel = channel;
cs->cs_private = NULL;
cs->cs_ops = &zsops_null;
diff -r f93f51f5f7e2 -r 2a4f1f1d5405 sys/dev/ic/z8530sc.c
--- a/sys/dev/ic/z8530sc.c Tue Jan 28 12:05:00 2003 +0000
+++ b/sys/dev/ic/z8530sc.c Tue Jan 28 12:35:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: z8530sc.c,v 1.17 2002/09/24 13:23:31 ad Exp $ */
+/* $NetBSD: z8530sc.c,v 1.18 2003/01/28 12:35:39 pk Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -53,7 +53,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: z8530sc.c,v 1.17 2002/09/24 13:23:31 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: z8530sc.c,v 1.18 2003/01/28 12:35:39 pk Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -255,6 +255,10 @@
/* First look at channel A. */
cs = zsc->zsc_cs[0];
+
+ /* Lock both channels */
+ simple_lock(&cs->cs_lock);
+ simple_lock(&zsc->zsc_cs[1]->cs_lock);
/* Note: only channel A has an RR3 */
rr3 = zs_read_reg(cs, 3);
@@ -276,6 +280,9 @@
(*cs->cs_ops->zsop_txint)(cs);
}
+ /* Done with channel A */
+ simple_unlock(&cs->cs_lock);
+
/* Now look at channel B. */
cs = zsc->zsc_cs[1];
if (rr3 & (ZSRR3_IP_B_RX | ZSRR3_IP_B_TX | ZSRR3_IP_B_STAT)) {
@@ -288,6 +295,8 @@
(*cs->cs_ops->zsop_txint)(cs);
}
+ simple_unlock(&cs->cs_lock);
Home |
Main Index |
Thread Index |
Old Index