Tue Mar 5 20:58:05 2024 UTC (79d)
Remove duplicate "when" word in comments.


(andvar)
diff -r1.71 -r1.72 src/sys/arch/mac68k/dev/adb_direct.c
diff -r1.45 -r1.46 src/sys/arch/macppc/dev/adb_direct.c
diff -r1.166 -r1.167 src/sys/arch/x86/x86/intr.c

cvs diff -r1.71 -r1.72 src/sys/arch/mac68k/dev/adb_direct.c (expand / switch to unified diff)

--- src/sys/arch/mac68k/dev/adb_direct.c 2024/02/28 13:05:39 1.71
+++ src/sys/arch/mac68k/dev/adb_direct.c 2024/03/05 20:58:05 1.72
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: adb_direct.c,v 1.71 2024/02/28 13:05:39 thorpej Exp $ */ 1/* $NetBSD: adb_direct.c,v 1.72 2024/03/05 20:58:05 andvar Exp $ */
2 2
3/* From: adb_direct.c 2.02 4/18/97 jpw */ 3/* From: adb_direct.c 2.02 4/18/97 jpw */
4 4
5/* 5/*
6 * Copyright (C) 1996, 1997 John P. Wittkoski 6 * Copyright (C) 1996, 1997 John P. Wittkoski
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -52,27 +52,27 @@ @@ -52,27 +52,27 @@
52 * over to using adbCommand structs directly. 52 * over to using adbCommand structs directly.
53 * - There is a bug in the state machine of adb_intr_cuda 53 * - There is a bug in the state machine of adb_intr_cuda
54 * code that causes hangs, especially on 030 machines, probably 54 * code that causes hangs, especially on 030 machines, probably
55 * because of some timing issues. Because I have been unable to  55 * because of some timing issues. Because I have been unable to
56 * determine the exact cause of this bug, I used the timeout function  56 * determine the exact cause of this bug, I used the timeout function
57 * to check for and recover from this condition. If anyone finds  57 * to check for and recover from this condition. If anyone finds
58 * the actual cause of this bug, the calls to timeout and the  58 * the actual cause of this bug, the calls to timeout and the
59 * adb_cuda_tickle routine can be removed. 59 * adb_cuda_tickle routine can be removed.
60 */ 60 */
61 61
62#ifdef __NetBSD__ 62#ifdef __NetBSD__
63 63
64#include <sys/cdefs.h> 64#include <sys/cdefs.h>
65__KERNEL_RCSID(0, "$NetBSD: adb_direct.c,v 1.71 2024/02/28 13:05:39 thorpej Exp $"); 65__KERNEL_RCSID(0, "$NetBSD: adb_direct.c,v 1.72 2024/03/05 20:58:05 andvar Exp $");
66 66
67#include "opt_adb.h" 67#include "opt_adb.h"
68 68
69#include <sys/param.h> 69#include <sys/param.h>
70#include <sys/pool.h> 70#include <sys/pool.h>
71#include <sys/queue.h> 71#include <sys/queue.h>
72#include <sys/systm.h> 72#include <sys/systm.h>
73#include <sys/callout.h> 73#include <sys/callout.h>
74#include <sys/cpu.h> 74#include <sys/cpu.h>
75#include <sys/intr.h> 75#include <sys/intr.h>
76 76
77#include <machine/viareg.h> 77#include <machine/viareg.h>
78#include <machine/adbsys.h> /* required for adbvar.h */ 78#include <machine/adbsys.h> /* required for adbvar.h */
@@ -384,27 +384,27 @@ adb_cuda_tickle(void) @@ -384,27 +384,27 @@ adb_cuda_tickle(void)
384 tickle_serial = adb_cuda_serial; 384 tickle_serial = adb_cuda_serial;
385 tickle_count = 0; 385 tickle_count = 0;
386 } 386 }
387 } else { 387 } else {
388 tickle_serial = adb_cuda_serial; 388 tickle_serial = adb_cuda_serial;
389 tickle_count = 0; 389 tickle_count = 0;
390 } 390 }
391 391
392 callout_reset(&adb_cuda_tickle_ch, ADB_TICKLE_TICKS, 392 callout_reset(&adb_cuda_tickle_ch, ADB_TICKLE_TICKS,
393 (void *)adb_cuda_tickle, NULL); 393 (void *)adb_cuda_tickle, NULL);
394} 394}
395 395
396/* 396/*
397 * called when when an adb interrupt happens 397 * called when an adb interrupt happens
398 * 398 *
399 * Cuda version of adb_intr 399 * Cuda version of adb_intr
400 * TO DO: do we want to add some calls to intr_dispatch() here to 400 * TO DO: do we want to add some calls to intr_dispatch() here to
401 * grab serial interrupts? 401 * grab serial interrupts?
402 */ 402 */
403void 403void
404adb_intr_cuda(void *arg) 404adb_intr_cuda(void *arg)
405{ 405{
406 volatile int i __unused, ending; 406 volatile int i __unused, ending;
407 volatile unsigned int s; 407 volatile unsigned int s;
408 struct adbCommand packet; 408 struct adbCommand packet;
409 409
410 s = splhigh(); /* can't be too careful - might be called */ 410 s = splhigh(); /* can't be too careful - might be called */
@@ -1198,27 +1198,27 @@ adb_guess_next_device(void) @@ -1198,27 +1198,27 @@ adb_guess_next_device(void)
1198 break; 1198 break;
1199 } 1199 }
1200 /* found the next device */ 1200 /* found the next device */
1201 if (ADBDevTable[dummy].devType != 0) 1201 if (ADBDevTable[dummy].devType != 0)
1202 break; 1202 break;
1203 } 1203 }
1204 adbLastDevice = ADBDevTable[dummy].currentAddr; 1204 adbLastDevice = ADBDevTable[dummy].currentAddr;
1205 } 1205 }
1206 return adbLastDevice; 1206 return adbLastDevice;
1207} 1207}
1208 1208
1209 1209
1210/* 1210/*
1211 * Called when when an adb interrupt happens. 1211 * Called when an adb interrupt happens.
1212 * This routine simply transfers control over to the appropriate 1212 * This routine simply transfers control over to the appropriate
1213 * code for the machine we are running on. 1213 * code for the machine we are running on.
1214 */ 1214 */
1215void 1215void
1216adb_intr(void *arg) 1216adb_intr(void *arg)
1217{ 1217{
1218 switch (adbHardware) { 1218 switch (adbHardware) {
1219 case ADB_HW_II: 1219 case ADB_HW_II:
1220 adb_intr_II(arg); 1220 adb_intr_II(arg);
1221 break; 1221 break;
1222 1222
1223 case ADB_HW_IISI: 1223 case ADB_HW_IISI:
1224 adb_intr_IIsi(arg); 1224 adb_intr_IIsi(arg);
@@ -1231,27 +1231,27 @@ adb_intr(void *arg) @@ -1231,27 +1231,27 @@ adb_intr(void *arg)
1231 adb_intr_cuda(arg); 1231 adb_intr_cuda(arg);
1232 break; 1232 break;
1233 1233
1234 case ADB_HW_IOP: /* Should not come through here. */ 1234 case ADB_HW_IOP: /* Should not come through here. */
1235 break; 1235 break;
1236 1236
1237 case ADB_HW_UNKNOWN: 1237 case ADB_HW_UNKNOWN:
1238 break; 1238 break;
1239 } 1239 }
1240} 1240}
1241 1241
1242 1242
1243/* 1243/*
1244 * called when when an adb interrupt happens 1244 * called when an adb interrupt happens
1245 * 1245 *
1246 * IIsi version of adb_intr 1246 * IIsi version of adb_intr
1247 * 1247 *
1248 */ 1248 */
1249void 1249void
1250adb_intr_IIsi(void *arg) 1250adb_intr_IIsi(void *arg)
1251{ 1251{
1252 struct adbCommand packet; 1252 struct adbCommand packet;
1253 int ending; 1253 int ending;
1254 unsigned int s; 1254 unsigned int s;
1255 1255
1256 s = splhigh(); /* can't be too careful - might be called */ 1256 s = splhigh(); /* can't be too careful - might be called */
1257 /* from a routine, NOT an interrupt */ 1257 /* from a routine, NOT an interrupt */

cvs diff -r1.45 -r1.46 src/sys/arch/macppc/dev/adb_direct.c (expand / switch to unified diff)

--- src/sys/arch/macppc/dev/adb_direct.c 2023/09/21 09:31:49 1.45
+++ src/sys/arch/macppc/dev/adb_direct.c 2024/03/05 20:58:05 1.46
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: adb_direct.c,v 1.45 2023/09/21 09:31:49 msaitoh Exp $ */ 1/* $NetBSD: adb_direct.c,v 1.46 2024/03/05 20:58:05 andvar Exp $ */
2 2
3/* From: adb_direct.c 2.02 4/18/97 jpw */ 3/* From: adb_direct.c 2.02 4/18/97 jpw */
4 4
5/* 5/*
6 * Copyright (C) 1996, 1997 John P. Wittkoski 6 * Copyright (C) 1996, 1997 John P. Wittkoski
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -50,27 +50,27 @@ @@ -50,27 +50,27 @@
50 * - (Related to above) Actually implement the adbOutbound queue. 50 * - (Related to above) Actually implement the adbOutbound queue.
51 * This is fairly easy once you switch all the intr routines 51 * This is fairly easy once you switch all the intr routines
52 * over to using adbCommand structs directly. 52 * over to using adbCommand structs directly.
53 * - There is a bug in the state machine of adb_intr_cuda 53 * - There is a bug in the state machine of adb_intr_cuda
54 * code that causes hangs, especially on 030 machines, probably 54 * code that causes hangs, especially on 030 machines, probably
55 * because of some timing issues. Because I have been unable to  55 * because of some timing issues. Because I have been unable to
56 * determine the exact cause of this bug, I used the timeout function  56 * determine the exact cause of this bug, I used the timeout function
57 * to check for and recover from this condition. If anyone finds  57 * to check for and recover from this condition. If anyone finds
58 * the actual cause of this bug, the calls to timeout and the  58 * the actual cause of this bug, the calls to timeout and the
59 * adb_cuda_tickle routine can be removed. 59 * adb_cuda_tickle routine can be removed.
60 */ 60 */
61 61
62#include <sys/cdefs.h> 62#include <sys/cdefs.h>
63__KERNEL_RCSID(0, "$NetBSD: adb_direct.c,v 1.45 2023/09/21 09:31:49 msaitoh Exp $"); 63__KERNEL_RCSID(0, "$NetBSD: adb_direct.c,v 1.46 2024/03/05 20:58:05 andvar Exp $");
64 64
65#include <sys/param.h> 65#include <sys/param.h>
66#include <sys/systm.h> 66#include <sys/systm.h>
67#include <sys/callout.h> 67#include <sys/callout.h>
68#include <sys/device.h> 68#include <sys/device.h>
69 69
70#include <machine/cpu.h> 70#include <machine/cpu.h>
71#include <machine/autoconf.h> 71#include <machine/autoconf.h>
72#include <machine/adbsys.h> 72#include <machine/adbsys.h>
73#include <machine/pio.h> 73#include <machine/pio.h>
74 74
75#include <macppc/dev/viareg.h> 75#include <macppc/dev/viareg.h>
76#include <macppc/dev/adbvar.h> 76#include <macppc/dev/adbvar.h>
@@ -309,27 +309,27 @@ adb_cuda_tickle(void) @@ -309,27 +309,27 @@ adb_cuda_tickle(void)
309 tickle_serial = adb_cuda_serial; 309 tickle_serial = adb_cuda_serial;
310 tickle_count = 0; 310 tickle_count = 0;
311 } 311 }
312 } else { 312 } else {
313 tickle_serial = adb_cuda_serial; 313 tickle_serial = adb_cuda_serial;
314 tickle_count = 0; 314 tickle_count = 0;
315 } 315 }
316 316
317 callout_reset(&adb_cuda_tickle_ch, ADB_TICKLE_TICKS, 317 callout_reset(&adb_cuda_tickle_ch, ADB_TICKLE_TICKS,
318 (void *)adb_cuda_tickle, NULL); 318 (void *)adb_cuda_tickle, NULL);
319} 319}
320 320
321/* 321/*
322 * called when when an adb interrupt happens 322 * called when an adb interrupt happens
323 * 323 *
324 * Cuda version of adb_intr 324 * Cuda version of adb_intr
325 * TO DO: do we want to add some calls to intr_dispatch() here to 325 * TO DO: do we want to add some calls to intr_dispatch() here to
326 * grab serial interrupts? 326 * grab serial interrupts?
327 */ 327 */
328int 328int
329adb_intr_cuda(void *arg) 329adb_intr_cuda(void *arg)
330{ 330{
331 volatile int i, ending; 331 volatile int i, ending;
332 volatile unsigned int s; 332 volatile unsigned int s;
333 struct adbCommand packet; 333 struct adbCommand packet;
334 uint8_t reg; 334 uint8_t reg;
335 335

cvs diff -r1.166 -r1.167 src/sys/arch/x86/x86/intr.c (expand / switch to unified diff)

--- src/sys/arch/x86/x86/intr.c 2023/11/29 11:40:37 1.166
+++ src/sys/arch/x86/x86/intr.c 2024/03/05 20:58:05 1.167
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: intr.c,v 1.166 2023/11/29 11:40:37 mlelstv Exp $ */ 1/* $NetBSD: intr.c,v 1.167 2024/03/05 20:58:05 andvar Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc. 4 * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran, and by Jason R. Thorpe. 8 * by Andrew Doran, and by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -123,27 +123,27 @@ @@ -123,27 +123,27 @@
123 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 123 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
124 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 124 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
125 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 125 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
126 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 126 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
127 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 127 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
128 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 128 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
129 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 129 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
130 * SUCH DAMAGE. 130 * SUCH DAMAGE.
131 * 131 *
132 * @(#)isa.c 7.2 (Berkeley) 5/13/91 132 * @(#)isa.c 7.2 (Berkeley) 5/13/91
133 */ 133 */
134 134
135#include <sys/cdefs.h> 135#include <sys/cdefs.h>
136__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.166 2023/11/29 11:40:37 mlelstv Exp $"); 136__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.167 2024/03/05 20:58:05 andvar Exp $");
137 137
138#include "opt_intrdebug.h" 138#include "opt_intrdebug.h"
139#include "opt_multiprocessor.h" 139#include "opt_multiprocessor.h"
140#include "opt_acpi.h" 140#include "opt_acpi.h"
141 141
142#include <sys/param.h> 142#include <sys/param.h>
143#include <sys/systm.h> 143#include <sys/systm.h>
144#include <sys/kernel.h> 144#include <sys/kernel.h>
145#include <sys/syslog.h> 145#include <sys/syslog.h>
146#include <sys/device.h> 146#include <sys/device.h>
147#include <sys/kmem.h> 147#include <sys/kmem.h>
148#include <sys/proc.h> 148#include <sys/proc.h>
149#include <sys/errno.h> 149#include <sys/errno.h>
@@ -1046,27 +1046,27 @@ intr_mask_xcall(void *arg1, void *arg2) @@ -1046,27 +1046,27 @@ intr_mask_xcall(void *arg1, void *arg2)
1046 if (--source->is_mask_count == 0) { 1046 if (--source->is_mask_count == 0) {
1047 /* 1047 /*
1048 * If this interrupt source is being moved, don't 1048 * If this interrupt source is being moved, don't
1049 * unmask it at the hw. 1049 * unmask it at the hw.
1050 */ 1050 */
1051 if (! source->is_distribute_pending) { 1051 if (! source->is_distribute_pending) {
1052 (*pic->pic_hwunmask)(pic, ih->ih_pin); 1052 (*pic->pic_hwunmask)(pic, ih->ih_pin);
1053 } 1053 }
1054 1054
1055 /* 1055 /*
1056 * For level-sensitive interrupts, the hardware 1056 * For level-sensitive interrupts, the hardware
1057 * will let us know. For everything else, we 1057 * will let us know. For everything else, we
1058 * need to explicitly handle interrupts that 1058 * need to explicitly handle interrupts that
1059 * happened when when the source was masked. 1059 * happened when the source was masked.
1060 */ 1060 */
1061 const uint64_t bit = (1U << ih->ih_slot); 1061 const uint64_t bit = (1U << ih->ih_slot);
1062 if (ci->ci_imasked & bit) { 1062 if (ci->ci_imasked & bit) {
1063 ci->ci_imasked &= ~bit; 1063 ci->ci_imasked &= ~bit;
1064 if (source->is_type != IST_LEVEL) { 1064 if (source->is_type != IST_LEVEL) {
1065 ci->ci_ipending |= bit; 1065 ci->ci_ipending |= bit;
1066 force_pending = true; 1066 force_pending = true;
1067 } 1067 }
1068 } 1068 }
1069 } 1069 }
1070 } 1070 }
1071 1071
1072 /* Re-enable interrupts. */ 1072 /* Re-enable interrupts. */