CVS commit: src/sys/arch/powerpc/booke/dev

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:08:07 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3cfi.c pq3nandfcm.c

Log Message:
powerpc: Use config_detach_children to reduce error branch bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/dev/pq3cfi.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/booke/dev/pq3nandfcm.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/powerpc/booke/dev/pq3cfi.c
diff -u src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.7 src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.8
--- src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.7	Mon Jul  6 10:22:44 2020
+++ src/sys/arch/powerpc/booke/dev/pq3cfi.c	Wed May 10 00:08:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3cfi.c,v 1.7 2020/07/06 10:22:44 rin Exp $	*/
+/*	$NetBSD: pq3cfi.c,v 1.8 2023/05/10 00:08:07 riastradh Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3cfi.c,v 1.7 2020/07/06 10:22:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3cfi.c,v 1.8 2023/05/10 00:08:07 riastradh Exp $");
 
 #include "locators.h"
 
@@ -164,14 +164,15 @@ static int
 pq3cfi_detach(device_t self, int flags)
 {
 	struct pq3cfi_softc *sc = device_private(self);
-	int rv = 0;
+	int error;
 
-	pmf_device_deregister(self);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	if (sc->sc_nordev != NULL)
-		rv = config_detach(sc->sc_nordev, flags);
+	pmf_device_deregister(self);
 
 	bus_space_unmap(sc->sc_cfi.cfi_bst, sc->sc_cfi.cfi_bsh, sc->sc_size);
 
-	return rv;
+	return 0;
 }

Index: src/sys/arch/powerpc/booke/dev/pq3nandfcm.c
diff -u src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.4 src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.5
--- src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.4	Mon Jul  6 10:22:44 2020
+++ src/sys/arch/powerpc/booke/dev/pq3nandfcm.c	Wed May 10 00:08:07 2023
@@ -30,7 +30,7 @@
 #define LBC_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3nandfcm.c,v 1.4 2020/07/06 10:22:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3nandfcm.c,v 1.5 2023/05/10 00:08:07 riastradh Exp $");
 
 #include 
 #include 
@@ -111,16 +111,17 @@ int
 pq3nandfcm_detach(device_t self, int flags)
 {
 	struct pq3nandfcm_softc * const sc = device_private(self);
-	int rv = 0;
+	int error;
 
-	pmf_device_deregister(self);
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
-	if (sc->sc_nanddev != NULL)
-		rv = config_detach(sc->sc_nanddev, flags);
+	pmf_device_deregister(self);
 
 	bus_space_unmap(sc->sc_window_bst, sc->sc_window_bsh,
 	sc->sc_window_size);
-	return rv;
+	return 0;
 }
 void
 pq3nandfcm_command(device_t self, uint8_t command)



CVS commit: src/sys/arch/powerpc/booke/dev

2023-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 10 00:08:07 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3cfi.c pq3nandfcm.c

Log Message:
powerpc: Use config_detach_children to reduce error branch bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/dev/pq3cfi.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/booke/dev/pq3nandfcm.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/powerpc/booke

2023-04-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr 17 06:48:07 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/powerpc/booke/trap.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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.39 src/sys/arch/powerpc/booke/trap.c:1.40
--- src/sys/arch/powerpc/booke/trap.c:1.39	Wed Oct 26 07:35:20 2022
+++ src/sys/arch/powerpc/booke/trap.c	Mon Apr 17 06:48:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.39 2022/10/26 07:35:20 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.40 2023/04/17 06:48:07 skrll Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.39 2022/10/26 07:35:20 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.40 2023/04/17 06:48:07 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -300,7 +300,7 @@ isi_exception(struct trapframe *tf, ksig
 		if (VM_PAGEMD_EXECPAGE_P(mdpg))
 			UVMHIST_LOG(pmapexechist,
 			"srr0=%#x pg=%p (pa %#"PRIxPADDR"): "
-			"no syncicache (already execpage)", 
+			"no syncicache (already execpage)",
 			tf->tf_srr0, (uintptr_t)pg, pa, 0);
 		else
 			UVMHIST_LOG(pmapexechist,
@@ -459,7 +459,7 @@ pgm_exception(struct trapframe *tf, ksig
 
 	UVMHIST_FUNC(__func__); UVMHIST_CALLED(pmapexechist);
 
-	UVMHIST_LOG(pmapexechist, " srr0/1=%#x/%#x esr=%#x pte=%#x", 
+	UVMHIST_LOG(pmapexechist, " srr0/1=%#x/%#x esr=%#x pte=%#x",
 	tf->tf_srr0, tf->tf_srr1, tf->tf_esr,
 	*trap_pte_lookup(tf, trunc_page(tf->tf_srr0), PSL_IS));
 



CVS commit: src/sys/arch/powerpc/booke

2023-04-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr 17 06:48:07 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/powerpc/booke/trap.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/powerpc/booke

2023-04-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr 17 06:46:53 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c

Log Message:
KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/powerpc/booke/booke_pmap.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/powerpc/booke

2023-04-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Apr 17 06:46:53 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c

Log Message:
KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/powerpc/booke/booke_pmap.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/powerpc/booke/booke_pmap.c
diff -u src/sys/arch/powerpc/booke/booke_pmap.c:1.37 src/sys/arch/powerpc/booke/booke_pmap.c:1.38
--- src/sys/arch/powerpc/booke/booke_pmap.c:1.37	Fri Apr  7 12:09:13 2023
+++ src/sys/arch/powerpc/booke/booke_pmap.c	Mon Apr 17 06:46:53 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_pmap.c,v 1.37 2023/04/07 12:09:13 skrll Exp $	*/
+/*	$NetBSD: booke_pmap.c,v 1.38 2023/04/17 06:46:53 skrll Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define __PMAP_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.37 2023/04/07 12:09:13 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.38 2023/04/17 06:46:53 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -249,7 +249,7 @@ pmap_bootstrap(vaddr_t startkernel, vadd
 	ptp = stp->seg_tab;
 	ppg = (void *)dm_segtabs;
 	memset(ppg, 0, NBPG * dm_nsegtabs);
-	for (size_t i = 0; i < dm_nsegtabs; i++, ptp++, ppg ++) {
+	for (size_t i = 0; i < dm_nsegtabs; i++, ptp++, ppg++) {
 		*ptp = ppg;
 	}
 



CVS commit: src/sys/arch/powerpc/booke

2023-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  7 12:09:13 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c

Log Message:
Spaces to TAB


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/booke/booke_pmap.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/powerpc/booke/booke_pmap.c
diff -u src/sys/arch/powerpc/booke/booke_pmap.c:1.36 src/sys/arch/powerpc/booke/booke_pmap.c:1.37
--- src/sys/arch/powerpc/booke/booke_pmap.c:1.36	Wed Oct 26 07:35:20 2022
+++ src/sys/arch/powerpc/booke/booke_pmap.c	Fri Apr  7 12:09:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_pmap.c,v 1.36 2022/10/26 07:35:20 skrll Exp $	*/
+/*	$NetBSD: booke_pmap.c,v 1.37 2023/04/07 12:09:13 skrll Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define __PMAP_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.36 2022/10/26 07:35:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.37 2023/04/07 12:09:13 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -406,7 +406,7 @@ bool
 pmap_md_tlb_check_entry(void *ctx, vaddr_t va, tlb_asid_t asid, pt_entry_t pte)
 {
 	pmap_t pm = ctx;
-struct pmap_asid_info * const pai = PMAP_PAI(pm, curcpu()->ci_tlb_info);
+	struct pmap_asid_info * const pai = PMAP_PAI(pm, curcpu()->ci_tlb_info);
 
 	if (asid != pai->pai_asid)
 		return true;



CVS commit: src/sys/arch/powerpc/booke

2023-04-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  7 12:09:13 UTC 2023

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c

Log Message:
Spaces to TAB


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/booke/booke_pmap.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/powerpc/booke/dev

2022-09-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Sep 18 13:09:17 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.57 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.58
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.57	Sat May  7 05:01:29 2022
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Sun Sep 18 13:09:17 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.57 2022/05/07 05:01:29 rin Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.58 2022/09/18 13:09:17 thorpej Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.57 2022/05/07 05:01:29 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.58 2022/09/18 13:09:17 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2331,7 +2331,7 @@ pq3etsec_ifstart(struct ifnet *ifp)
 {
 	struct pq3etsec_softc * const sc = ifp->if_softc;
 
-	if (__predict_false((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)) {
+	if (__predict_false((ifp->if_flags & IFF_RUNNING) == 0)) {
 		return;
 	}
 
@@ -2347,8 +2347,6 @@ pq3etsec_tx_error(
 
 	pq3etsec_txq_consume(sc, txq);
 
-	if (pq3etsec_txq_fillable_p(sc, txq))
-		sc->sc_if.if_flags &= ~IFF_OACTIVE;
 	if (sc->sc_txerrors
 	& (IEVENT_LC | IEVENT_CRL | IEVENT_XFUN | IEVENT_BABT)) {
 	} else if (sc->sc_txerrors & IEVENT_EBERR) {
@@ -2358,7 +2356,6 @@ pq3etsec_tx_error(
 		etsec_write(sc, TSTAT, TSTAT_THLT & txq->txq_qmask);
 	if (!pq3etsec_txq_enqueue(sc, txq)) {
 		sc->sc_ev_tx_stall.ev_count++;
-		sc->sc_if.if_flags |= IFF_OACTIVE;
 	}
 
 	sc->sc_txerrors = 0;
@@ -2531,9 +2528,6 @@ pq3etsec_soft_intr(void *arg)
 		if (!pq3etsec_txq_consume(sc, >sc_txq)
 		|| !pq3etsec_txq_enqueue(sc, >sc_txq)) {
 			sc->sc_ev_tx_stall.ev_count++;
-			ifp->if_flags |= IFF_OACTIVE;
-		} else {
-			ifp->if_flags &= ~IFF_OACTIVE;
 		}
 		imask |= IEVENT_TXF;
 	}



CVS commit: src/sys/arch/powerpc/booke/dev

2022-09-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Sep 18 13:09:17 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/pci

2022-07-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jul 22 19:55:38 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke/pci: pq3pci.c

Log Message:
Stop using deprecated proplib functions.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke/pci/pq3pci.c
diff -u src/sys/arch/powerpc/booke/pci/pq3pci.c:1.31 src/sys/arch/powerpc/booke/pci/pq3pci.c:1.32
--- src/sys/arch/powerpc/booke/pci/pq3pci.c:1.31	Sat May  7 05:08:16 2022
+++ src/sys/arch/powerpc/booke/pci/pq3pci.c	Fri Jul 22 19:55:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3pci.c,v 1.31 2022/05/07 05:08:16 rin Exp $	*/
+/*	$NetBSD: pq3pci.c,v 1.32 2022/07/22 19:55:38 thorpej Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -39,7 +39,7 @@
 #define	__INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.31 2022/05/07 05:08:16 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.32 2022/07/22 19:55:38 thorpej Exp $");
 
 #include "locators.h"
 
@@ -712,7 +712,7 @@ pq3pci_intrmap_setup(struct pq3pci_softc
 	prop_number_t pn = prop_dictionary_get(sc->sc_intrmap, "interrupt-mask");
 	KASSERT(pn != NULL);
 
-	sc->sc_intrmask = prop_number_unsigned_integer_value(pn);
+	sc->sc_intrmask = prop_number_unsigned_value(pn);
 
 	sc->sc_ih = intr_establish_xname(cnl->cnl_intrs[0], IPL_VM, IST_ONCHIP,
 	pq3pci_onchip_intr, sc, device_xname(sc->sc_dev));
@@ -1393,11 +1393,11 @@ pq3pci_intr_handle_lookup(struct pq3pci_
 	prop_number_t pn_irq = prop_dictionary_get(entry, "interrupt");
 	KASSERT(pn_irq != NULL);
 	KASSERT(prop_object_type(pn_irq) == PROP_TYPE_NUMBER);
-	int irq = prop_number_unsigned_integer_value(pn_irq);
+	int irq = prop_number_unsigned_value(pn_irq);
 	prop_number_t pn_ist = prop_dictionary_get(entry, "type");
 	KASSERT(pn_ist != NULL);
 	KASSERT(prop_object_type(pn_ist) == PROP_TYPE_NUMBER);
-	int ist = prop_number_unsigned_integer_value(pn_ist);
+	int ist = prop_number_unsigned_value(pn_ist);
 
 	return PIH_MAKE(irq, ist, 0);
 }



CVS commit: src/sys/arch/powerpc/booke/pci

2022-07-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jul 22 19:55:38 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke/pci: pq3pci.c

Log Message:
Stop using deprecated proplib functions.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke

2022-07-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jul 22 19:54:14 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
Stop using deprecated proplib functions.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.46 src/sys/arch/powerpc/booke/e500_intr.c:1.47
--- src/sys/arch/powerpc/booke/e500_intr.c:1.46	Wed Mar 16 20:31:01 2022
+++ src/sys/arch/powerpc/booke/e500_intr.c	Fri Jul 22 19:54:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.46 2022/03/16 20:31:01 andvar Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.47 2022/07/22 19:54:14 thorpej Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.46 2022/03/16 20:31:01 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.47 2022/07/22 19:54:14 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mpc85xx.h"
@@ -480,7 +480,7 @@ e500_intr_external_name_lookup(int irq)
 	KASSERT(irqname != NULL);
 	KASSERT(prop_object_type(irqname) == PROP_TYPE_STRING);
 
-	return prop_string_cstring_nocopy(irqname);
+	return prop_string_value(irqname);
 }
 
 static const char *



CVS commit: src/sys/arch/powerpc/booke

2022-07-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jul 22 19:54:14 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
Stop using deprecated proplib functions.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke

2022-07-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jul 22 19:52:29 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke: board_prop.c

Log Message:
Drop using deprecated proplib functions.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/booke/board_prop.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/powerpc/booke/board_prop.c
diff -u src/sys/arch/powerpc/booke/board_prop.c:1.2 src/sys/arch/powerpc/booke/board_prop.c:1.3
--- src/sys/arch/powerpc/booke/board_prop.c:1.2	Tue Jan 18 01:02:52 2011
+++ src/sys/arch/powerpc/booke/board_prop.c	Fri Jul 22 19:52:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: board_prop.c,v 1.2 2011/01/18 01:02:52 matt Exp $	*/
+/*	$NetBSD: board_prop.c,v 1.3 2022/07/22 19:52:29 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2004 Shigeyuki Fukushima.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: board_prop.c,v 1.2 2011/01/18 01:02:52 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: board_prop.c,v 1.3 2022/07/22 19:52:29 thorpej Exp $");
 
 #include 
 #include 
@@ -85,8 +85,7 @@ board_info_get_number(const char *name)
 	KASSERT(board_properties != NULL);
 	prop_number_t pn = prop_dictionary_get(board_properties, name);
 	KASSERT(pn != NULL);
-	const uint64_t number = prop_number_unsigned_integer_value(pn);
-	/* XXX -- do we need object release pn? */
+	const uint64_t number = prop_number_unsigned_value(pn);
 	return number;
 }
 
@@ -94,7 +93,7 @@ void
 board_info_add_number(const char *name, uint64_t number)
 {
 	KASSERT(board_properties != NULL);
-	prop_number_t pn = prop_number_create_integer(number);
+	prop_number_t pn = prop_number_create_unsigned(number);
 	KASSERT(pn != NULL);
 	if (prop_dictionary_set(board_properties, name, pn) == false)
 		panic("%s: setting %s failed", __func__, name);
@@ -105,7 +104,7 @@ void
 board_info_add_data(const char *name, const void *data, size_t len)
 {
 	KASSERT(board_properties != NULL);
-	prop_data_t pd = prop_data_create_data(data, len);
+	prop_data_t pd = prop_data_create_copy(data, len);
 	KASSERT(pd != NULL);
 	if (prop_dictionary_set(board_properties, name, pd) == false)
 		panic("%s: setting %s failed", __func__, name);
@@ -119,15 +118,14 @@ board_info_get_data(const char *name, si
 	prop_data_t pd = prop_dictionary_get(board_properties, name);
 	KASSERT(pd != NULL);
 	*lenp = prop_data_size(pd);
-	/* XXX -- do we need object release pn? */
-	return prop_data_data(pd);
+	return prop_data_value(pd);
 }
 
 void
 board_info_add_string(const char *name, const char *data)
 {
 	KASSERT(board_properties != NULL);
-	prop_string_t ps = prop_string_create_cstring(data);
+	prop_string_t ps = prop_string_create_copy(data);
 	KASSERT(ps != NULL);
 	if (prop_dictionary_set(board_properties, name, ps) == false)
 		panic("%s: setting %s failed", __func__, name);



CVS commit: src/sys/arch/powerpc/booke

2022-07-22 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jul 22 19:52:29 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke: board_prop.c

Log Message:
Drop using deprecated proplib functions.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/booke/board_prop.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/powerpc/booke/pci

2022-05-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 05:08:16 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke/pci: pq3pci.c

Log Message:
Downgrade pq3pci_intrsources_lock and pq3pci_msigroups_lock from
spin to adaptive mutexes.

These locks are typically used during autoconf(9), not from
interrupt context.

Found by LOCKDEBUG.

XXX
I'm not sure whether these locks are really necessary...
Similar codes, e.g. in powerpc/pic/intr.c, do not use any locks.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke/pci

2022-05-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 05:08:16 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke/pci: pq3pci.c

Log Message:
Downgrade pq3pci_intrsources_lock and pq3pci_msigroups_lock from
spin to adaptive mutexes.

These locks are typically used during autoconf(9), not from
interrupt context.

Found by LOCKDEBUG.

XXX
I'm not sure whether these locks are really necessary...
Similar codes, e.g. in powerpc/pic/intr.c, do not use any locks.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke/pci/pq3pci.c
diff -u src/sys/arch/powerpc/booke/pci/pq3pci.c:1.30 src/sys/arch/powerpc/booke/pci/pq3pci.c:1.31
--- src/sys/arch/powerpc/booke/pci/pq3pci.c:1.30	Tue Jan 11 22:45:56 2022
+++ src/sys/arch/powerpc/booke/pci/pq3pci.c	Sat May  7 05:08:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3pci.c,v 1.30 2022/01/11 22:45:56 andvar Exp $	*/
+/*	$NetBSD: pq3pci.c,v 1.31 2022/05/07 05:08:16 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -39,7 +39,7 @@
 #define	__INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.30 2022/01/11 22:45:56 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.31 2022/05/07 05:08:16 rin Exp $");
 
 #include "locators.h"
 
@@ -727,8 +727,11 @@ static int
 pq3pci_once_init(void)
 {
 
-	mutex_init(_intrsources_lock, MUTEX_DEFAULT, IPL_VM);
-	mutex_init(_msigroups_lock, MUTEX_DEFAULT, IPL_VM);
+	/*
+	 * XXX necessary??
+	 */
+	mutex_init(_intrsources_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(_msigroups_lock, MUTEX_DEFAULT, IPL_NONE);
 
 	return 0;
 }
@@ -1209,7 +1212,7 @@ pq3pci_msi_alloc_one(int ipl)
 	uint32_t bitmap[maplen];
 	pci_intr_handle_t handle;
 
-	mutex_spin_enter(_msigroups_lock);
+	mutex_enter(_msigroups_lock);
 	for (u_int i = 0; i < maplen; i++) {
 		struct pq3pci_msigroup * const msig = pq3pci_msigroups[i];
 		if (msig == NULL) {
@@ -1237,20 +1240,20 @@ pq3pci_msi_alloc_one(int ipl)
 			struct pq3pci_msihand * const msih __diagused =
 			pq3pci_msi_claim(handle);
 			KASSERT(msih != NULL);
-			mutex_spin_exit(_msigroups_lock);
+			mutex_exit(_msigroups_lock);
 			return handle;
 		}
 	}
 
 	if (freegroup-- == 0) {
-		mutex_spin_exit(_msigroups_lock);
+		mutex_exit(_msigroups_lock);
 		return 0;
 	}
 
 	struct pq3pci_msigroup * const msig =
 	kmem_zalloc(sizeof(*msig), KM_NOSLEEP);
 	if (msig == NULL) {
-		mutex_spin_exit(_msigroups_lock);
+		mutex_exit(_msigroups_lock);
 		return 0;
 	}
 	pq3pci_msi_group_setup(msig, freegroup, ipl);
@@ -1259,7 +1262,7 @@ pq3pci_msi_alloc_one(int ipl)
 	struct pq3pci_msihand * const msih __diagused =
 	pq3pci_msi_claim(handle);
 	KASSERT(msih != NULL);
-	mutex_spin_exit(_msigroups_lock);
+	mutex_exit(_msigroups_lock);
 	return handle;
 }
 
@@ -1327,17 +1330,17 @@ static struct pq3pci_intrsource *
 pq3pci_intr_source_lookup(struct pq3pci_softc *sc, pci_intr_handle_t handle)
 {
 	struct pq3pci_intrsource *pis;
-	mutex_spin_enter(_intrsources_lock);
+	mutex_enter(_intrsources_lock);
 	SIMPLEQ_FOREACH(pis, _intrsources, pis_link) {
 		if (pis->pis_handle == handle) {
-			mutex_spin_exit(_intrsources_lock);
+			mutex_exit(_intrsources_lock);
 			return pis;
 		}
 	}
 	pis = kmem_zalloc(sizeof(*pis), KM_NOSLEEP);
 	if (pis != NULL)
 		pq3pci_intr_source_setup(sc, pis, handle);
-	mutex_spin_exit(_intrsources_lock);
+	mutex_exit(_intrsources_lock);
 	return pis;
 }
 



CVS commit: src/sys/arch/powerpc/booke/dev

2022-05-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 05:01:29 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Obsolete mdio_lock for pq3mdio_mii_{read,write}reg().

Callers (mii(4) layer and atphy(4) driver) acquire mii_lock() for
this purpose.

Found by LOCKDEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.56 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.57
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.56	Sat Aug  7 16:19:02 2021
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Sat May  7 05:01:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.56 2021/08/07 16:19:02 thorpej Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.57 2022/05/07 05:01:29 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.56 2021/08/07 16:19:02 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.57 2022/05/07 05:01:29 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -251,8 +251,6 @@ struct pq3etsec_softc {
 struct pq3mdio_softc {
 	device_t mdio_dev;
 
-	kmutex_t *mdio_lock;
-
 	bus_space_tag_t mdio_bst;
 	bus_space_handle_t mdio_bsh;
 };
@@ -380,7 +378,6 @@ pq3mdio_attach(device_t parent, device_t
 	struct cpunode_locators * const cnl = >cna_locs;
 
 	mdio->mdio_dev = self;
-	mdio->mdio_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_SOFTNET);
 
 	if (device_is_a(parent, "cpunode")) {
 		struct cpunode_softc * const psc = device_private(parent);
@@ -416,8 +413,6 @@ pq3mdio_mii_readreg(device_t self, int p
 	struct pq3mdio_softc * const mdio = device_private(self);
 	uint32_t miimcom = etsec_mdio_read(mdio, MIIMCOM);
 
-	mutex_enter(mdio->mdio_lock);
-
 	etsec_mdio_write(mdio, MIIMADD,
 	__SHIFTIN(phy, MIIMADD_PHY) | __SHIFTIN(reg, MIIMADD_REG));
 
@@ -436,7 +431,6 @@ pq3mdio_mii_readreg(device_t self, int p
 	aprint_normal_dev(mdio->mdio_dev, "%s: phy %d reg %d: %#x\n",
 	__func__, phy, reg, data);
 #endif
-	mutex_exit(mdio->mdio_lock);
 	return 0;
 }
 
@@ -451,8 +445,6 @@ pq3mdio_mii_writereg(device_t self, int 
 	__func__, phy, reg, data);
 #endif
 
-	mutex_enter(mdio->mdio_lock);
-
 	etsec_mdio_write(mdio, MIIMADD,
 	__SHIFTIN(phy, MIIMADD_PHY) | __SHIFTIN(reg, MIIMADD_REG));
 	etsec_mdio_write(mdio, MIIMCOM, 0);	/* clear any past bits */
@@ -466,8 +458,6 @@ pq3mdio_mii_writereg(device_t self, int 
 	if (miimcom == MIIMCOM_SCAN)
 		etsec_mdio_write(mdio, MIIMCOM, miimcom);
 
-	mutex_exit(mdio->mdio_lock);
-
 	return 0;
 }
 



CVS commit: src/sys/arch/powerpc/booke/dev

2022-05-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 05:01:29 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Obsolete mdio_lock for pq3mdio_mii_{read,write}reg().

Callers (mii(4) layer and atphy(4) driver) acquire mii_lock() for
this purpose.

Found by LOCKDEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke

2022-05-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 04:19:22 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke: trap_subr.S

Log Message:
Make this assemble correctly with clang.

At the moment, clang wrongly handles m[ft]sprgN (N >= 4);
use m[ft]spr for SPR_SPRGN instead.

Now, clang-compiled kernel seems working just fine on my RB800!


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/booke/trap_subr.S

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/powerpc/booke/trap_subr.S
diff -u src/sys/arch/powerpc/booke/trap_subr.S:1.13 src/sys/arch/powerpc/booke/trap_subr.S:1.14
--- src/sys/arch/powerpc/booke/trap_subr.S:1.13	Mon Jul  6 10:16:12 2020
+++ src/sys/arch/powerpc/booke/trap_subr.S	Sat May  7 04:19:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap_subr.S,v 1.13 2020/07/06 10:16:12 rin Exp $	*/
+/*	$NetBSD: trap_subr.S,v 1.14 2022/05/07 04:19:22 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-RCSID("$NetBSD: trap_subr.S,v 1.13 2020/07/06 10:16:12 rin Exp $")
+RCSID("$NetBSD: trap_subr.S,v 1.14 2022/05/07 04:19:22 rin Exp $")
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -68,15 +68,20 @@ RCSID("$NetBSD: trap_subr.S,v 1.13 2020/
 	 * needed, saves sprg3, and then refers to the save using a
 	 * displacement of -amount.
 	 */
+	/*
+	 * XXXclang
+	 * At the moment, clang cannot correctly assemble m[ft]sprgN
+	 * (N >= 4); use m[ft]spr for SPR_SPRGN instead.
+	 */
 #define	FRAME_EXC_PROLOGUE(start, sprg, srr)\
-	mt##sprg %r2;			/* save r2 */			\
+	mtspr	sprg,%r2;		/* save r2 */			\
 	mfsprg3	%r2;			/* get save_area pointer */	\
 	addi	%r2,%r2,4*(32-start);	\
 	/* allocate save area */	\
 	mtsprg3	%r2;			/* save updated pointer */	\
 	stmw	%r##start,-4*(32-start)(%r2);\
 	/* free r24-r31 for use */	\
-	mf##sprg %r26;			/* get saved r2 */		\
+	mfspr	%r26,sprg;		/* get saved r2 */		\
 	mfcr	%r27;			/* get Condition Register */	\
 	mfxer	%r28;			/* get XER */			\
 	mfspr	%r30, SPR_##srr##0;	/* get SRR0 */			\
@@ -103,41 +108,41 @@ RCSID("$NetBSD: trap_subr.S,v 1.13 2020/
 mtsrr1	r
 
 #define	FRAME_PROLOGUE		\
-	FRAME_EXC_PROLOGUE(26, sprg1, SRR)
+	FRAME_EXC_PROLOGUE(26, SPR_SPRG1, SRR)
 
 #define	FRAME_PROLOGUE_DEAR_ESR	\
-	FRAME_EXC_PROLOGUE(24, sprg1, SRR); \
+	FRAME_EXC_PROLOGUE(24, SPR_SPRG1, SRR); \
 	PROLOGUE_GET_ESR; \
 	PROLOGUE_GET_DEAR
 
 #define	FRAME_PROLOGUE_ESR	\
-	FRAME_EXC_PROLOGUE(25, sprg1, SRR); \
+	FRAME_EXC_PROLOGUE(25, SPR_SPRG1, SRR); \
 	PROLOGUE_GET_ESR
 
 #define	FRAME_TLBPROLOGUE	\
-	FRAME_EXC_PROLOGUE(20, sprg1, SRR); \
+	FRAME_EXC_PROLOGUE(20, SPR_SPRG1, SRR); \
 	PROLOGUE_GET_ESR; \
 	PROLOGUE_GET_DEAR
 
 #define	FRAME_INTR_PROLOGUE	\
-	FRAME_EXC_PROLOGUE(26, sprg1, SRR)
+	FRAME_EXC_PROLOGUE(26, SPR_SPRG1, SRR)
 
 /*
  * These need to save SRR0/SRR1 as well their SRR0/SRR1 in case normal
  * exceptions happened during their execution.
  */
 #define	FRAME_CRIT_PROLOGUE	\
-	FRAME_EXC_PROLOGUE(24, sprg4, CSRR); \
+	FRAME_EXC_PROLOGUE(24, SPR_SPRG4, CSRR); \
 	PROLOGUE_GET_SPRG1; \
 	PROLOGUE_GET_SRRS
 
 #define	FRAME_MCHK_PROLOGUE	\
-	FRAME_EXC_PROLOGUE(24, sprg5, MCSRR); \
+	FRAME_EXC_PROLOGUE(24, SPR_SPRG5, MCSRR); \
 	PROLOGUE_GET_SPRG1; \
 	PROLOGUE_GET_SRRS
 
 #define	FRAME_DEBUG_PROLOGUE	\
-	FRAME_EXC_PROLOGUE(24, sprg4, CSRR); \
+	FRAME_EXC_PROLOGUE(24, SPR_SPRG4, CSRR); \
 	PROLOGUE_GET_SPRG1; \
 	PROLOGUE_GET_SRRS
 



CVS commit: src/sys/arch/powerpc/booke

2022-05-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May  7 04:19:22 UTC 2022

Modified Files:
src/sys/arch/powerpc/booke: trap_subr.S

Log Message:
Make this assemble correctly with clang.

At the moment, clang wrongly handles m[ft]sprgN (N >= 4);
use m[ft]spr for SPR_SPRGN instead.

Now, clang-compiled kernel seems working just fine on my RB800!


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/booke/trap_subr.S

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



CVS commit: src/sys/arch/powerpc/booke/dev

2021-04-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Apr 22 01:33:18 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Fix rnd(9) support; events were not sampled actually in the previous.

Remove #if-0'ed and wrap long line for clarity.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev

2021-04-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Apr 22 01:33:18 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Fix rnd(9) support; events were not sampled actually in the previous.

Remove #if-0'ed and wrap long line for clarity.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.52 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.53
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.52	Sun Jan 24 05:16:56 2021
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Thu Apr 22 01:33:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.52 2021/01/24 05:16:56 rin Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.53 2021/04/22 01:33:18 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.52 2021/01/24 05:16:56 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.53 2021/04/22 01:33:18 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1640,14 +1640,14 @@ pq3etsec_rxq_consume(
 			rxq->rxq_consumer = consumer;
 			rxq->rxq_inuse -= rxconsumed;
 			KASSERT(rxq->rxq_inuse == 0);
-			return;
+			break;
 		}
 		pq3etsec_rxq_desc_postsync(sc, rxq, consumer, 1);
 		const uint16_t rxbd_flags = consumer->rxbd_flags;
 		if (rxbd_flags & RXBD_E) {
 			rxq->rxq_consumer = consumer;
 			rxq->rxq_inuse -= rxconsumed;
-			return;
+			break;
 		}
 		KASSERT(rxq->rxq_mconsumer != NULL);
 #ifdef ETSEC_DEBUG
@@ -2178,6 +2178,7 @@ pq3etsec_txq_consume(
 	struct ifnet * const ifp = >sc_if;
 	volatile struct txbd *consumer = txq->txq_consumer;
 	size_t txfree = 0;
+	bool ret;
 
 #if 0
 	printf("%s: entry: free=%zu\n", __func__, txq->txq_free);
@@ -2189,13 +2190,11 @@ pq3etsec_txq_consume(
 			txq->txq_consumer = consumer;
 			txq->txq_free += txfree;
 			txq->txq_lastintr -= uimin(txq->txq_lastintr, txfree);
-#if 0
-			printf("%s: empty: freed %zu descriptors going form %zu to %zu\n",
-			__func__, txfree, txq->txq_free - txfree, txq->txq_free);
-#endif
 			KASSERT(txq->txq_lastintr == 0);
-			KASSERT(txq->txq_free == txq->txq_last - txq->txq_first - 1);
-			return true;
+			KASSERT(txq->txq_free ==
+			txq->txq_last - txq->txq_first - 1);
+			ret = true;
+			break;
 		}
 		pq3etsec_txq_desc_postsync(sc, txq, consumer, 1);
 		const uint16_t txbd_flags = consumer->txbd_flags;
@@ -2203,11 +2202,8 @@ pq3etsec_txq_consume(
 			txq->txq_consumer = consumer;
 			txq->txq_free += txfree;
 			txq->txq_lastintr -= uimin(txq->txq_lastintr, txfree);
-#if 0
-			printf("%s: freed %zu descriptors\n",
-			__func__, txfree);
-#endif
-			return pq3etsec_txq_fillable_p(sc, txq);
+			ret = pq3etsec_txq_fillable_p(sc, txq);
+			break;
 		}
 
 		/*
@@ -2274,6 +2270,7 @@ pq3etsec_txq_consume(
 
 	if (txfree != 0)
 		rnd_add_uint32(>rnd_source, txfree);
+	return ret;
 }
 
 static void



CVS commit: src/sys/arch/powerpc/booke

2021-03-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Mar 30 14:29:54 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke: booke_machdep.c

Log Message:
- Write-back msgbuf and update bootstr for reboot from halt.
- Remove dead code.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/booke/booke_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/powerpc/booke/booke_machdep.c
diff -u src/sys/arch/powerpc/booke/booke_machdep.c:1.32 src/sys/arch/powerpc/booke/booke_machdep.c:1.33
--- src/sys/arch/powerpc/booke/booke_machdep.c:1.32	Mon Jul  6 10:08:16 2020
+++ src/sys/arch/powerpc/booke/booke_machdep.c	Tue Mar 30 14:29:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_machdep.c,v 1.32 2020/07/06 10:08:16 rin Exp $	*/
+/*	$NetBSD: booke_machdep.c,v 1.33 2021/03/30 14:29:54 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 #define	_POWERPC_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.32 2020/07/06 10:08:16 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.33 2021/03/30 14:29:54 rin Exp $");
 
 #include "ksyms.h"
 
@@ -288,15 +288,6 @@ cpu_reboot(int howto, char *what)
 		cnpollc(1);	/* For proper keyboard command handling */
 		cngetc();
 		cnpollc(0);
-
-		printf("rebooting...\n\n");
-		goto reboot;	/* XXX for now... */
-
-#ifdef DDB
-		printf("dropping to debugger\n");
-		while(1)
-			Debugger();
-#endif
 	}
 
 	printf("rebooting\n\n");
@@ -321,7 +312,6 @@ cpu_reboot(int howto, char *what)
 	/* flush cache for msgbuf */
 	dcache_wb(msgbuf_paddr, round_page(MSGBUFSIZE));
 
- reboot:
 	__asm volatile("msync; isync");
 	(*cpu_md_ops.md_cpu_reset)();
 



CVS commit: src/sys/arch/powerpc/booke

2021-03-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Mar 30 14:29:54 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke: booke_machdep.c

Log Message:
- Write-back msgbuf and update bootstr for reboot from halt.
- Remove dead code.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/booke/booke_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/powerpc/booke/dev

2021-01-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jan 24 05:16:57 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Add rnd(9) support.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.51 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.52
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.51	Sun Jan 24 05:14:55 2021
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Sun Jan 24 05:16:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.51 2021/01/24 05:14:55 rin Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.52 2021/01/24 05:16:56 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.51 2021/01/24 05:14:55 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.52 2021/01/24 05:16:56 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -58,6 +58,8 @@ __KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -237,6 +239,8 @@ struct pq3etsec_softc {
 	int sc_ic_rx_count;
 	int sc_ic_tx_time;
 	int sc_ic_tx_count;
+
+	krndsource_t rnd_source;
 };
 
 #define	ETSEC_IC_RX_ENABLED(sc)		\
@@ -808,6 +812,9 @@ pq3etsec_attach(device_t parent, device_
 	if_deferred_start_init(ifp, NULL);
 	ether_ifattach(ifp, enaddr);
 
+	rnd_attach_source(>rnd_source, xname, RND_TYPE_NET,
+	RND_FLAG_DEFAULT);
+
 	pq3etsec_ifstop(ifp, true);
 
 	evcnt_attach_dynamic(>sc_ev_rx_stall, EVCNT_TYPE_MISC,
@@ -1714,6 +1721,9 @@ pq3etsec_rxq_consume(
 		KASSERT(rxq->rxq_mbufs[consumer - rxq->rxq_first] == rxq->rxq_mconsumer);
 #endif
 	}
+
+	if (rxconsumed != 0)
+		rnd_add_uint32(>rnd_source, rxconsumed);
 }
 
 static void
@@ -2261,6 +2271,9 @@ pq3etsec_txq_consume(
 			KASSERT(consumer < txq->txq_last);
 		}
 	}
+
+	if (txfree != 0)
+		rnd_add_uint32(>rnd_source, txfree);
 }
 
 static void



CVS commit: src/sys/arch/powerpc/booke/dev

2021-01-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jan 24 05:16:57 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Add rnd(9) support.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev

2021-01-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jan 24 05:14:55 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Switch to if_percpuq_enqueue() from if_input().


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.50 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.51
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.50	Mon Jul  6 09:34:16 2020
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Sun Jan 24 05:14:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.50 2020/07/06 09:34:16 rin Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.51 2021/01/24 05:14:55 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.50 2020/07/06 09:34:16 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.51 2021/01/24 05:14:55 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -804,8 +804,9 @@ pq3etsec_attach(device_t parent, device_
 		goto fail_10;
 	}
 	pq3etsec_sysctl_setup(NULL, sc);
+	if_attach(ifp);
+	if_deferred_start_init(ifp, NULL);
 	ether_ifattach(ifp, enaddr);
-	if_register(ifp);
 
 	pq3etsec_ifstop(ifp, true);
 
@@ -1613,9 +1614,7 @@ pq3etsec_rx_input(
 	/*
 	 * Let's give it to the network subsystm to deal with.
 	 */
-	int s = splnet();
-	if_input(ifp, m);
-	splx(s);
+	if_percpuq_enqueue(ifp->if_percpuq, m);
 }
 
 static void



CVS commit: src/sys/arch/powerpc/booke/dev

2021-01-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jan 24 05:14:55 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Switch to if_percpuq_enqueue() from if_input().


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke

2021-01-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jan  6 08:04:58 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Sort headers. Also, use  instead of db_interface.h and
db_machdep.h in order not to be bothered by subtle include order.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/powerpc/booke/trap.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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.35 src/sys/arch/powerpc/booke/trap.c:1.36
--- src/sys/arch/powerpc/booke/trap.c:1.35	Thu Sep 10 02:45:28 2020
+++ src/sys/arch/powerpc/booke/trap.c	Wed Jan  6 08:04:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.35 2020/09/10 02:45:28 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.36 2021/01/06 08:04:57 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.35 2020/09/10 02:45:28 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.36 2021/01/06 08:04:57 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -43,34 +43,32 @@ __KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.3
 #endif
 
 #include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
+#include 
+#include 
 #include 
+#include 
+#include 
+
+#include 
 
 #include 
 
+#include 		/* use same interface for SPE */
+#include 
 #include 
-#include 
 #include 
-#include 
-#include 		/* use same interface for SPE */
-
 #include 
-#include 
-#include 
+#include 
+#include 
 
 #include 
 
-#include 
-#include 
-
-#include 
-#include 
+#include 
 #include 
+#include 
+#include 
 
 void trap(enum ppc_booke_exceptions, struct trapframe *);
 



CVS commit: src/sys/arch/powerpc/booke

2021-01-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jan  6 08:04:58 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Sort headers. Also, use  instead of db_interface.h and
db_machdep.h in order not to be bothered by subtle include order.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/powerpc/booke/trap.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/powerpc/booke

2021-01-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jan  6 07:56:20 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c

Log Message:
Fix pmap_procwr() for powerpc/booke:

- Use PAGE_MASK, not PAGE_SIZE, to calculate page offset.
- Do not drop page offset of target address.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/booke/booke_pmap.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/powerpc/booke/booke_pmap.c
diff -u src/sys/arch/powerpc/booke/booke_pmap.c:1.30 src/sys/arch/powerpc/booke/booke_pmap.c:1.31
--- src/sys/arch/powerpc/booke/booke_pmap.c:1.30	Sun Dec 20 16:38:25 2020
+++ src/sys/arch/powerpc/booke/booke_pmap.c	Wed Jan  6 07:56:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_pmap.c,v 1.30 2020/12/20 16:38:25 skrll Exp $	*/
+/*	$NetBSD: booke_pmap.c,v 1.31 2021/01/06 07:56:19 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define __PMAP_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.30 2020/12/20 16:38:25 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.31 2021/01/06 07:56:19 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -62,7 +62,7 @@ void
 pmap_procwr(struct proc *p, vaddr_t va, size_t len)
 {
 	struct pmap * const pmap = p->p_vmspace->vm_map.pmap;
-	vsize_t off = va & PAGE_SIZE;
+	vsize_t off = va & PAGE_MASK;
 
 	kpreempt_disable();
 	for (const vaddr_t eva = va + len; va < eva; off = 0) {
@@ -78,8 +78,8 @@ pmap_procwr(struct proc *p, vaddr_t va, 
 			continue;
 		}
 		kpreempt_enable();
-		dcache_wb(pte_to_paddr(pt_entry), segeva - va);
-		icache_inv(pte_to_paddr(pt_entry), segeva - va);
+		dcache_wb(pte_to_paddr(pt_entry) + off, segeva - va);
+		icache_inv(pte_to_paddr(pt_entry) + off, segeva - va);
 		kpreempt_disable();
 		va = segeva;
 	}



CVS commit: src/sys/arch/powerpc/booke

2021-01-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jan  6 07:56:20 UTC 2021

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c

Log Message:
Fix pmap_procwr() for powerpc/booke:

- Use PAGE_MASK, not PAGE_SIZE, to calculate page offset.
- Do not drop page offset of target address.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/booke/booke_pmap.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/powerpc/booke/pci

2020-11-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Nov 12 00:44:22 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke/pci: pq3pci.c

Log Message:
pq3pci_msi_claim(): remove KASSERT that is valid when allocating MSI
vectors, while apparently invalid when freeing them.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke/pci

2020-11-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Nov 12 00:44:22 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke/pci: pq3pci.c

Log Message:
pq3pci_msi_claim(): remove KASSERT that is valid when allocating MSI
vectors, while apparently invalid when freeing them.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke/pci/pq3pci.c
diff -u src/sys/arch/powerpc/booke/pci/pq3pci.c:1.26 src/sys/arch/powerpc/booke/pci/pq3pci.c:1.27
--- src/sys/arch/powerpc/booke/pci/pq3pci.c:1.26	Thu Nov 12 00:37:51 2020
+++ src/sys/arch/powerpc/booke/pci/pq3pci.c	Thu Nov 12 00:44:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3pci.c,v 1.26 2020/11/12 00:37:51 rin Exp $	*/
+/*	$NetBSD: pq3pci.c,v 1.27 2020/11/12 00:44:22 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -39,7 +39,7 @@
 #define	__INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.26 2020/11/12 00:37:51 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.27 2020/11/12 00:44:22 rin Exp $");
 
 #include "locators.h"
 
@@ -1196,7 +1196,6 @@ pq3pci_msi_claim(pci_intr_handle_t handl
 	KASSERT(msig != NULL);
 	struct pq3pci_msihand * const msih = >msig_ihands[irq & 31];
 	mutex_spin_enter(>msig_lock);
-	KASSERT(msig->msig_free_mask & irq_mask);
 	msig->msig_free_mask ^= irq_mask;
 	mutex_spin_exit(>msig_lock);
 	return msih;



CVS commit: src/sys/arch/powerpc/booke/pci

2020-11-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Nov 12 00:37:51 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke/pci: pq3pci.c

Log Message:
Oops, forget to commit local change necessary to support nvme(4) on RB800;
provide pci_intr_setattr(9) (no-op).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke/pci/pq3pci.c
diff -u src/sys/arch/powerpc/booke/pci/pq3pci.c:1.25 src/sys/arch/powerpc/booke/pci/pq3pci.c:1.26
--- src/sys/arch/powerpc/booke/pci/pq3pci.c:1.25	Tue Jul  7 03:38:48 2020
+++ src/sys/arch/powerpc/booke/pci/pq3pci.c	Thu Nov 12 00:37:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3pci.c,v 1.25 2020/07/07 03:38:48 thorpej Exp $	*/
+/*	$NetBSD: pq3pci.c,v 1.26 2020/11/12 00:37:51 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -39,7 +39,7 @@
 #define	__INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.25 2020/07/07 03:38:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.26 2020/11/12 00:37:51 rin Exp $");
 
 #include "locators.h"
 
@@ -1753,6 +1753,7 @@ pq3pci_pci_chipset_init(struct pq3pci_so
 	pc->pc_intr_type = pq3pci_intr_type;
 	pc->pc_intr_alloc = pq3pci_intr_alloc;
 	pc->pc_intr_release = pq3pci_intr_release;
+	pc->pc_intr_setattr = genppc_pci_intr_setattr;
 	pc->pc_intx_alloc = genppc_pci_intx_alloc;
 
 	pc->pc_msi_v = sc;



CVS commit: src/sys/arch/powerpc/booke/pci

2020-11-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Nov 12 00:37:51 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke/pci: pq3pci.c

Log Message:
Oops, forget to commit local change necessary to support nvme(4) on RB800;
provide pci_intr_setattr(9) (no-op).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke

2020-09-09 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Sep 10 02:45:28 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Fix build with UVMHIST; stop passing string literal to UVMHIST_LOG(),
and also cast pointer arguments into uintptr_t.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/powerpc/booke/trap.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/powerpc/booke

2020-09-09 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Sep 10 02:45:28 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Fix build with UVMHIST; stop passing string literal to UVMHIST_LOG(),
and also cast pointer arguments into uintptr_t.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/powerpc/booke/trap.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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.34 src/sys/arch/powerpc/booke/trap.c:1.35
--- src/sys/arch/powerpc/booke/trap.c:1.34	Wed Jul 15 09:10:14 2020
+++ src/sys/arch/powerpc/booke/trap.c	Thu Sep 10 02:45:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.34 2020/07/15 09:10:14 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.35 2020/09/10 02:45:28 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.34 2020/07/15 09:10:14 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.35 2020/09/10 02:45:28 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -294,12 +294,18 @@ isi_exception(struct trapframe *tf, ksig
 		KASSERT(pg);
 		struct vm_page_md * const mdpg = VM_PAGE_TO_MD(pg);
 
-		UVMHIST_LOG(pmapexechist,
-		"srr0=%#x pg=%p (pa %#"PRIxPADDR"): %s", 
-		tf->tf_srr0, pg, pa, 
-		(VM_PAGEMD_EXECPAGE_P(mdpg)
-			? "no syncicache (already execpage)"
-			: "performed syncicache (now execpage)"));
+#ifdef UVMHIST
+		if (VM_PAGEMD_EXECPAGE_P(mdpg))
+			UVMHIST_LOG(pmapexechist,
+			"srr0=%#x pg=%p (pa %#"PRIxPADDR"): "
+			"no syncicache (already execpage)", 
+			tf->tf_srr0, (uintptr_t)pg, pa, 0);
+		else
+			UVMHIST_LOG(pmapexechist,
+			"srr0=%#x pg=%p (pa %#"PRIxPADDR"): "
+			"performed syncicache (now execpage)",
+			tf->tf_srr0, (uintptr_t)pg, pa, 0);
+#endif
 
 		if (!VM_PAGEMD_EXECPAGE_P(mdpg)) {
 			ci->ci_softc->cpu_ev_exec_trap_sync.ev_count++;



CVS commit: src/sys/arch/powerpc/booke

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:44:34 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Do not use curlwp twice. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/booke/trap.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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.32 src/sys/arch/powerpc/booke/trap.c:1.33
--- src/sys/arch/powerpc/booke/trap.c:1.32	Tue Jul  7 00:49:09 2020
+++ src/sys/arch/powerpc/booke/trap.c	Wed Jul 15 07:44:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.32 2020/07/07 00:49:09 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.33 2020/07/15 07:44:34 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.32 2020/07/07 00:49:09 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.33 2020/07/15 07:44:34 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -477,10 +477,12 @@ pgm_exception(struct trapframe *tf, ksig
 	}
 
 	if (tf->tf_esr & ESR_PIL) {
-		struct pcb * const pcb = lwp_getpcb(curlwp);
-		if (__predict_false(!fpu_used_p(curlwp))) {
+		struct lwp * const l = curlwp;
+		struct pcb * const pcb = lwp_getpcb(l);
+
+		if (__predict_false(!fpu_used_p(l))) {
 			memset(>pcb_fpu, 0, sizeof(pcb->pcb_fpu));
-			fpu_mark_used(curlwp);
+			fpu_mark_used(l);
 		}
 		if (fpu_emulate(tf, >pcb_fpu, ksi)) {
 			if (ksi->ksi_signo == 0) {



CVS commit: src/sys/arch/powerpc/booke

2020-07-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jul 15 07:44:34 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Do not use curlwp twice. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/booke/trap.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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:59:30 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_tlb.c

Log Message:
Revert previous; tmpfs should be fixed instead.

Pointed out by thorpej@, thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/booke/e500_tlb.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/powerpc/booke/e500_tlb.c
diff -u src/sys/arch/powerpc/booke/e500_tlb.c:1.22 src/sys/arch/powerpc/booke/e500_tlb.c:1.23
--- src/sys/arch/powerpc/booke/e500_tlb.c:1.22	Tue Jul  7 00:28:30 2020
+++ src/sys/arch/powerpc/booke/e500_tlb.c	Tue Jul  7 00:59:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_tlb.c,v 1.22 2020/07/07 00:28:30 rin Exp $	*/
+/*	$NetBSD: e500_tlb.c,v 1.23 2020/07/07 00:59:29 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define	__PMAP_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.22 2020/07/07 00:28:30 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.23 2020/07/07 00:59:29 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -536,13 +536,6 @@ e500_tlb_invalidate_addr(vaddr_t va, tlb
 static bool
 e500_tlb_update_addr(vaddr_t va, tlb_asid_t asid, pt_entry_t pte, bool insert)
 {
-
-	/*
-	 * In case where pmap_kenter_pa(9) is called for va with page offset.
-	 * Required for tmpfs.
-	 */
-	va &= ~PAGE_MASK;
-
 #if defined(MULTIPROCESSOR)
 	e500_tlb_invalidate_addr(va, asid);
 	return true;



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:59:30 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_tlb.c

Log Message:
Revert previous; tmpfs should be fixed instead.

Pointed out by thorpej@, thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/booke/e500_tlb.c

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



Re: CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama

On 2020/07/07 9:51, Jason Thorpe wrote:

On Jul 6, 2020, at 5:28 PM, Rin Okuyama  wrote:

Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:28:31 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_tlb.c

Log Message:
Fix kernel panic due to tmpfs.

pmap for booke assumes that the ``va'' argument for pmap_kenter_pa(9) is
page-aligned. However, by recent changes, tmpfs became to use ``va'' with
page offset via ubc_uiomove(9). So, truncate it to page boundary.


This change seems wrong.  I think it needs to be fixed in tmpfs.


Thank you for your comment. OK, I will revert this and send PR.

rin


Re: CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Jason Thorpe



> On Jul 6, 2020, at 5:28 PM, Rin Okuyama  wrote:
> 
> Module Name:  src
> Committed By: rin
> Date: Tue Jul  7 00:28:31 UTC 2020
> 
> Modified Files:
>   src/sys/arch/powerpc/booke: e500_tlb.c
> 
> Log Message:
> Fix kernel panic due to tmpfs.
> 
> pmap for booke assumes that the ``va'' argument for pmap_kenter_pa(9) is
> page-aligned. However, by recent changes, tmpfs became to use ``va'' with
> page offset via ubc_uiomove(9). So, truncate it to page boundary.

This change seems wrong.  I think it needs to be fixed in tmpfs.

-- thorpej



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:49:09 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
For booke, fix signo and other siginfo returned for userland by
syncing with oea and ibm4xx.

Now, tests/kernel/t_trapsignal:bus_handle and friends pass on booke.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/booke/trap.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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.31 src/sys/arch/powerpc/booke/trap.c:1.32
--- src/sys/arch/powerpc/booke/trap.c:1.31	Tue Jul  7 00:41:32 2020
+++ src/sys/arch/powerpc/booke/trap.c	Tue Jul  7 00:49:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.31 2020/07/07 00:41:32 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.32 2020/07/07 00:49:09 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.31 2020/07/07 00:41:32 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.32 2020/07/07 00:49:09 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -112,15 +112,13 @@ mchk_exception(struct trapframe *tf, ksi
 	struct cpu_info * const ci = curcpu();
 	int rv = EFAULT;
 
-	if (usertrap)
+	if (usertrap) {
 		ci->ci_ev_umchk.ev_count++;
-
-	if (rv != 0 && usertrap) {
 		KSI_INIT_TRAP(ksi);
-		ksi->ksi_signo = SIGSEGV;
-		ksi->ksi_trap = EXC_DSI;
-		ksi->ksi_code = SEGV_ACCERR;
+		ksi->ksi_signo = SIGBUS;
+		ksi->ksi_trap = EXC_MCHK;
 		ksi->ksi_addr = (void *)faultva;
+		ksi->ksi_code = BUS_OBJERR;
 	}
 
 	return rv;
@@ -169,8 +167,6 @@ pagefault(struct vm_map *map, vaddr_t va
 		rv = uvm_fault(map, trunc_page(va), ftype);
 		if (rv == 0)
 			uvm_grow(l->l_proc, trunc_page(va));
-		if (rv == EACCES)
-			rv = EFAULT;
 	} else {
 		if (cpu_intr_p())
 			return EFAULT;
@@ -184,12 +180,33 @@ pagefault(struct vm_map *map, vaddr_t va
 			if (rv == 0)
 uvm_grow(l->l_proc, trunc_page(va));
 		}
-		if (rv == EACCES)
-			rv = EFAULT;
 	}
 	return rv;
 }
 
+static void
+vm_signal(int error, int trap, vaddr_t addr, ksiginfo_t *ksi)
+{
+
+	KSI_INIT_TRAP(ksi);
+	switch (error) {
+	case EINVAL:
+		ksi->ksi_signo = SIGBUS;
+		ksi->ksi_code = BUS_ADRERR;
+		break;
+	case EACCES:
+		ksi->ksi_signo = SIGSEGV;
+		ksi->ksi_code = SEGV_ACCERR;
+		break;
+	default:
+		ksi->ksi_signo = SIGSEGV;
+		ksi->ksi_code = SEGV_MAPERR;
+		break;
+	}
+	ksi->ksi_trap = trap;
+	ksi->ksi_addr = (void *)addr;
+}
+
 static int
 dsi_exception(struct trapframe *tf, ksiginfo_t *ksi)
 {
@@ -236,16 +253,9 @@ dsi_exception(struct trapframe *tf, ksig
 
 	int rv = pagefault(faultmap, faultva, ftype, usertrap);
 
-	/*
-	 * We can't get a MAPERR here since that's a different exception.
-	 */
 	if (__predict_false(rv != 0 && usertrap)) {
 		ci->ci_ev_udsi_fatal.ev_count++;
-		KSI_INIT_TRAP(ksi);
-		ksi->ksi_signo = SIGSEGV;
-		ksi->ksi_trap = EXC_DSI;
-		ksi->ksi_code = SEGV_ACCERR;
-		ksi->ksi_addr = (void *)faultva;
+		vm_signal(rv, EXC_DSI, faultva, ksi);
 	}
 	return rv;
 }
@@ -313,16 +323,8 @@ isi_exception(struct trapframe *tf, ksig
 	usertrap);
 
 	if (__predict_false(rv != 0 && usertrap)) {
-		/*
-		 * We can't get a MAPERR here since
-		 * that's a different exception.
-		 */
 		ci->ci_ev_isi_fatal.ev_count++;
-		KSI_INIT_TRAP(ksi);
-		ksi->ksi_signo = SIGSEGV;
-		ksi->ksi_trap = EXC_ISI;
-		ksi->ksi_code = SEGV_ACCERR;
-		ksi->ksi_addr = (void *)tf->tf_srr0; /* not truncated */
+		vm_signal(rv, EXC_ISI, tf->tf_srr0, ksi);
 	}
 	UVMHIST_LOG(pmapexechist, "<- %d", rv, 0,0,0);
 	return rv;
@@ -358,11 +360,7 @@ dtlb_exception(struct trapframe *tf, ksi
 
 	if (__predict_false(rv != 0 && usertrap)) {
 		ci->ci_ev_udsi_fatal.ev_count++;
-		KSI_INIT_TRAP(ksi);
-		ksi->ksi_signo = SIGSEGV;
-		ksi->ksi_trap = EXC_DSI;
-		ksi->ksi_code = (rv == EACCES ? SEGV_ACCERR : SEGV_MAPERR);
-		ksi->ksi_addr = (void *)faultva;
+		vm_signal(rv, EXC_DSI, faultva, ksi);
 	}
 	return rv;
 }
@@ -382,11 +380,7 @@ itlb_exception(struct trapframe *tf, ksi
 
 	if (__predict_false(rv != 0 && usertrap)) {
 		ci->ci_ev_isi_fatal.ev_count++;
-		KSI_INIT_TRAP(ksi);
-		ksi->ksi_signo = SIGSEGV;
-		ksi->ksi_trap = EXC_ISI;
-		ksi->ksi_code = (rv == EACCES ? SEGV_ACCERR : SEGV_MAPERR);
-		ksi->ksi_addr = (void *)tf->tf_srr0;
+		vm_signal(rv, EXC_ISI, tf->tf_srr0, ksi);
 	}
 	return rv;
 }
@@ -880,6 +874,7 @@ trap(enum ppc_booke_exceptions trap_code
 			p->p_pid, l->l_lid, p->p_comm,
 			l->l_cred ?  kauth_cred_geteuid(l->l_cred) : -1);
 			ksi.ksi_signo = SIGKILL;
+			ksi.ksi_code = 0;
 		}
 		if (rv != 0) {
 			/*



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:49:09 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
For booke, fix signo and other siginfo returned for userland by
syncing with oea and ibm4xx.

Now, tests/kernel/t_trapsignal:bus_handle and friends pass on booke.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/booke/trap.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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:41:32 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Do not clear pcb_onfault for error path of setfault().
This is caller's responsibility, and all the callers actually do so.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/booke/trap.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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.30 src/sys/arch/powerpc/booke/trap.c:1.31
--- src/sys/arch/powerpc/booke/trap.c:1.30	Tue Jul  7 00:37:46 2020
+++ src/sys/arch/powerpc/booke/trap.c	Tue Jul  7 00:41:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.30 2020/07/07 00:37:46 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.31 2020/07/07 00:41:32 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.30 2020/07/07 00:37:46 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.31 2020/07/07 00:41:32 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -691,7 +691,6 @@ onfaulted(struct trapframe *tf, register
 	tf->tf_fixreg[2] = fb->fb_r2;
 	tf->tf_fixreg[3] = rv;
 	memcpy(>tf_fixreg[13], fb->fb_fixreg, sizeof(fb->fb_fixreg));
-	pcb->pcb_onfault = NULL;
 	return true;
 }
 



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:41:32 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Do not clear pcb_onfault for error path of setfault().
This is caller's responsibility, and all the callers actually do so.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/booke/trap.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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:37:46 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
For booke, restore callee saved registers when recovery for page fault
fails for kernel.

OOPS! How on the earth we had overlooked this error so far...


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/booke/trap.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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:37:46 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
For booke, restore callee saved registers when recovery for page fault
fails for kernel.

OOPS! How on the earth we had overlooked this error so far...


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/booke/trap.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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.29 src/sys/arch/powerpc/booke/trap.c:1.30
--- src/sys/arch/powerpc/booke/trap.c:1.29	Mon Jul  6 10:13:02 2020
+++ src/sys/arch/powerpc/booke/trap.c	Tue Jul  7 00:37:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.29 2020/07/06 10:13:02 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.30 2020/07/07 00:37:46 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.29 2020/07/06 10:13:02 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.30 2020/07/07 00:37:46 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -690,6 +690,7 @@ onfaulted(struct trapframe *tf, register
 	tf->tf_fixreg[1] = fb->fb_sp;
 	tf->tf_fixreg[2] = fb->fb_r2;
 	tf->tf_fixreg[3] = rv;
+	memcpy(>tf_fixreg[13], fb->fb_fixreg, sizeof(fb->fb_fixreg));
 	pcb->pcb_onfault = NULL;
 	return true;
 }



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:28:31 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_tlb.c

Log Message:
Fix kernel panic due to tmpfs.

pmap for booke assumes that the ``va'' argument for pmap_kenter_pa(9) is
page-aligned. However, by recent changes, tmpfs became to use ``va'' with
page offset via ubc_uiomove(9). So, truncate it to page boundary.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/booke/e500_tlb.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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul  7 00:28:31 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_tlb.c

Log Message:
Fix kernel panic due to tmpfs.

pmap for booke assumes that the ``va'' argument for pmap_kenter_pa(9) is
page-aligned. However, by recent changes, tmpfs became to use ``va'' with
page offset via ubc_uiomove(9). So, truncate it to page boundary.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/booke/e500_tlb.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/powerpc/booke/e500_tlb.c
diff -u src/sys/arch/powerpc/booke/e500_tlb.c:1.21 src/sys/arch/powerpc/booke/e500_tlb.c:1.22
--- src/sys/arch/powerpc/booke/e500_tlb.c:1.21	Mon Jul  6 10:12:04 2020
+++ src/sys/arch/powerpc/booke/e500_tlb.c	Tue Jul  7 00:28:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_tlb.c,v 1.21 2020/07/06 10:12:04 rin Exp $	*/
+/*	$NetBSD: e500_tlb.c,v 1.22 2020/07/07 00:28:30 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,7 @@
 #define	__PMAP_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.21 2020/07/06 10:12:04 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.22 2020/07/07 00:28:30 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -536,6 +536,13 @@ e500_tlb_invalidate_addr(vaddr_t va, tlb
 static bool
 e500_tlb_update_addr(vaddr_t va, tlb_asid_t asid, pt_entry_t pte, bool insert)
 {
+
+	/*
+	 * In case where pmap_kenter_pa(9) is called for va with page offset.
+	 * Required for tmpfs.
+	 */
+	va &= ~PAGE_MASK;
+
 #if defined(MULTIPROCESSOR)
 	e500_tlb_invalidate_addr(va, asid);
 	return true;



CVS commit: src/sys/arch/powerpc/booke/dev

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:22:44 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3cfi.c pq3nandfcm.c

Log Message:
Drop unused opt_flash.h.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/booke/dev/pq3cfi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/booke/dev/pq3nandfcm.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/powerpc/booke/dev/pq3cfi.c
diff -u src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.6 src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.7
--- src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.6	Mon Jul  6 09:34:16 2020
+++ src/sys/arch/powerpc/booke/dev/pq3cfi.c	Mon Jul  6 10:22:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3cfi.c,v 1.6 2020/07/06 09:34:16 rin Exp $	*/
+/*	$NetBSD: pq3cfi.c,v 1.7 2020/07/06 10:22:44 rin Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,14 +33,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3cfi.c,v 1.6 2020/07/06 09:34:16 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3cfi.c,v 1.7 2020/07/06 10:22:44 rin Exp $");
 
 #include "locators.h"
 
-#ifdef _KERNEL_OPT
-#include "opt_flash.h"
-#endif
-
 #include 
 #include 
 #include 

Index: src/sys/arch/powerpc/booke/dev/pq3nandfcm.c
diff -u src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.3 src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.4
--- src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.3	Mon Jul  6 09:34:16 2020
+++ src/sys/arch/powerpc/booke/dev/pq3nandfcm.c	Mon Jul  6 10:22:44 2020
@@ -30,11 +30,7 @@
 #define LBC_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3nandfcm.c,v 1.3 2020/07/06 09:34:16 rin Exp $");
-
-#ifdef _KERNEL_OPT
-#include "opt_flash.h"
-#endif
+__KERNEL_RCSID(0, "$NetBSD: pq3nandfcm.c,v 1.4 2020/07/06 10:22:44 rin Exp $");
 
 #include 
 #include 



CVS commit: src/sys/arch/powerpc/booke/dev

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:22:44 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3cfi.c pq3nandfcm.c

Log Message:
Drop unused opt_flash.h.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/booke/dev/pq3cfi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/booke/dev/pq3nandfcm.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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:16:12 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap_subr.S

Log Message:
Include required opt_*.h for sure.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/booke/trap_subr.S

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



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:16:12 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap_subr.S

Log Message:
Include required opt_*.h for sure.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/booke/trap_subr.S

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/powerpc/booke/trap_subr.S
diff -u src/sys/arch/powerpc/booke/trap_subr.S:1.12 src/sys/arch/powerpc/booke/trap_subr.S:1.13
--- src/sys/arch/powerpc/booke/trap_subr.S:1.12	Mon Jan 26 04:47:53 2015
+++ src/sys/arch/powerpc/booke/trap_subr.S	Mon Jul  6 10:16:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap_subr.S,v 1.12 2015/01/26 04:47:53 nonaka Exp $	*/
+/*	$NetBSD: trap_subr.S,v 1.13 2020/07/06 10:16:12 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-RCSID("$NetBSD: trap_subr.S,v 1.12 2015/01/26 04:47:53 nonaka Exp $")
+RCSID("$NetBSD: trap_subr.S,v 1.13 2020/07/06 10:16:12 rin Exp $")
+
+#ifdef _KERNEL_OPT
+#include "opt_altivec.h"
+#include "opt_ddb.h"
+#include "opt_mpc85xx.h"
+#include "opt_multiprocessor.h"
+#endif
 
 	.globl	_C_LABEL(sctrapexit), _C_LABEL(trapexit), _C_LABEL(intrcall)
 



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:13:02 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Include missing opt_altivec.h for PPC_HAVE_SPE.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/booke/trap.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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.28 src/sys/arch/powerpc/booke/trap.c:1.29
--- src/sys/arch/powerpc/booke/trap.c:1.28	Mon Jul  6 09:34:16 2020
+++ src/sys/arch/powerpc/booke/trap.c	Mon Jul  6 10:13:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.28 2020/07/06 09:34:16 rin Exp $	*/
+/*	$NetBSD: trap.c,v 1.29 2020/07/06 10:13:02 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,9 +35,10 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.28 2020/07/06 09:34:16 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.29 2020/07/06 10:13:02 rin Exp $");
 
 #ifdef _KERNEL_OPT
+#include "opt_altivec.h"
 #include "opt_ddb.h"
 #endif
 



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:13:02 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: trap.c

Log Message:
Include missing opt_altivec.h for PPC_HAVE_SPE.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/booke/trap.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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:12:04 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_tlb.c

Log Message:
Include missing opt_multiprocessor.h and opt_pmap.h.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/booke/e500_tlb.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/powerpc/booke/e500_tlb.c
diff -u src/sys/arch/powerpc/booke/e500_tlb.c:1.20 src/sys/arch/powerpc/booke/e500_tlb.c:1.21
--- src/sys/arch/powerpc/booke/e500_tlb.c:1.20	Mon Jul  6 09:34:16 2020
+++ src/sys/arch/powerpc/booke/e500_tlb.c	Mon Jul  6 10:12:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_tlb.c,v 1.20 2020/07/06 09:34:16 rin Exp $	*/
+/*	$NetBSD: e500_tlb.c,v 1.21 2020/07/06 10:12:04 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,9 +37,11 @@
 #define	__PMAP_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.20 2020/07/06 09:34:16 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_tlb.c,v 1.21 2020/07/06 10:12:04 rin Exp $");
 
 #ifdef _KERNEL_OPT
+#include "opt_multiprocessor.h"
+#include "opt_pmap.h"
 #include "opt_ppcparam.h"
 #endif
 



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:12:04 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_tlb.c

Log Message:
Include missing opt_multiprocessor.h and opt_pmap.h.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/booke/e500_tlb.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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:11:14 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
Drop unused opt_ddb.h.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:11:14 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
Drop unused opt_ddb.h.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.43 src/sys/arch/powerpc/booke/e500_intr.c:1.44
--- src/sys/arch/powerpc/booke/e500_intr.c:1.43	Mon Jul  6 09:34:16 2020
+++ src/sys/arch/powerpc/booke/e500_intr.c	Mon Jul  6 10:11:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.43 2020/07/06 09:34:16 rin Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.44 2020/07/06 10:11:14 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,10 +37,9 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.43 2020/07/06 09:34:16 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.44 2020/07/06 10:11:14 rin Exp $");
 
 #ifdef _KERNEL_OPT
-#include "opt_ddb.h"
 #include "opt_mpc85xx.h"
 #include "opt_multiprocessor.h"
 #endif



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:09:23 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c

Log Message:
Include missing opt_multiprocessor.h and opt_pmap.h.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/booke/booke_pmap.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/powerpc/booke/booke_pmap.c
diff -u src/sys/arch/powerpc/booke/booke_pmap.c:1.28 src/sys/arch/powerpc/booke/booke_pmap.c:1.29
--- src/sys/arch/powerpc/booke/booke_pmap.c:1.28	Mon Jul  6 09:34:16 2020
+++ src/sys/arch/powerpc/booke/booke_pmap.c	Mon Jul  6 10:09:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_pmap.c,v 1.28 2020/07/06 09:34:16 rin Exp $	*/
+/*	$NetBSD: booke_pmap.c,v 1.29 2020/07/06 10:09:23 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,7 +37,12 @@
 #define __PMAP_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.28 2020/07/06 09:34:16 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_pmap.c,v 1.29 2020/07/06 10:09:23 rin Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_multiprocessor.h"
+#include "opt_pmap.h"
+#endif
 
 #include 
 #include 



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:09:23 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: booke_pmap.c

Log Message:
Include missing opt_multiprocessor.h and opt_pmap.h.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/booke/booke_pmap.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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:08:16 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: booke_machdep.c

Log Message:
Include missing ksyms.h, opt_ddb.h, and opt_multiprocessor.h.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/booke/booke_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/powerpc/booke/booke_machdep.c
diff -u src/sys/arch/powerpc/booke/booke_machdep.c:1.31 src/sys/arch/powerpc/booke/booke_machdep.c:1.32
--- src/sys/arch/powerpc/booke/booke_machdep.c:1.31	Mon Jul  6 09:34:16 2020
+++ src/sys/arch/powerpc/booke/booke_machdep.c	Mon Jul  6 10:08:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_machdep.c,v 1.31 2020/07/06 09:34:16 rin Exp $	*/
+/*	$NetBSD: booke_machdep.c,v 1.32 2020/07/06 10:08:16 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,10 +38,14 @@
 #define	_POWERPC_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.31 2020/07/06 09:34:16 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.32 2020/07/06 10:08:16 rin Exp $");
+
+#include "ksyms.h"
 
 #ifdef _KERNEL_OPT
+#include "opt_ddb.h"
 #include "opt_modular.h"
+#include "opt_multiprocessor.h"
 #endif
 
 #include 



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:08:16 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: booke_machdep.c

Log Message:
Include missing ksyms.h, opt_ddb.h, and opt_multiprocessor.h.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/booke/booke_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/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 08:13:00 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
XXX
Skip KASSERT which fires when !__HAVE_FAST_SOFTINTS. Just for debug.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.41 src/sys/arch/powerpc/booke/e500_intr.c:1.42
--- src/sys/arch/powerpc/booke/e500_intr.c:1.41	Sat Jul  4 17:20:45 2020
+++ src/sys/arch/powerpc/booke/e500_intr.c	Mon Jul  6 08:13:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.41 2020/07/04 17:20:45 rin Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.42 2020/07/06 08:13:00 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.41 2020/07/04 17:20:45 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.42 2020/07/06 08:13:00 rin Exp $");
 
 #include 
 #include 
@@ -510,7 +510,9 @@ e500_splset(struct cpu_info *ci, int ipl
 {
 	struct cpu_softc * const cpu = ci->ci_softc;
 
+#ifdef __HAVE_FAST_SOFTINTS /* XXX */
 	KASSERT((curlwp->l_pflag & LP_INTR) == 0 || ipl != IPL_NONE);
+#endif
 	const u_int ctpr = IPL2CTPR(ipl);
 	KASSERT(openpic_read(cpu, OPENPIC_CTPR) == IPL2CTPR(ci->ci_cpl));
 	openpic_write(cpu, OPENPIC_CTPR, ctpr);



CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 08:13:00 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
XXX
Skip KASSERT which fires when !__HAVE_FAST_SOFTINTS. Just for debug.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke

2020-07-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul  4 17:20:45 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
Do not panic when splraise to IPL_NONE, which is required for
subr_cprng.c rev 1.36 and above:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_cprng.c#rev1.36


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke

2020-07-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul  4 17:20:45 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
Do not panic when splraise to IPL_NONE, which is required for
subr_cprng.c rev 1.36 and above:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_cprng.c#rev1.36


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.40 src/sys/arch/powerpc/booke/e500_intr.c:1.41
--- src/sys/arch/powerpc/booke/e500_intr.c:1.40	Sun Dec  1 15:34:45 2019
+++ src/sys/arch/powerpc/booke/e500_intr.c	Sat Jul  4 17:20:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.40 2019/12/01 15:34:45 ad Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.41 2020/07/04 17:20:45 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.40 2019/12/01 15:34:45 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.41 2020/07/04 17:20:45 rin Exp $");
 
 #include 
 #include 
@@ -599,15 +599,16 @@ e500_splraise(int ipl)
 			msr = 0;
 #endif
 		wrtee(msr);
-	} else if (ipl == IPL_NONE) {
+	}
+#if 0
+	else if (ipl == IPL_NONE) {
 		panic("%s: %p: cpl=%u: attempt to splraise(IPL_NONE)",
 		__func__, __builtin_return_address(0), old_ipl);
-#if 0
 	} else if (old_ipl > ipl) {
 		printf("%s: %p: cpl=%u: ignoring splraise(%u) to lower ipl\n",
 		__func__, __builtin_return_address(0), old_ipl, ipl);
-#endif
 	}
+#endif
 
 	return old_ipl;
 }



CVS commit: src/sys/arch/powerpc/booke/dev

2020-06-25 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Jun 25 14:52:00 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3obio.c

Log Message:
avoid variable-length array


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/booke/dev/pq3obio.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/powerpc/booke/dev

2020-06-25 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Jun 25 14:52:00 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3obio.c

Log Message:
avoid variable-length array


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/booke/dev/pq3obio.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/powerpc/booke/dev/pq3obio.c
diff -u src/sys/arch/powerpc/booke/dev/pq3obio.c:1.3 src/sys/arch/powerpc/booke/dev/pq3obio.c:1.4
--- src/sys/arch/powerpc/booke/dev/pq3obio.c:1.3	Sat May 28 05:27:20 2011
+++ src/sys/arch/powerpc/booke/dev/pq3obio.c	Thu Jun 25 14:52:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3obio.c,v 1.3 2011/05/28 05:27:20 matt Exp $	*/
+/*	$NetBSD: pq3obio.c,v 1.4 2020/06/25 14:52:00 jdolecek Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -40,7 +40,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pq3obio.c,v 1.3 2011/05/28 05:27:20 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3obio.c,v 1.4 2020/06/25 14:52:00 jdolecek Exp $");
 
 #include 
 #include 
@@ -53,6 +53,8 @@ __KERNEL_RCSID(0, "$NetBSD: pq3obio.c,v 
 #include 
 #include 
 
+#define OBIO_PORTS	8
+
 static int pq3obio_match(device_t, cfdata_t, void *);
 static void pq3obio_attach(device_t, device_t, void *);
 
@@ -189,7 +191,7 @@ pq3obio_attach(device_t parent, device_t
 		return;
 	}
 
-	for (u_int i = 0; i < 8; i++) {
+	for (u_int i = 0; i < OBIO_PORTS; i++) {
 		struct pq3lbc_softc * const lbc = >sc_lbcs[i];
 		uint32_t br = bus_space_read_4(sc->sc_bst, sc->sc_bsh, BRn(i));
 		if (br & BR_V) {
@@ -210,10 +212,10 @@ pq3obio_attach(device_t parent, device_t
 	t->pbs_limit = 0;
 	t->pbs_flags = _BUS_SPACE_BIG_ENDIAN;
 
-	u_int sorted[found];
+	u_int sorted[OBIO_PORTS];
 	u_int nsorted = 0;
 
-	for (u_int i = 0; i < 8; i++) {
+	for (u_int i = 0; i < OBIO_PORTS; i++) {
 		struct pq3lbc_softc * const lbc = >sc_lbcs[i];
 		if ((lbc->lbc_br & BR_V) == 0)
 			continue;



CVS commit: src/sys/arch/powerpc/booke

2020-03-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Mar  5 02:02:08 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: copyout.c

Log Message:
copyoutstr(9): return ENAMETOOLONG correctly when source string is
not NUL-terminated.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/copyout.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/powerpc/booke

2020-03-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Mar  5 02:02:08 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: copyout.c

Log Message:
copyoutstr(9): return ENAMETOOLONG correctly when source string is
not NUL-terminated.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/copyout.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/powerpc/booke/copyout.c
diff -u src/sys/arch/powerpc/booke/copyout.c:1.7 src/sys/arch/powerpc/booke/copyout.c:1.8
--- src/sys/arch/powerpc/booke/copyout.c:1.7	Thu Mar  5 00:33:56 2020
+++ src/sys/arch/powerpc/booke/copyout.c	Thu Mar  5 02:02:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyout.c,v 1.7 2020/03/05 00:33:56 rin Exp $	*/
+/*	$NetBSD: copyout.c,v 1.8 2020/03/05 02:02:08 rin Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copyout.c,v 1.7 2020/03/05 00:33:56 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyout.c,v 1.8 2020/03/05 02:02:08 rin Exp $");
 
 #define	__UFETCHSTORE_PRIVATE
 
@@ -432,13 +432,15 @@ copyoutstr(const void *ksaddr, void *uda
 		const uint8_t data = *ksaddr8++;
 		copyout_uint8(udaddr8++, data, ds_msr);
 		if (data == 0)
-			break;
+			goto out;
 	}
+	rv = ENAMETOOLONG;
 
+out:
 	pcb->pcb_onfault = NULL;
 	if (done)
 		*done = copylen;
-	return 0;
+	return rv;
 }
 #else
 /* XXX This version of copyoutstr(9) has never beeen enabled so far. */



CVS commit: src/sys/arch/powerpc/booke

2020-03-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Mar  5 00:33:56 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: copyout.c

Log Message:
copyoutstr(9): sync style with copyinstr(9).

- use variable name "done" instead of "lenp"
- return return value from setfault() on fault, instead of hardcoded EFAULT

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/booke/copyout.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/powerpc/booke/copyout.c
diff -u src/sys/arch/powerpc/booke/copyout.c:1.6 src/sys/arch/powerpc/booke/copyout.c:1.7
--- src/sys/arch/powerpc/booke/copyout.c:1.6	Wed Mar  4 13:01:52 2020
+++ src/sys/arch/powerpc/booke/copyout.c	Thu Mar  5 00:33:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyout.c,v 1.6 2020/03/04 13:01:52 rin Exp $	*/
+/*	$NetBSD: copyout.c,v 1.7 2020/03/05 00:33:56 rin Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copyout.c,v 1.6 2020/03/04 13:01:52 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyout.c,v 1.7 2020/03/05 00:33:56 rin Exp $");
 
 #define	__UFETCHSTORE_PRIVATE
 
@@ -402,22 +402,24 @@ copyout(const void *vksaddr, void *vudad
 
 #if 1
 int
-copyoutstr(const void *ksaddr, void *udaddr, size_t len, size_t *lenp)
+copyoutstr(const void *ksaddr, void *udaddr, size_t len, size_t *done)
 {
 	struct pcb * const pcb = lwp_getpcb(curlwp);
 	struct faultbuf env;
+	int rv;
 
 	if (__predict_false(len == 0)) {
-		if (lenp)
-			*lenp = 0;
+		if (done)
+			*done = 0;
 		return 0;
 	}
 
-	if (setfault()) {
+	rv = setfault();
+	if (rv != 0) {
 		pcb->pcb_onfault = NULL;
-		if (lenp)
-			*lenp = 0;
-		return EFAULT;
+		if (done)
+			*done = 0;
+		return rv;
 	}
 
 	const register_t ds_msr = mfmsr() | PSL_DS;
@@ -434,8 +436,8 @@ copyoutstr(const void *ksaddr, void *uda
 	}
 
 	pcb->pcb_onfault = NULL;
-	if (lenp)
-		*lenp = copylen;
+	if (done)
+		*done = copylen;
 	return 0;
 }
 #else



CVS commit: src/sys/arch/powerpc/booke

2020-03-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Mar  5 00:33:56 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: copyout.c

Log Message:
copyoutstr(9): sync style with copyinstr(9).

- use variable name "done" instead of "lenp"
- return return value from setfault() on fault, instead of hardcoded EFAULT

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/booke/copyout.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/powerpc/booke

2020-03-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Mar  4 13:01:52 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: copyout.c

Log Message:
Comment out full function of optimized version of copyoutstr(9),
which has never been enabled so far.

Only for clarity. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/booke/copyout.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/powerpc/booke/copyout.c
diff -u src/sys/arch/powerpc/booke/copyout.c:1.5 src/sys/arch/powerpc/booke/copyout.c:1.6
--- src/sys/arch/powerpc/booke/copyout.c:1.5	Sun Apr  7 05:25:55 2019
+++ src/sys/arch/powerpc/booke/copyout.c	Wed Mar  4 13:01:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyout.c,v 1.5 2019/04/07 05:25:55 thorpej Exp $	*/
+/*	$NetBSD: copyout.c,v 1.6 2020/03/04 13:01:52 rin Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copyout.c,v 1.5 2019/04/07 05:25:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyout.c,v 1.6 2020/03/04 13:01:52 rin Exp $");
 
 #define	__UFETCHSTORE_PRIVATE
 
@@ -400,6 +400,7 @@ copyout(const void *vksaddr, void *vudad
 	return 0;
 }
 
+#if 1
 int
 copyoutstr(const void *ksaddr, void *udaddr, size_t len, size_t *lenp)
 {
@@ -423,7 +424,6 @@ copyoutstr(const void *ksaddr, void *uda
 	const uint8_t *ksaddr8 = ksaddr;
 	size_t copylen = 0;
 
-#if 1
 	uint8_t *udaddr8 = (void *)udaddr;
 
 	while (copylen++ < len) {
@@ -432,7 +432,37 @@ copyoutstr(const void *ksaddr, void *uda
 		if (data == 0)
 			break;
 	}
+
+	pcb->pcb_onfault = NULL;
+	if (lenp)
+		*lenp = copylen;
+	return 0;
+}
 #else
+/* XXX This version of copyoutstr(9) has never beeen enabled so far. */
+int
+copyoutstr(const void *ksaddr, void *udaddr, size_t len, size_t *lenp)
+{
+	struct pcb * const pcb = lwp_getpcb(curlwp);
+	struct faultbuf env;
+
+	if (__predict_false(len == 0)) {
+		if (lenp)
+			*lenp = 0;
+		return 0;
+	}
+
+	if (setfault()) {
+		pcb->pcb_onfault = NULL;
+		if (lenp)
+			*lenp = 0;
+		return EFAULT;
+	}
+
+	const register_t ds_msr = mfmsr() | PSL_DS;
+	const uint8_t *ksaddr8 = ksaddr;
+	size_t copylen = 0;
+
 	uint32_t *udaddr32 = (void *)((uintptr_t)udaddr & ~3);
 
 	size_t boff = (uintptr_t)udaddr & 3;
@@ -523,10 +553,10 @@ copyoutstr(const void *ksaddr, void *uda
 		copyout_le32_with_mask(udaddr32, data, mask, ds_msr);
 		copylen += wlen;
 	}
-#endif
 
 	pcb->pcb_onfault = NULL;
 	if (lenp)
 		*lenp = copylen;
 	return 0;
 }
+#endif



CVS commit: src/sys/arch/powerpc/booke

2020-03-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Mar  4 13:01:52 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: copyout.c

Log Message:
Comment out full function of optimized version of copyoutstr(9),
which has never been enabled so far.

Only for clarity. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/booke/copyout.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/powerpc/booke

2020-03-01 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Mar  2 03:34:28 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: copyin.c

Log Message:
Let copyinstr(9) return ENAMETOOLONG correctly if source is not
NUL-terminated; it cannot be determined by (uint8_t)data == '\0'
since data is right shifted at the end of loop.

Found by POOL_REDZONE.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/copyin.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/powerpc/booke

2020-03-01 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Mar  2 03:34:28 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke: copyin.c

Log Message:
Let copyinstr(9) return ENAMETOOLONG correctly if source is not
NUL-terminated; it cannot be determined by (uint8_t)data == '\0'
since data is right shifted at the end of loop.

Found by POOL_REDZONE.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/copyin.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/powerpc/booke/copyin.c
diff -u src/sys/arch/powerpc/booke/copyin.c:1.7 src/sys/arch/powerpc/booke/copyin.c:1.8
--- src/sys/arch/powerpc/booke/copyin.c:1.7	Sun Apr  7 05:25:55 2019
+++ src/sys/arch/powerpc/booke/copyin.c	Mon Mar  2 03:34:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyin.c,v 1.7 2019/04/07 05:25:55 thorpej Exp $	*/
+/*	$NetBSD: copyin.c,v 1.8 2020/03/02 03:34:28 rin Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copyin.c,v 1.7 2019/04/07 05:25:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyin.c,v 1.8 2020/03/02 03:34:28 rin Exp $");
 
 #define	__UFETCHSTORE_PRIVATE
 
@@ -306,6 +306,7 @@ copyinstr(const void *usaddr, void *kdad
 {
 	struct pcb * const pcb = lwp_getpcb(curlwp);
 	struct faultbuf env;
+	int rv;
 
 	if (__predict_false(len == 0)) {
 		if (done)
@@ -313,7 +314,7 @@ copyinstr(const void *usaddr, void *kdad
 		return 0;
 	}
 
-	int rv = setfault();
+	rv = setfault();
 	if (rv != 0) {
 		pcb->pcb_onfault = NULL;
 		if (done)
@@ -346,15 +347,14 @@ copyinstr(const void *usaddr, void *kdad
 		*kdaddr8++ = data;
 		if ((uint8_t) data == 0) {
 			copylen++;
-			break;
+			goto out;
 		}
 	}
+	rv = ENAMETOOLONG;
 
+out:
 	pcb->pcb_onfault = NULL;
 	if (done)
 		*done = copylen;
-	/*
-	 * If the last byte is not NUL (0), then the name is too long.
-	 */
-	return (uint8_t)data ? ENAMETOOLONG : 0;
+	return rv;
 }



CVS commit: src/sys/arch/powerpc/booke/dev

2020-01-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 30 06:27:13 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev

2020-01-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 30 06:27:13 UTC 2020

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.48 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.49
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.48	Wed Jan 29 05:35:28 2020
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Thu Jan 30 06:27:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.48 2020/01/29 05:35:28 thorpej Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.49 2020/01/30 06:27:13 martin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.48 2020/01/29 05:35:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.49 2020/01/30 06:27:13 martin Exp $");
 
 #include 
 #include 
@@ -2226,7 +2226,7 @@ pq3etsec_txq_consume(
 			if (m->m_flags & M_HASFCB)
 m_adj(m, sizeof(struct txfcb));
 			bpf_mtap(ifp, m, BPF_D_OUT);
-			net_stats_ref_t nsr = IF_STAT_GETREF(ifp);
+			net_stat_ref_t nsr = IF_STAT_GETREF(ifp);
 			if_statinc_ref(nsr, if_opackets);
 			if_statadd_ref(nsr, if_obytes, m->m_pkthdr.len);
 			if (m->m_flags & M_MCAST)



CVS commit: src/sys/arch/powerpc/booke/dev

2019-04-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 24 11:12:12 UTC 2019

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
SIOCS is 'S'et function and the ioctl argument is ifreq.
SIOCG is 'G'et function and the ioctl armument is ifmediareq.
Before this change, SIOCG modify request unexpectedly but it doesn't cause a
real bug because the modification is overriden in ifmedia_ioctl().


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.41 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.42
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.41	Fri Mar  8 08:12:39 2019
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Wed Apr 24 11:12:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.41 2019/03/08 08:12:39 msaitoh Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.42 2019/04/24 11:12:12 msaitoh Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.41 2019/03/08 08:12:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.42 2019/04/24 11:12:12 msaitoh Exp $");
 
 #include 
 #include 
@@ -1200,7 +1200,6 @@ pq3etsec_ifioctl(struct ifnet *ifp, u_lo
 
 	switch (cmd) {
 	case SIOCSIFMEDIA:
-	case SIOCGIFMEDIA:
 		/* Flow control requires full-duplex mode. */
 		if (IFM_SUBTYPE(ifr->ifr_media) == IFM_AUTO ||
 		(ifr->ifr_media & IFM_FDX) == 0)



CVS commit: src/sys/arch/powerpc/booke/dev

2019-04-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 24 11:12:12 UTC 2019

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
SIOCS is 'S'et function and the ioctl argument is ifreq.
SIOCG is 'G'et function and the ioctl armument is ifmediareq.
Before this change, SIOCG modify request unexpectedly but it doesn't cause a
real bug because the modification is overriden in ifmedia_ioctl().


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke

2018-01-26 Thread Felix Deichmann
Module Name:src
Committed By:   flxd
Date:   Fri Jan 26 17:49:55 UTC 2018

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
Another try fixing printf format using the ultimate uintmax_t idiom.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.36 src/sys/arch/powerpc/booke/e500_intr.c:1.37
--- src/sys/arch/powerpc/booke/e500_intr.c:1.36	Fri Jan 26 09:26:43 2018
+++ src/sys/arch/powerpc/booke/e500_intr.c	Fri Jan 26 17:49:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.36 2018/01/26 09:26:43 christos Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.37 2018/01/26 17:49:55 flxd Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.36 2018/01/26 09:26:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.37 2018/01/26 17:49:55 flxd Exp $");
 
 #include 
 #include 
@@ -1150,8 +1150,8 @@ e500_intr_init(void)
 		break;
 #endif
 	default:
-		panic("%s: don't know how to deal with SVR %#" PRIxREGISTER,
-		__func__, mfspr(SPR_SVR));
+		panic("%s: don't know how to deal with SVR %#jx",
+		__func__, (uintmax_t)mfspr(SPR_SVR));
 	}
 
 	/*



CVS commit: src/sys/arch/powerpc/booke

2018-01-26 Thread Felix Deichmann
Module Name:src
Committed By:   flxd
Date:   Fri Jan 26 17:49:55 UTC 2018

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
Another try fixing printf format using the ultimate uintmax_t idiom.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke

2018-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 26 09:26:43 UTC 2018

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
fix printf format.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke

2018-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 26 09:26:43 UTC 2018

Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c

Log Message:
fix printf format.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/powerpc/booke/e500_intr.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/powerpc/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.35 src/sys/arch/powerpc/booke/e500_intr.c:1.36
--- src/sys/arch/powerpc/booke/e500_intr.c:1.35	Wed May 31 22:45:07 2017
+++ src/sys/arch/powerpc/booke/e500_intr.c	Fri Jan 26 04:26:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_intr.c,v 1.35 2017/06/01 02:45:07 chs Exp $	*/
+/*	$NetBSD: e500_intr.c,v 1.36 2018/01/26 09:26:43 christos Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.35 2017/06/01 02:45:07 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.36 2018/01/26 09:26:43 christos Exp $");
 
 #include 
 #include 
@@ -1150,7 +1150,7 @@ e500_intr_init(void)
 		break;
 #endif
 	default:
-		panic("%s: don't know how to deal with SVR %#lx",
+		panic("%s: don't know how to deal with SVR %#" PRIxREGISTER,
 		__func__, mfspr(SPR_SVR));
 	}
 



CVS commit: src/sys/arch/powerpc/booke/dev

2017-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 23 09:23:48 UTC 2017

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
 If error occured in pq3etsec_attach(), free resources and return.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.31 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.32
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.31	Mon Oct  2 01:55:40 2017
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Mon Oct 23 09:23:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.31 2017/10/02 01:55:40 knakahara Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.32 2017/10/23 09:23:48 msaitoh Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.31 2017/10/02 01:55:40 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.32 2017/10/23 09:23:48 msaitoh Exp $");
 
 #include 
 #include 
@@ -648,27 +648,27 @@ pq3etsec_attach(device_t parent, device_
 	error = pq3etsec_rxq_attach(sc, >sc_rxq, 0);
 	if (error) {
 		aprint_error(": failed to init rxq: %d\n", error);
-		return;
+		goto fail_1;
 	}
 
 	error = pq3etsec_txq_attach(sc, >sc_txq, 0);
 	if (error) {
 		aprint_error(": failed to init txq: %d\n", error);
-		return;
+		goto fail_2;
 	}
 
 	error = pq3etsec_mapcache_create(sc, >sc_rx_mapcache, 
 	ETSEC_MAXRXMBUFS, MCLBYTES, ETSEC_NRXSEGS);
 	if (error) {
 		aprint_error(": failed to allocate rx dmamaps: %d\n", error);
-		return;
+		goto fail_3;
 	}
 
 	error = pq3etsec_mapcache_create(sc, >sc_tx_mapcache, 
 	ETSEC_MAXTXMBUFS, MCLBYTES, ETSEC_NTXSEGS);
 	if (error) {
 		aprint_error(": failed to allocate tx dmamaps: %d\n", error);
-		return;
+		goto fail_4;
 	}
 
 	sc->sc_tx_ih = intr_establish(cnl->cnl_intrs[0], IPL_VM, IST_ONCHIP,
@@ -676,7 +676,7 @@ pq3etsec_attach(device_t parent, device_
 	if (sc->sc_tx_ih == NULL) {
 		aprint_error(": failed to establish tx interrupt: %d\n",
 		cnl->cnl_intrs[0]);
-		return;
+		goto fail_5;
 	}
 
 	sc->sc_rx_ih = intr_establish(cnl->cnl_intrs[1], IPL_VM, IST_ONCHIP,
@@ -684,7 +684,7 @@ pq3etsec_attach(device_t parent, device_
 	if (sc->sc_rx_ih == NULL) {
 		aprint_error(": failed to establish rx interrupt: %d\n",
 		cnl->cnl_intrs[1]);
-		return;
+		goto fail_6;
 	}
 
 	sc->sc_error_ih = intr_establish(cnl->cnl_intrs[2], IPL_VM, IST_ONCHIP,
@@ -692,7 +692,7 @@ pq3etsec_attach(device_t parent, device_
 	if (sc->sc_error_ih == NULL) {
 		aprint_error(": failed to establish error interrupt: %d\n",
 		cnl->cnl_intrs[2]);
-		return;
+		goto fail_7;
 	}
 
 	int softint_flags = SOFTINT_NET;
@@ -703,7 +703,7 @@ pq3etsec_attach(device_t parent, device_
 	pq3etsec_soft_intr, sc);
 	if (sc->sc_soft_ih == NULL) {
 		aprint_error(": failed to establish soft interrupt\n");
-		return;
+		goto fail_8;
 	}
 
 	/*
@@ -719,7 +719,7 @@ pq3etsec_attach(device_t parent, device_
 		sc->sc_mdio_dev = device_find_by_driver_unit("mdio", mdio);
 		if (sc->sc_mdio_dev == NULL) {
 			aprint_error(": failed to locate mdio device\n");
-			return;
+			goto fail_9;
 		}
 		aprint_normal("\n");
 	}
@@ -734,7 +734,6 @@ pq3etsec_attach(device_t parent, device_
 	sc->sc_ic_tx_count = 16;
 	pq3etsec_set_ic_rx(sc);
 	pq3etsec_set_ic_tx(sc);
-	pq3etsec_sysctl_setup(NULL, sc);
 
 	char enaddr[ETHER_ADDR_LEN] = {
 	[0] = sc->sc_macstnaddr2 >> 16,
@@ -794,7 +793,13 @@ pq3etsec_attach(device_t parent, device_
 	/*
 	 * Attach the interface.
 	 */
-	if_initialize(ifp);
+	error = if_initialize(ifp);
+	if (error != 0) {
+		aprint_error_dev(sc->sc_dev, "if_initialize failed(%d)\n",
+		error);
+		goto fail_10;
+	}
+	pq3etsec_sysctl_setup(NULL, sc);
 	ether_ifattach(ifp, enaddr);
 	if_register(ifp);
 
@@ -818,6 +823,36 @@ pq3etsec_attach(device_t parent, device_
 	NULL, xname, "rx pause");
 	evcnt_attach_dynamic(>sc_ev_mii_ticks, EVCNT_TYPE_MISC,
 	NULL, xname, "mii ticks");
+	return;
+
+fail_10:
+	ifmedia_removeall(>sc_mii.mii_media);
+	mii_detach(>sc_mii, sc->sc_phy_addr, MII_OFFSET_ANY);
+fail_9:
+	softint_disestablish(sc->sc_soft_ih);
+fail_8:
+	intr_disestablish(sc->sc_error_ih);
+fail_7:
+	intr_disestablish(sc->sc_rx_ih);
+fail_6:
+	intr_disestablish(sc->sc_tx_ih);
+fail_5:
+	pq3etsec_mapcache_destroy(sc, sc->sc_tx_mapcache);
+fail_4:
+	pq3etsec_mapcache_destroy(sc, sc->sc_rx_mapcache);
+fail_3:
+#if 0 /* notyet */
+	pq3etsec_txq_detach(sc);
+#endif
+fail_2:
+#if 0 /* notyet */
+	pq3etsec_rxq_detach(sc);
+#endif
+fail_1:
+	callout_destroy(>sc_mii_callout);
+	mutex_obj_free(sc->sc_lock);
+	mutex_obj_free(sc->sc_hwlock);
+	bus_space_unmap(sc->sc_bst, sc->sc_bsh, cnl->cnl_size);
 }
 
 static uint64_t



CVS commit: src/sys/arch/powerpc/booke/dev

2017-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 23 09:23:48 UTC 2017

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
 If error occured in pq3etsec_attach(), free resources and return.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev

2017-10-01 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Oct  2 01:55:40 UTC 2017

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
only get vtag when we have vtag like the other drivers.

like if_bge.c:1.312 and if_stge.c:1.64.
fixed by s-yamaguchi@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.30 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.31
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.30	Tue Sep 26 07:42:05 2017
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Mon Oct  2 01:55:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.30 2017/09/26 07:42:05 knakahara Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.31 2017/10/02 01:55:40 knakahara Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.30 2017/09/26 07:42:05 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.31 2017/10/02 01:55:40 knakahara Exp $");
 
 #include 
 #include 
@@ -1996,7 +1996,7 @@ pq3etsec_tx_offload(
 	KASSERT(m->m_flags & M_PKTHDR);
 
 	have_vtag = vlan_has_tag(m);
-	vtag = vlan_get_tag(m);
+	vtag = (have_vtag) ? vlan_get_tag(m) : 0;
 
 	/*
 	 * Let see if we are doing any offload first.
@@ -2031,7 +2031,7 @@ pq3etsec_tx_offload(
 		fcb.txfcb_l4os = M_CSUM_DATA_IPv6_HL(m->m_pkthdr.csum_data);
 	fcb.txfcb_l3os = ETHER_HDR_LEN;
 	fcb.txfcb_phcs = 0;
-	fcb.txfcb_vlctl = have_vtag ? vtag : 0;
+	fcb.txfcb_vlctl = vtag;
 
 #if 0
 	printf("%s: csum_flags=%#x: txfcb flags=%#x lsos=%u l4os=%u phcs=%u vlctl=%#x\n",



CVS commit: src/sys/arch/powerpc/booke/dev

2017-10-01 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Oct  2 01:55:40 UTC 2017

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
only get vtag when we have vtag like the other drivers.

like if_bge.c:1.312 and if_stge.c:1.64.
fixed by s-yamaguchi@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke

2017-03-17 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Fri Mar 17 23:43:43 UTC 2017

Modified Files:
src/sys/arch/powerpc/booke: spe.c

Log Message:
apply changes to this file as well, as part of:
allow pcu_save() and pcu_discard() to be called on other threads,
ptrace needs to use it that way.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/booke/spe.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/powerpc/booke/spe.c
diff -u src/sys/arch/powerpc/booke/spe.c:1.9 src/sys/arch/powerpc/booke/spe.c:1.10
--- src/sys/arch/powerpc/booke/spe.c:1.9	Thu Mar 16 16:13:20 2017
+++ src/sys/arch/powerpc/booke/spe.c	Fri Mar 17 23:43:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: spe.c,v 1.9 2017/03/16 16:13:20 chs Exp $	*/
+/*	$NetBSD: spe.c,v 1.10 2017/03/17 23:43:43 chs Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spe.c,v 1.9 2017/03/16 16:13:20 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spe.c,v 1.10 2017/03/17 23:43:43 chs Exp $");
 
 #include "opt_altivec.h"
 
@@ -149,9 +149,7 @@ vec_restore_from_mcontext(lwp_t *l, cons
 	struct pcb * const pcb = lwp_getpcb(l);
 	const union __vr *vr = mcp->__vrf.__vrs;
 
-	KASSERT(l == curlwp);
-
-	vec_save();
+	vec_save(l);
 
 	/* grab the accumulator */
 	pcb->pcb_vr.vreg[8][0] = vr->__vr32[2];
@@ -175,12 +173,10 @@ vec_save_to_mcontext(lwp_t *l, mcontext_
 {
 	struct pcb * const pcb = lwp_getpcb(l);
 
-	KASSERT(l == curlwp);
-
 	if (!vec_used_p(l))
 		return false;
 
-	vec_save();
+	vec_save(l);
 
 	mcp->__gregs[_REG_MSR] |= PSL_SPV;
 



CVS commit: src/sys/arch/powerpc/booke

2017-03-17 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Fri Mar 17 23:43:43 UTC 2017

Modified Files:
src/sys/arch/powerpc/booke: spe.c

Log Message:
apply changes to this file as well, as part of:
allow pcu_save() and pcu_discard() to be called on other threads,
ptrace needs to use it that way.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/booke/spe.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/powerpc/booke

2016-12-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Dec  6 07:34:22 UTC 2016

Modified Files:
src/sys/arch/powerpc/booke: booke_machdep.c

Log Message:
PR port-evbppc/51564 (myself): wait for console input after halting the machine.
ok joerg


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/booke/booke_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/powerpc/booke/booke_machdep.c
diff -u src/sys/arch/powerpc/booke/booke_machdep.c:1.24 src/sys/arch/powerpc/booke/booke_machdep.c:1.25
--- src/sys/arch/powerpc/booke/booke_machdep.c:1.24	Mon Jul 11 16:06:52 2016
+++ src/sys/arch/powerpc/booke/booke_machdep.c	Tue Dec  6 07:34:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: booke_machdep.c,v 1.24 2016/07/11 16:06:52 matt Exp $	*/
+/*	$NetBSD: booke_machdep.c,v 1.25 2016/12/06 07:34:22 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -38,7 +38,7 @@
 #define	_POWERPC_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.24 2016/07/11 16:06:52 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: booke_machdep.c,v 1.25 2016/12/06 07:34:22 rin Exp $");
 
 #include "opt_modular.h"
 
@@ -55,6 +55,8 @@ __KERNEL_RCSID(0, "$NetBSD: booke_machde
 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -275,8 +277,13 @@ cpu_reboot(int howto, char *what)
 	}
 
 	if (howto & RB_HALT) {
-		printf("halted\n\n");
+		printf("The operating system has halted.\n"
+		"Press any key to reboot.\n\n");
+		cnpollc(1);	/* For proper keyboard command handling */
+		cngetc();
+		cnpollc(0);
 
+		printf("rebooting...\n\n");
 		goto reboot;	/* XXX for now... */
 
 #ifdef DDB



CVS commit: src/sys/arch/powerpc/booke

2016-12-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Dec  6 07:34:22 UTC 2016

Modified Files:
src/sys/arch/powerpc/booke: booke_machdep.c

Log Message:
PR port-evbppc/51564 (myself): wait for console input after halting the machine.
ok joerg


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/booke/booke_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/powerpc/booke/dev

2016-07-25 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jul 26 01:36:51 UTC 2016

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
IFQ_PURGE() must be called only after call if_initialize().
it lock ifp->if_snd.ifq_lock.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev

2016-07-25 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Jul 26 01:36:51 UTC 2016

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c

Log Message:
IFQ_PURGE() must be called only after call if_initialize().
it lock ifp->if_snd.ifq_lock.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/booke/dev/pq3etsec.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.27 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.28
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.27	Fri Jun 10 13:27:12 2016
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Tue Jul 26 01:36:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.27 2016/06/10 13:27:12 ozaki-r Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.28 2016/07/26 01:36:50 nonaka Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.27 2016/06/10 13:27:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.28 2016/07/26 01:36:50 nonaka Exp $");
 
 #include 
 #include 
@@ -791,8 +791,6 @@ pq3etsec_attach(device_t parent, device_
 	ifp->if_stop = pq3etsec_ifstop;
 	IFQ_SET_READY(>if_snd);
 
-	pq3etsec_ifstop(ifp, true);
-
 	/*
 	 * Attach the interface.
 	 */
@@ -800,6 +798,8 @@ pq3etsec_attach(device_t parent, device_
 	ether_ifattach(ifp, enaddr);
 	if_register(ifp);
 
+	pq3etsec_ifstop(ifp, true);
+
 	evcnt_attach_dynamic(>sc_ev_rx_stall, EVCNT_TYPE_MISC,
 	NULL, xname, "rx stall");
 	evcnt_attach_dynamic(>sc_ev_tx_stall, EVCNT_TYPE_MISC,



  1   2   3   >