CVS commit: src/sys/arch/arc/arc

2023-08-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Aug 30 17:10:17 UTC 2023

Modified Files:
src/sys/arch/arc/arc: autoconf.c interrupt.c timer.c timervar.h

Log Message:
Remove ENABLE_INT5_STATCLOCK broken since matt-nb5-mips64 merge.

Noticed by andvar@.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arc/arc/autoconf.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arc/arc/interrupt.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arc/arc/timer.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arc/arc/timervar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arc/arc/autoconf.c
diff -u src/sys/arch/arc/arc/autoconf.c:1.35 src/sys/arch/arc/arc/autoconf.c:1.36
--- src/sys/arch/arc/arc/autoconf.c:1.35	Sat Oct 27 17:17:35 2012
+++ src/sys/arch/arc/arc/autoconf.c	Wed Aug 30 17:10:17 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.35 2012/10/27 17:17:35 chs Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.36 2023/08/30 17:10:17 tsutsui Exp $	*/
 /*	$OpenBSD: autoconf.c,v 1.9 1997/05/18 13:45:20 pefo Exp $	*/
 
 /*
@@ -88,7 +88,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.35 2012/10/27 17:17:35 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.36 2023/08/30 17:10:17 tsutsui Exp $");
 
 #include 
 #include 
@@ -131,28 +131,14 @@ void
 cpu_configure(void)
 {
 
-#ifdef ENABLE_INT5_STATCLOCK
-	evcnt_attach_static(&statclock_ev);
-#endif
-
 	(void)splhigh();	/* To be really sure.. */
 	if (config_rootfound("mainbus", NULL) == NULL)
 		panic("no mainbus found");
 
 	/* Configuration is finished, turn on interrupts. */
-#ifdef ENABLE_INT5_STATCLOCK
-	/*
-	 * Enable interrupt sources.
-	 * We can't enable CPU INT5 which is used by statclock(9) here
-	 * until cpu_initclocks(9) is called because there is no way
-	 * to disable it other than setting status register by spl(9).
-	 */
-	_spllower(MIPS_INT_MASK_5);
-#error need fix
-#else
+
 	/* enable all source forcing SOFT_INTs cleared */
 	spl0();
-#endif
 }
 
 #if defined(NFS_BOOT_BOOTP) || defined(NFS_BOOT_DHCP)

Index: src/sys/arch/arc/arc/interrupt.c
diff -u src/sys/arch/arc/arc/interrupt.c:1.9 src/sys/arch/arc/arc/interrupt.c:1.10
--- src/sys/arch/arc/arc/interrupt.c:1.9	Wed Mar  2 10:51:04 2011
+++ src/sys/arch/arc/arc/interrupt.c	Wed Aug 30 17:10:17 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.9 2011/03/02 10:51:04 tsutsui Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.10 2023/08/30 17:10:17 tsutsui Exp $	*/
 /*	$OpenBSD: trap.c,v 1.22 1999/05/24 23:08:59 jason Exp $	*/
 
 /*
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.9 2011/03/02 10:51:04 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.10 2023/08/30 17:10:17 tsutsui Exp $");
 
 #include 
 #include 
@@ -65,11 +65,6 @@ static struct cpu_inttab cpu_int_tab[ARC
 
 uint32_t cpu_int_mask;	/* External cpu interrupt mask */
 
-#ifdef ENABLE_INT5_STATCLOCK
-struct evcnt statclock_ev =
-EVCNT_INITIALIZER(EVCNT_TYPE_INTR, NULL, "cpu", "statclock");
-#endif
-
 /*
  *	Set up handler for external interrupt events.
  *	Events are checked in priority order.
@@ -114,17 +109,11 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 	while (ppl < (ipl = splintr(&ipending))) {
 		/* check MIPS3 internal clock interrupt */
 		if (ipending & MIPS_INT_MASK_5) {
-#ifdef ENABLE_INT5_STATCLOCK
-			/* call statclock(9) handler */
-			statclockintr(&cf);
-			statclock_ev.ev_count++;
-#else
 			/*
 			 * Writing a value to the Compare register, as a side
 			 * effect, clears the timer interrupt request.
 			 */
 			mips3_cp0_compare_write(0);
-#endif
 		}
 
 		/*

Index: src/sys/arch/arc/arc/timer.c
diff -u src/sys/arch/arc/arc/timer.c:1.11 src/sys/arch/arc/arc/timer.c:1.12
--- src/sys/arch/arc/arc/timer.c:1.11	Sat Oct 27 17:17:35 2012
+++ src/sys/arch/arc/arc/timer.c	Wed Aug 30 17:10:17 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: timer.c,v 1.11 2012/10/27 17:17:35 chs Exp $ */
+/* $NetBSD: timer.c,v 1.12 2023/08/30 17:10:17 tsutsui Exp $ */
 /* NetBSD: clock.c,v 1.31 2001/05/27 13:53:24 sommerfeld Exp  */
 
 /*
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: timer.c,v 1.11 2012/10/27 17:17:35 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: timer.c,v 1.12 2023/08/30 17:10:17 tsutsui Exp $");
 
 #include 
 #include 
@@ -56,22 +56,6 @@ const struct timerfns *timerfns;
 int timerinitted;
 uint32_t last_cp0_count;
 
-#ifdef ENABLE_INT5_STATCLOCK
-/*
- * Statistics clock variance, in usec.  Variance must be a
- * power of two.  Since this gives us an even number, not an odd number,
- * we discard one case and compensate.  That is, a variance of 1024 would
- * give us offsets in [0..1023].  Instead, we take offsets in [1..1023].
- * This is symmetric about the point 512, or statvar/2, and thus averages
- * to that value (assuming uniform random numbers).
- */
-static const uint32_t statvar = 1024;
-static uint32_t statint;	/* number of clock ticks for stathz */

CVS commit: src/sys/arch/arc/arc

2023-08-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Aug 30 17:10:17 UTC 2023

Modified Files:
src/sys/arch/arc/arc: autoconf.c interrupt.c timer.c timervar.h

Log Message:
Remove ENABLE_INT5_STATCLOCK broken since matt-nb5-mips64 merge.

Noticed by andvar@.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arc/arc/autoconf.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arc/arc/interrupt.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arc/arc/timer.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arc/arc/timervar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arc/arc

2023-08-29 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Aug 29 21:34:51 UTC 2023

Modified Files:
src/sys/arch/arc/arc: machdep.c

Log Message:
fix typo NKSYM -> NKSYMS in one of #if directive conditions.
It may cause build failure, e.g. with DDB option disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/arc/arc/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arc/arc

2023-08-29 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Aug 29 21:34:51 UTC 2023

Modified Files:
src/sys/arch/arc/arc: machdep.c

Log Message:
fix typo NKSYM -> NKSYMS in one of #if directive conditions.
It may cause build failure, e.g. with DDB option disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/arc/arc/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arc/arc/machdep.c
diff -u src/sys/arch/arc/arc/machdep.c:1.130 src/sys/arch/arc/arc/machdep.c:1.131
--- src/sys/arch/arc/arc/machdep.c:1.130	Thu Dec 22 14:47:54 2016
+++ src/sys/arch/arc/arc/machdep.c	Tue Aug 29 21:34:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.130 2016/12/22 14:47:54 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.131 2023/08/29 21:34:50 andvar Exp $	*/
 /*	$OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $	*/
 
 /*
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.130 2016/12/22 14:47:54 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.131 2023/08/29 21:34:50 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ddbparam.h"
@@ -200,7 +200,7 @@ mach_init(int argc, char *argv[], u_int 
 		bootinfo_msg = "no bootinfo found. (old bootblocks?)\n";
 
 	/* clear the BSS segment in kernel code */
-#if NKSYM > 0 || defined(DDB) || defined(MODULAR)
+#if NKSYMS > 0 || defined(DDB) || defined(MODULAR)
 	bi_syms = lookup_bootinfo(BTINFO_SYMTAB);
 
 	/* check whether there is valid bootinfo symtab info */



CVS commit: src/sys/arch/arc/arc

2022-03-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Mar  3 06:26:14 UTC 2022

Modified Files:
src/sys/arch/arc/arc: cpu.c

Log Message:
arc: Use device_set_private for cpuN.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arc/arc/cpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arc/arc/cpu.c
diff -u src/sys/arch/arc/arc/cpu.c:1.20 src/sys/arch/arc/arc/cpu.c:1.21
--- src/sys/arch/arc/arc/cpu.c:1.20	Wed Jun 24 06:19:52 2015
+++ src/sys/arch/arc/arc/cpu.c	Thu Mar  3 06:26:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.20 2015/06/24 06:19:52 matt Exp $	*/
+/*	$NetBSD: cpu.c,v 1.21 2022/03/03 06:26:14 riastradh Exp $	*/
 /*	$OpenBSD: cpu.c,v 1.8 1997/04/19 17:19:41 pefo Exp $ */
 
 /*
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.20 2015/06/24 06:19:52 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.21 2022/03/03 06:26:14 riastradh Exp $");
 
 #include 
 #include 
@@ -71,11 +71,10 @@ cpumatch(device_t parent, cfdata_t cf, v
 static void
 cpuattach(device_t parent, device_t self, void *aux)
 {
-
 	struct cpu_info * const ci = curcpu();
 
 	ci->ci_dev = self;
-	self->dv_private = ci;
+	device_set_private(self, ci);
 
 	aprint_normal(": ");
 



CVS commit: src/sys/arch/arc/arc

2022-03-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Mar  3 06:26:14 UTC 2022

Modified Files:
src/sys/arch/arc/arc: cpu.c

Log Message:
arc: Use device_set_private for cpuN.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arc/arc/cpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.