CVS commit: src/sys/arch/hpcmips/vr

2021-05-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat May 22 16:00:42 UTC 2021

Modified Files:
src/sys/arch/hpcmips/vr: vrgiu.c

Log Message:
Be explicit about our interface attributes.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/hpcmips/vr/vrgiu.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/hpcmips/vr/vrgiu.c
diff -u src/sys/arch/hpcmips/vr/vrgiu.c:1.45 src/sys/arch/hpcmips/vr/vrgiu.c:1.46
--- src/sys/arch/hpcmips/vr/vrgiu.c:1.45	Sat Apr 24 23:36:38 2021
+++ src/sys/arch/hpcmips/vr/vrgiu.c	Sat May 22 16:00:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vrgiu.c,v 1.45 2021/04/24 23:36:38 thorpej Exp $	*/
+/*	$NetBSD: vrgiu.c,v 1.46 2021/05/22 16:00:42 thorpej Exp $	*/
 /*-
  * Copyright (c) 1999-2001
  * Shin Takemura and PocketBSD Project. All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vrgiu.c,v 1.45 2021/04/24 23:36:38 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vrgiu.c,v 1.46 2021/05/22 16:00:42 thorpej Exp $");
 
 #include 
 #include 
@@ -268,7 +268,9 @@ vrgiu_attach(device_t parent, device_t s
 	haa.haa_sc = sc;
 	haa.haa_getchip = vrgiu_getchip;
 	haa.haa_iot = sc->sc_iot;
-	while (config_found(self, , vrgiu_print, CFARG_EOL)) ;
+	while (config_found(self, , vrgiu_print,
+	CFARG_IATTR, "hpcioif",
+	CFARG_EOL)) ;
 	/*
 	 * GIU-ISA bridge
 	 */
@@ -289,7 +291,9 @@ vrgiu_callback(device_t self)
 	haa.haa_sc = sc;
 	haa.haa_getchip = vrgiu_getchip;
 	haa.haa_iot = sc->sc_iot;
-	config_found(self, , vrgiu_print, CFARG_EOL);
+	config_found(self, , vrgiu_print,
+	CFARG_IATTR, "vrisabif",
+	CFARG_EOL);
 }
 
 int



CVS commit: src/sys/arch/hpcmips/vr

2021-01-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan 13 06:39:47 UTC 2021

Modified Files:
src/sys/arch/hpcmips/vr: vraiu.c

Log Message:
Don't advertise AUDIO_PROP_CAPTURE - no capture method is provided

[   1.000] audio0 at vraiu0: missing capture method


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hpcmips/vr/vraiu.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/hpcmips/vr/vraiu.c
diff -u src/sys/arch/hpcmips/vr/vraiu.c:1.19 src/sys/arch/hpcmips/vr/vraiu.c:1.20
--- src/sys/arch/hpcmips/vr/vraiu.c:1.19	Sun Feb 23 04:02:46 2020
+++ src/sys/arch/hpcmips/vr/vraiu.c	Wed Jan 13 06:39:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vraiu.c,v 1.19 2020/02/23 04:02:46 isaki Exp $	*/
+/*	$NetBSD: vraiu.c,v 1.20 2021/01/13 06:39:46 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 HAMAJIMA Katsuomi. All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vraiu.c,v 1.19 2020/02/23 04:02:46 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vraiu.c,v 1.20 2021/01/13 06:39:46 skrll Exp $");
 
 #include 
 #include 
@@ -493,7 +493,7 @@ vraiu_get_props(void *self)
 {
 	DPRINTFN(3, ("vraiu_get_props\n"));
 
-	return AUDIO_PROP_PLAYBACK | AUDIO_PROP_CAPTURE;
+	return AUDIO_PROP_PLAYBACK;
 }
 
 void



CVS commit: src/sys/arch/hpcmips/vr

2014-11-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov 20 16:18:29 UTC 2014

Modified Files:
src/sys/arch/hpcmips/vr: rtc.c

Log Message:
this is supposed to be SECS_PER_DAY.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/hpcmips/vr/rtc.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/hpcmips/vr/rtc.c
diff -u src/sys/arch/hpcmips/vr/rtc.c:1.33 src/sys/arch/hpcmips/vr/rtc.c:1.34
--- src/sys/arch/hpcmips/vr/rtc.c:1.33	Sun Nov 16 21:15:48 2014
+++ src/sys/arch/hpcmips/vr/rtc.c	Thu Nov 20 11:18:29 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtc.c,v 1.33 2014/11/17 02:15:48 christos Exp $	*/
+/*	$NetBSD: rtc.c,v 1.34 2014/11/20 16:18:29 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 Shin Takemura. All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtc.c,v 1.33 2014/11/17 02:15:48 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtc.c,v 1.34 2014/11/20 16:18:29 christos Exp $);
 
 #include opt_vr41xx.h
 
@@ -203,10 +203,10 @@ vrrtc_attach(device_t parent, device_t s
 	 * be on Jan 1.
 	 */
 	for (year = EPOCHYEAR; year  POSIX_BASE_YEAR; year++) {
-		sc-sc_epoch += days_per_year(year) * SECS_PER_YEAR;
+		sc-sc_epoch += days_per_year(year) * SECS_PER_DAY;
 	}
 	for (year = POSIX_BASE_YEAR; year  EPOCHYEAR; year++) {
-		sc-sc_epoch -= days_per_year(year) * SECS_PER_YEAR;
+		sc-sc_epoch -= days_per_year(year) * SECS_PER_DAY;
 	}
 
 	/*



CVS commit: src/sys/arch/hpcmips/vr

2014-03-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar 31 20:46:41 UTC 2014

Modified Files:
src/sys/arch/hpcmips/vr: vrpciu.c

Log Message:
adjust to new pci_intr_string signature


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hpcmips/vr/vrpciu.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/hpcmips/vr/vrpciu.c
diff -u src/sys/arch/hpcmips/vr/vrpciu.c:1.20 src/sys/arch/hpcmips/vr/vrpciu.c:1.21
--- src/sys/arch/hpcmips/vr/vrpciu.c:1.20	Sat Oct 27 13:17:56 2012
+++ src/sys/arch/hpcmips/vr/vrpciu.c	Mon Mar 31 16:46:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vrpciu.c,v 1.20 2012/10/27 17:17:56 chs Exp $	*/
+/*	$NetBSD: vrpciu.c,v 1.21 2014/03/31 20:46:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 Enami Tsugutomo.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vrpciu.c,v 1.20 2012/10/27 17:17:56 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: vrpciu.c,v 1.21 2014/03/31 20:46:41 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -91,7 +91,8 @@ static void	vrpciu_decompose_tag(pci_chi
 static pcireg_t	vrpciu_conf_read(pci_chipset_tag_t, pcitag_t, int); 
 static void	vrpciu_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
 static int	vrpciu_intr_map(const struct pci_attach_args *, pci_intr_handle_t *);
-static const char *vrpciu_intr_string(pci_chipset_tag_t, pci_intr_handle_t);
+static const char *vrpciu_intr_string(pci_chipset_tag_t, pci_intr_handle_t,
+		char *, size_t);
 static const struct evcnt *vrpciu_intr_evcnt(pci_chipset_tag_t,
 		pci_intr_handle_t);
 static void	*vrpciu_intr_establish(pci_chipset_tag_t, pci_intr_handle_t,
@@ -484,16 +485,15 @@ vrpciu_intr_map(const struct pci_attach_
 }
 
 const char *
-vrpciu_intr_string(pci_chipset_tag_t pc, pci_intr_handle_t ih)
+vrpciu_intr_string(pci_chipset_tag_t pc, pci_intr_handle_t ih, char *buf,
+size_t len)
 {
-	static char irqstr[sizeof(pciintr) + 16];
-
-	snprintf(irqstr, sizeof(irqstr), pciintr %d:%d:%d,
+	snprintf(buf, len, pciintr %d:%d:%d,
 	CONFIG_HOOK_PCIINTR_BUS((int)ih),
 	CONFIG_HOOK_PCIINTR_DEVICE((int)ih),
 	CONFIG_HOOK_PCIINTR_FUNCTION((int)ih));
 
-	return (irqstr);
+	return buf;
 }
 
 const struct evcnt *



CVS commit: src/sys/arch/hpcmips/vr

2011-03-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar 16 13:24:43 UTC 2011

Modified Files:
src/sys/arch/hpcmips/vr: vrip.c

Log Message:
Avoid possible future device_t/softc confusion.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/hpcmips/vr/vrip.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/hpcmips/vr/vrip.c
diff -u src/sys/arch/hpcmips/vr/vrip.c:1.34 src/sys/arch/hpcmips/vr/vrip.c:1.35
--- src/sys/arch/hpcmips/vr/vrip.c:1.34	Wed Mar 18 10:22:29 2009
+++ src/sys/arch/hpcmips/vr/vrip.c	Wed Mar 16 13:24:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vrip.c,v 1.34 2009/03/18 10:22:29 cegger Exp $	*/
+/*	$NetBSD: vrip.c,v 1.35 2011/03/16 13:24:42 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2002
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vrip.c,v 1.34 2009/03/18 10:22:29 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: vrip.c,v 1.35 2011/03/16 13:24:42 tsutsui Exp $);
 
 #include opt_vr41xx.h
 #include opt_tx39xx.h
@@ -238,7 +238,7 @@
 	/*
 	 *  Level 1 interrupts are redirected to HwInt0
 	 */
-	vr_intr_establish(VR_INTR0, vrip_intr, self);
+	vr_intr_establish(VR_INTR0, vrip_intr, sc);
 	the_vrip_sc = sc;
 	/*
 	 *  Attach each devices
@@ -491,9 +491,9 @@
 }
 
 int
-vrip_intr(void *arg, u_int32_t pc, u_int32_t statusReg)
+vrip_intr(void *arg, u_int32_t pc, u_int32_t status)
 {
-	struct vrip_softc *sc = (struct vrip_softc*)arg;
+	struct vrip_softc *sc = (struct vrip_softc *)arg;
 	bus_space_tag_t iot = sc-sc_iot;
 	bus_space_handle_t ioh = sc-sc_ioh;
 	int i;



CVS commit: src/sys/arch/hpcmips/vr

2011-03-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar 16 13:26:55 UTC 2011

Modified Files:
src/sys/arch/hpcmips/vr: vr.c

Log Message:
vr_intr_handler[] takes status for hardclock(9), not ipending.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/hpcmips/vr/vr.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/hpcmips/vr/vr.c
diff -u src/sys/arch/hpcmips/vr/vr.c:1.61 src/sys/arch/hpcmips/vr/vr.c:1.62
--- src/sys/arch/hpcmips/vr/vr.c:1.61	Wed Mar 16 13:23:41 2011
+++ src/sys/arch/hpcmips/vr/vr.c	Wed Mar 16 13:26:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vr.c,v 1.61 2011/03/16 13:23:41 tsutsui Exp $	*/
+/*	$NetBSD: vr.c,v 1.62 2011/03/16 13:26:55 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vr.c,v 1.61 2011/03/16 13:23:41 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: vr.c,v 1.62 2011/03/16 13:26:55 tsutsui Exp $);
 
 #include opt_vr41xx.h
 #include opt_tx39xx.h
@@ -548,7 +548,7 @@
 		}
 
 		if (ipending  MIPS_INT_MASK_1) {
-			(*vr_intr_handler[1])(vr_intr_arg[1], pc, ipending);
+			(*vr_intr_handler[1])(vr_intr_arg[1], pc, status);
 		}
 
 		if (ipending  MIPS_INT_MASK_0) {



CVS commit: src/sys/arch/hpcmips/vr

2011-03-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar 16 13:38:35 UTC 2011

Modified Files:
src/sys/arch/hpcmips/vr: vr.c

Log Message:
Set sr_bits[IPL_HIGH] properly, rather than setting sr_bits[IPL_VM] twice.

I wonder if gcc could warn such botch in C99 array or member initializers...


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/hpcmips/vr/vr.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/hpcmips/vr/vr.c
diff -u src/sys/arch/hpcmips/vr/vr.c:1.62 src/sys/arch/hpcmips/vr/vr.c:1.63
--- src/sys/arch/hpcmips/vr/vr.c:1.62	Wed Mar 16 13:26:55 2011
+++ src/sys/arch/hpcmips/vr/vr.c	Wed Mar 16 13:38:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vr.c,v 1.62 2011/03/16 13:26:55 tsutsui Exp $	*/
+/*	$NetBSD: vr.c,v 1.63 2011/03/16 13:38:34 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vr.c,v 1.62 2011/03/16 13:26:55 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: vr.c,v 1.63 2011/03/16 13:38:34 tsutsui Exp $);
 
 #include opt_vr41xx.h
 #include opt_tx39xx.h
@@ -141,7 +141,7 @@
 | MIPS_INT_MASK_0
 | MIPS_INT_MASK_1,
 	[IPL_DDB] =		MIPS_INT_MASK,
-	[IPL_VM] =		MIPS_INT_MASK,
+	[IPL_HIGH] =		MIPS_INT_MASK,
 },
 };
 



CVS commit: src/sys/arch/hpcmips/vr

2011-03-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar 16 14:23:19 UTC 2011

Modified Files:
src/sys/arch/hpcmips/vr: rtc.c

Log Message:
Fix signedness issue triggered by 64 bit time_t.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/hpcmips/vr/rtc.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/hpcmips/vr/rtc.c
diff -u src/sys/arch/hpcmips/vr/rtc.c:1.27 src/sys/arch/hpcmips/vr/rtc.c:1.28
--- src/sys/arch/hpcmips/vr/rtc.c:1.27	Thu Mar 10 17:27:43 2011
+++ src/sys/arch/hpcmips/vr/rtc.c	Wed Mar 16 14:23:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtc.c,v 1.27 2011/03/10 17:27:43 tsutsui Exp $	*/
+/*	$NetBSD: rtc.c,v 1.28 2011/03/16 14:23:19 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 Shin Takemura. All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtc.c,v 1.27 2011/03/10 17:27:43 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtc.c,v 1.28 2011/03/16 14:23:19 tsutsui Exp $);
 
 #include opt_vr41xx.h
 
@@ -281,7 +281,7 @@
 	bus_space_handle_t ioh = sc-sc_ioh;
 	u_int32_t timeh;	/* elapse time (2*timeh sec) */
 	u_int32_t timel;	/* timel/32768 sec */
-	int64_t sec, usec;
+	u_int64_t sec, usec;
 
 	timeh = bus_space_read_2(iot, ioh, ETIME_H_REG_W);
 	timeh = (timeh  16) | bus_space_read_2(iot, ioh, ETIME_M_REG_W);
@@ -290,7 +290,7 @@
 	DPRINTF((clock_get: timeh %08x timel %08x\n, timeh, timel));
 
 	timeh -= EPOCHOFF;
-	sec = timeh * 2;
+	sec = (uint64_t)timeh * 2;
 	sec -= sc-sc_epoch;
 	tvp-tv_sec = sec;
 	tvp-tv_sec += timel / ETIME_L_HZ;
@@ -299,7 +299,7 @@
 	usec = (timel % ETIME_L_HZ);
 	usec *= 100;
 	usec /= ETIME_L_HZ;
-	tvp-tv_usec = (uint32_t)usec;
+	tvp-tv_usec = usec;
 
 	return 0;
 }



CVS commit: src/sys/arch/hpcmips/vr

2011-03-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar 16 14:28:39 UTC 2011

Modified Files:
src/sys/arch/hpcmips/vr: rtc.c

Log Message:
KNF and cosmetics.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/hpcmips/vr/rtc.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/hpcmips/vr/rtc.c
diff -u src/sys/arch/hpcmips/vr/rtc.c:1.28 src/sys/arch/hpcmips/vr/rtc.c:1.29
--- src/sys/arch/hpcmips/vr/rtc.c:1.28	Wed Mar 16 14:23:19 2011
+++ src/sys/arch/hpcmips/vr/rtc.c	Wed Mar 16 14:28:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtc.c,v 1.28 2011/03/16 14:23:19 tsutsui Exp $	*/
+/*	$NetBSD: rtc.c,v 1.29 2011/03/16 14:28:39 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 Shin Takemura. All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtc.c,v 1.28 2011/03/16 14:23:19 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtc.c,v 1.29 2011/03/16 14:28:39 tsutsui Exp $);
 
 #include opt_vr41xx.h
 
@@ -100,7 +100,7 @@
 
 int	vrrtc_match(struct device *, struct cfdata *, void *);
 void	vrrtc_attach(struct device *, struct device *, void *);
-int	vrrtc_intr(void*, u_int32_t, u_int32_t);
+int	vrrtc_intr(void*, uint32_t, uint32_t);
 void	vrrtc_dump_regs(struct vrrtc_softc *);
 
 CFATTACH_DECL(vrrtc, sizeof(struct vrrtc_softc),
@@ -110,7 +110,7 @@
 vrrtc_match(struct device *parent, struct cfdata *cf, void *aux)
 {
 
-	return (1);
+	return 1;
 }
 
 #ifndef SINGLE_VRIP_BASE
@@ -135,15 +135,13 @@
 		sc-sc_tclk_l_reg = VR4102_TCLK_L_REG_W;
 		sc-sc_tclk_cnt_h_reg = VR4102_TCLK_CNT_H_REG_W;
 		sc-sc_tclk_cnt_l_reg = VR4102_TCLK_CNT_L_REG_W;
-	} else
-	if (va-va_addr == VR4122_RTC_ADDR) {
+	} else if (va-va_addr == VR4122_RTC_ADDR) {
 		sc-sc_rtcint_reg = VR4122_RTCINT_REG_W;
 		sc-sc_tclk_h_reg = VR4122_TCLK_H_REG_W;
 		sc-sc_tclk_l_reg = VR4122_TCLK_L_REG_W;
 		sc-sc_tclk_cnt_h_reg = VR4122_TCLK_CNT_H_REG_W;
 		sc-sc_tclk_cnt_l_reg = VR4122_TCLK_CNT_L_REG_W;
-	} else
-	if (va-va_addr == VR4181_RTC_ADDR) {
+	} else if (va-va_addr == VR4181_RTC_ADDR) {
 		sc-sc_rtcint_reg = VR4181_RTCINT_REG_W;
 		sc-sc_tclk_h_reg = RTC_NO_REG_W;
 		sc-sc_tclk_l_reg = RTC_NO_REG_W;
@@ -223,14 +221,14 @@
 }
 
 int
-vrrtc_intr(void *arg, u_int32_t pc, u_int32_t statusReg)
+vrrtc_intr(void *arg, uint32_t pc, uint32_t status)
 {
 	struct vrrtc_softc *sc = arg;
 	struct clockframe cf;
 
 	bus_space_write_2(sc-sc_iot, sc-sc_ioh, RTCINT_REG_W, RTCINT_ALL);
 	cf.pc = pc;
-	cf.sr = statusReg;
+	cf.sr = status;
 	cf.intr = (curcpu()-ci_idepth  1);
 	hardclock(cf);
 
@@ -247,8 +245,8 @@
 	 * Set tick (CLOCK_RATE)
 	 */
 	bus_space_write_2(sc-sc_iot, sc-sc_ioh, RTCL1_H_REG_W, 0);
-	bus_space_write_2(sc-sc_iot, sc-sc_ioh, RTCL1_L_REG_W,
-	RTCL1_L_HZ/CLOCK_RATE);
+	bus_space_write_2(sc-sc_iot, sc-sc_ioh,
+	RTCL1_L_REG_W, RTCL1_L_HZ / CLOCK_RATE);
 
 	/*
 	 * Initialize timecounter.
@@ -269,19 +267,18 @@
 	bus_space_tag_t iot = sc-sc_iot;
 	bus_space_handle_t ioh = sc-sc_ioh;
 
-	return (bus_space_read_2(iot, ioh, ETIME_L_REG_W));
+	return bus_space_read_2(iot, ioh, ETIME_L_REG_W);
 }
 
 int
 vrrtc_get(todr_chip_handle_t tch, struct timeval *tvp)
 {
-
 	struct vrrtc_softc *sc = (struct vrrtc_softc *)tch-cookie;
 	bus_space_tag_t iot = sc-sc_iot;
 	bus_space_handle_t ioh = sc-sc_ioh;
-	u_int32_t timeh;	/* elapse time (2*timeh sec) */
-	u_int32_t timel;	/* timel/32768 sec */
-	u_int64_t sec, usec;
+	uint32_t timeh;		/* elapse time (2*timeh sec) */
+	uint32_t timel;		/* timel/32768 sec */
+	uint64_t sec, usec;
 
 	timeh = bus_space_read_2(iot, ioh, ETIME_H_REG_W);
 	timeh = (timeh  16) | bus_space_read_2(iot, ioh, ETIME_M_REG_W);
@@ -310,8 +307,8 @@
 	struct vrrtc_softc *sc = (struct vrrtc_softc *)tch-cookie;
 	bus_space_tag_t iot = sc-sc_iot;
 	bus_space_handle_t ioh = sc-sc_ioh;
-	u_int32_t timeh;	/* elapse time (2*timeh sec) */
-	u_int32_t timel;	/* timel/32768 sec */
+	uint32_t timeh;		/* elapse time (2*timeh sec) */
+	uint32_t timel;		/* timel/32768 sec */
 	int64_t sec, cnt;
 
 	sec = tvp-tv_sec + sc-sc_epoch;
@@ -371,8 +368,10 @@
 		timel = bus_space_read_2(sc-sc_iot, sc-sc_ioh, TCLK_L_REG_W);
 		printf(clock_init()  TCLK %04x%04x\n, timeh, timel);
 
-		timeh = bus_space_read_2(sc-sc_iot, sc-sc_ioh, TCLK_CNT_H_REG_W);
-		timel = bus_space_read_2(sc-sc_iot, sc-sc_ioh, TCLK_CNT_L_REG_W);
+		timeh = bus_space_read_2(sc-sc_iot, sc-sc_ioh,
+		TCLK_CNT_H_REG_W);
+		timel = bus_space_read_2(sc-sc_iot, sc-sc_ioh,
+		TCLK_CNT_L_REG_W);
 		printf(clock_init()  TCLK CNTL %04x%04x\n, timeh, timel);
 	}
 }



CVS commit: src/sys/arch/hpcmips/vr

2011-03-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar 16 14:47:34 UTC 2011

Modified Files:
src/sys/arch/hpcmips/vr: rtc.c

Log Message:
Split device_t/softc. Tested on GXemul.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/hpcmips/vr/rtc.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/hpcmips/vr/rtc.c
diff -u src/sys/arch/hpcmips/vr/rtc.c:1.30 src/sys/arch/hpcmips/vr/rtc.c:1.31
--- src/sys/arch/hpcmips/vr/rtc.c:1.30	Wed Mar 16 14:43:37 2011
+++ src/sys/arch/hpcmips/vr/rtc.c	Wed Mar 16 14:47:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtc.c,v 1.30 2011/03/16 14:43:37 tsutsui Exp $	*/
+/*	$NetBSD: rtc.c,v 1.31 2011/03/16 14:47:34 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 Shin Takemura. All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtc.c,v 1.30 2011/03/16 14:43:37 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtc.c,v 1.31 2011/03/16 14:47:34 tsutsui Exp $);
 
 #include opt_vr41xx.h
 
@@ -74,7 +74,7 @@
 #endif /* VRRTCDEBUG */
 
 struct vrrtc_softc {
-	struct device sc_dev;
+	device_t sc_dev;
 	bus_space_tag_t sc_iot;
 	bus_space_handle_t sc_ioh;
 	void *sc_ih;
@@ -98,16 +98,16 @@
 	CLOCK_RATE, vrrtc_init,
 };
 
-int	vrrtc_match(struct device *, struct cfdata *, void *);
-void	vrrtc_attach(struct device *, struct device *, void *);
+int	vrrtc_match(device_t, cfdata_t, void *);
+void	vrrtc_attach(device_t, device_t, void *);
 int	vrrtc_intr(void*, uint32_t, uint32_t);
 void	vrrtc_dump_regs(struct vrrtc_softc *);
 
-CFATTACH_DECL(vrrtc, sizeof(struct vrrtc_softc),
+CFATTACH_DECL_NEW(vrrtc, sizeof(struct vrrtc_softc),
 vrrtc_match, vrrtc_attach, NULL, NULL);
 
 int
-vrrtc_match(struct device *parent, struct cfdata *cf, void *aux)
+vrrtc_match(device_t parent, cfdata_t cf, void *aux)
 {
 
 	return 1;
@@ -122,7 +122,7 @@
 #endif /* SINGLE_VRIP_BASE */
 
 void
-vrrtc_attach(struct device *parent, struct device *self, void *aux)
+vrrtc_attach(device_t parent, device_t self, void *aux)
 {
 	struct vrip_attach_args *va = aux;
 	struct vrrtc_softc *sc = device_private(self);
@@ -149,7 +149,7 @@
 		sc-sc_tclk_cnt_l_reg = RTC_NO_REG_W;
 	} else {
 		panic(%s: unknown base address 0x%lx,
-		sc-sc_dev.dv_xname, va-va_addr);
+		device_xname(self), va-va_addr);
 	}
 #endif /* SINGLE_VRIP_BASE */
 



CVS commit: src/sys/arch/hpcmips/vr

2011-03-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Mar 10 17:27:43 UTC 2011

Modified Files:
src/sys/arch/hpcmips/vr: rtc.c

Log Message:
Set correct struct clockframe .intr value for hardclock(9).


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/hpcmips/vr/rtc.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/hpcmips/vr/rtc.c
diff -u src/sys/arch/hpcmips/vr/rtc.c:1.26 src/sys/arch/hpcmips/vr/rtc.c:1.27
--- src/sys/arch/hpcmips/vr/rtc.c:1.26	Sat Dec 12 14:44:08 2009
+++ src/sys/arch/hpcmips/vr/rtc.c	Thu Mar 10 17:27:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtc.c,v 1.26 2009/12/12 14:44:08 tsutsui Exp $	*/
+/*	$NetBSD: rtc.c,v 1.27 2011/03/10 17:27:43 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1999 Shin Takemura. All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtc.c,v 1.26 2009/12/12 14:44:08 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtc.c,v 1.27 2011/03/10 17:27:43 tsutsui Exp $);
 
 #include opt_vr41xx.h
 
@@ -44,6 +44,7 @@
 #include sys/systm.h
 #include sys/timetc.h
 #include sys/device.h
+#include sys/cpu.h
 
 #include machine/sysconf.h
 #include machine/bus.h
@@ -230,6 +231,7 @@
 	bus_space_write_2(sc-sc_iot, sc-sc_ioh, RTCINT_REG_W, RTCINT_ALL);
 	cf.pc = pc;
 	cf.sr = statusReg;
+	cf.intr = (curcpu()-ci_idepth  1);
 	hardclock(cf);
 
 	return 0;



CVS commit: src/sys/arch/hpcmips/vr

2010-11-14 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Mon Nov 15 06:27:41 UTC 2010

Modified Files:
src/sys/arch/hpcmips/vr: vr.c

Log Message:
struct cpu_info * deref needs sys/cpu.h.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/hpcmips/vr/vr.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/hpcmips/vr/vr.c
diff -u src/sys/arch/hpcmips/vr/vr.c:1.56 src/sys/arch/hpcmips/vr/vr.c:1.57
--- src/sys/arch/hpcmips/vr/vr.c:1.56	Sat Apr 10 22:53:59 2010
+++ src/sys/arch/hpcmips/vr/vr.c	Mon Nov 15 06:27:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vr.c,v 1.56 2010/04/10 22:53:59 jun Exp $	*/
+/*	$NetBSD: vr.c,v 1.57 2010/11/15 06:27:41 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vr.c,v 1.56 2010/04/10 22:53:59 jun Exp $);
+__KERNEL_RCSID(0, $NetBSD: vr.c,v 1.57 2010/11/15 06:27:41 uebayasi Exp $);
 
 #include opt_vr41xx.h
 #include opt_tx39xx.h
@@ -46,6 +46,7 @@
 #include sys/reboot.h
 #include sys/device.h
 #include sys/bus.h
+#include sys/cpu.h
 
 #include uvm/uvm_extern.h
 



CVS commit: src/sys/arch/hpcmips/vr

2010-06-06 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jun  6 06:10:03 UTC 2010

Modified Files:
src/sys/arch/hpcmips/vr: vr4181aiu.c

Log Message:
Add missing close-parenthesis; reported by Henning Petersen in PR 42526.
(HI CEGGER!)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcmips/vr/vr4181aiu.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/hpcmips/vr/vr4181aiu.c
diff -u src/sys/arch/hpcmips/vr/vr4181aiu.c:1.6 src/sys/arch/hpcmips/vr/vr4181aiu.c:1.7
--- src/sys/arch/hpcmips/vr/vr4181aiu.c:1.6	Wed Jun 11 23:53:15 2008
+++ src/sys/arch/hpcmips/vr/vr4181aiu.c	Sun Jun  6 06:10:03 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vr4181aiu.c,v 1.6 2008/06/11 23:53:15 cegger Exp $ */
+/* $NetBSD: vr4181aiu.c,v 1.7 2010/06/06 06:10:03 dholland Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vr4181aiu.c,v 1.6 2008/06/11 23:53:15 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: vr4181aiu.c,v 1.7 2010/06/06 06:10:03 dholland Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -235,7 +235,7 @@
 {
 	struct vr4181aiu_softc	*sc;
 
-	sc = device_lookup_private(vr4181aiu_cd, minor(dev);
+	sc = device_lookup_private(vr4181aiu_cd, minor(dev));
 	if (sc == NULL)
 		return ENXIO;
 



CVS commit: src/sys/arch/hpcmips/vr

2010-04-10 Thread Jun Ebihara
Module Name:src
Committed By:   jun
Date:   Sat Apr 10 22:53:59 UTC 2010

Modified Files:
src/sys/arch/hpcmips/vr: vr.c

Log Message:
workaround for port-hpcmips/42934
  NetBSD/hpcmips can't boot after 5.99.23
  adviced by Naoki Fukaumi on twitter.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/hpcmips/vr/vr.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/hpcmips/vr/vr.c
diff -u src/sys/arch/hpcmips/vr/vr.c:1.55 src/sys/arch/hpcmips/vr/vr.c:1.56
--- src/sys/arch/hpcmips/vr/vr.c:1.55	Thu Jan 21 01:23:15 2010
+++ src/sys/arch/hpcmips/vr/vr.c	Sat Apr 10 22:53:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vr.c,v 1.55 2010/01/21 01:23:15 pooka Exp $	*/
+/*	$NetBSD: vr.c,v 1.56 2010/04/10 22:53:59 jun Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vr.c,v 1.55 2010/01/21 01:23:15 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: vr.c,v 1.56 2010/04/10 22:53:59 jun Exp $);
 
 #include opt_vr41xx.h
 #include opt_tx39xx.h
@@ -344,8 +344,11 @@
 	for (; addr  end; addr += PAGE_SIZE) {
 
 		page = (char *)MIPS_PHYS_TO_KSEG1(addr);
+/*
+ XXX see port-hpcmips/42934
 		if (badaddr(page, 4))
 			goto bad;
+ */
 
 		/* stop memory probing at first memory image */
 		if (memcmp(page, (void *)MIPS_PHYS_TO_KSEG0(0), 128) == 0)



CVS commit: src/sys/arch/hpcmips/vr

2009-08-19 Thread Jun Ebihara
Module Name:src
Committed By:   jun
Date:   Wed Aug 19 12:49:24 UTC 2009

Modified Files:
src/sys/arch/hpcmips/vr: vr.c

Log Message:
Fix #41863, Missing }.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/hpcmips/vr/vr.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/hpcmips/vr/vr.c
diff -u src/sys/arch/hpcmips/vr/vr.c:1.53 src/sys/arch/hpcmips/vr/vr.c:1.54
--- src/sys/arch/hpcmips/vr/vr.c:1.53	Wed Mar 18 15:14:29 2009
+++ src/sys/arch/hpcmips/vr/vr.c	Wed Aug 19 12:49:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vr.c,v 1.53 2009/03/18 15:14:29 cegger Exp $	*/
+/*	$NetBSD: vr.c,v 1.54 2009/08/19 12:49:24 jun Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vr.c,v 1.53 2009/03/18 15:14:29 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: vr.c,v 1.54 2009/08/19 12:49:24 jun Exp $);
 
 #include opt_vr41xx.h
 #include opt_tx39xx.h
@@ -428,6 +428,7 @@
 			printf(%s(%d): can't init kgdb's serial port,
 			__FILE__, __LINE__);
 		}
+	}
 #else /* KGDB */
 	if (com_info-attach != NULL  (bootinfo-bi_cnuseBI_CNUSE_SERIAL)) {
 		/* Serial console */



CVS commit: src/sys/arch/hpcmips/vr

2009-04-05 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Apr  5 21:19:37 UTC 2009

Modified Files:
src/sys/arch/hpcmips/vr: vrc4173bcu.c

Log Message:
Fix broken build from missing comma. (HI CHRISTOS!!)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hpcmips/vr/vrc4173bcu.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/hpcmips/vr/vrc4173bcu.c
diff -u src/sys/arch/hpcmips/vr/vrc4173bcu.c:1.20 src/sys/arch/hpcmips/vr/vrc4173bcu.c:1.21
--- src/sys/arch/hpcmips/vr/vrc4173bcu.c:1.20	Tue Dec 16 22:35:23 2008
+++ src/sys/arch/hpcmips/vr/vrc4173bcu.c	Sun Apr  5 21:19:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vrc4173bcu.c,v 1.20 2008/12/16 22:35:23 christos Exp $	*/
+/*	$NetBSD: vrc4173bcu.c,v 1.21 2009/04/05 21:19:37 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2001,2002 Enami Tsugutomo.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vrc4173bcu.c,v 1.20 2008/12/16 22:35:23 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: vrc4173bcu.c,v 1.21 2009/04/05 21:19:37 dholland Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -362,7 +362,7 @@
 	bus_space_write_2(sc-sc_iot, sc-sc_icuh, VRC4173ICU_MSYSINT1, reg);
 
 	reg = bus_space_read_2(sc-sc_iot, sc-sc_icuh, VRC4173ICU_MSYSINT1);
-	snprintb(buf, sizeof(buf)
+	snprintb(buf, sizeof(buf),
 	\20\1USB\2PCMCIA2\3PCMCIA1\4PS2CH2\5PS2CH1\6PIU\7AIU\10KIU
 	\11GIU\12AC97\13AC97-1\14B11\15B12\16DOZEPIU\17B14\20B15, reg);
 	printf(%s: MSYSINT1 = 0x%s\n, sc-sc_dev.dv_xname, buf);