Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Stop using deprecated proplib functions.



details:   https://anonhg.NetBSD.org/src/rev/bd516c71785c
branches:  trunk
changeset: 368624:bd516c71785c
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jul 22 19:54:14 2022 +0000

description:
Stop using deprecated proplib functions.

diffstat:

 sys/arch/evbppc/mpc85xx/machdep.c   |  19 +++++++++++--------
 sys/arch/powerpc/booke/e500_intr.c  |   6 +++---
 sys/arch/powerpc/booke/pci/pq3pci.c |  10 +++++-----
 3 files changed, 19 insertions(+), 16 deletions(-)

diffs (133 lines):

diff -r b557dde00fc2 -r bd516c71785c sys/arch/evbppc/mpc85xx/machdep.c
--- a/sys/arch/evbppc/mpc85xx/machdep.c Fri Jul 22 19:52:30 2022 +0000
+++ b/sys/arch/evbppc/mpc85xx/machdep.c Fri Jul 22 19:54:14 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.45 2022/03/03 06:28:04 riastradh Exp $   */
+/*     $NetBSD: machdep.c,v 1.46 2022/07/22 19:57:25 thorpej Exp $     */
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.45 2022/03/03 06:28:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.46 2022/07/22 19:57:25 thorpej Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -305,7 +305,10 @@
                1 + ilog2(DEVDISR_TSEC4),
                { SVR_MPC8548v1 >> 16, SVR_MPC8572v1 >> 16 } },
 #endif
-       { "diic", I2C1_BASE, 2*I2C_SIZE, 0,
+       { "diic", I2C1_BASE, I2C_SIZE, 0,
+               1, { ISOURCE_I2C },
+               1 + ilog2(DEVDISR_I2C) },
+       { "diic", I2C2_BASE, I2C_SIZE, 1,
                1, { ISOURCE_I2C },
                1 + ilog2(DEVDISR_I2C) },
        /* MPC8572 doesn't have any GPIO */
@@ -1352,7 +1355,7 @@
 #endif
        prop_array_t extirqs = prop_array_create_with_capacity(n);
        for (u_int i = 0; i < n; i++) {
-               prop_string_t ps = prop_string_create_cstring_nocopy(names[i]);
+               prop_string_t ps = prop_string_create_nocopy(names[i]);
                prop_array_set(extirqs, i, ps);
                prop_object_release(ps);
        }
@@ -1365,13 +1368,13 @@
 {
        prop_dictionary_t pci_intmap = prop_dictionary_create();
        KASSERT(pci_intmap != NULL);
-       prop_number_t mask = prop_number_create_unsigned_integer(intmask);
+       prop_number_t mask = prop_number_create_unsigned(intmask);
        KASSERT(mask != NULL);
        prop_dictionary_set(pci_intmap, "interrupt-mask", mask);
        prop_object_release(mask);
-       prop_number_t pn_ist = prop_number_create_unsigned_integer(ist);
+       prop_number_t pn_ist = prop_number_create_unsigned(ist);
        KASSERT(pn_ist != NULL);
-       prop_number_t pn_intr = prop_number_create_unsigned_integer(inta);
+       prop_number_t pn_intr = prop_number_create_unsigned(inta);
        KASSERT(pn_intr != NULL);
        prop_dictionary_t entry = prop_dictionary_create();
        KASSERT(entry != NULL);
@@ -1388,7 +1391,7 @@
                snprintf(prop_name, sizeof(prop_name), "%06x", i + intrinc);
                entry = prop_dictionary_create();
                KASSERT(entry != NULL);
-               pn_intr = prop_number_create_unsigned_integer(va_arg(ap, u_int));
+               pn_intr = prop_number_create_unsigned(va_arg(ap, u_int));
                KASSERT(pn_intr != NULL);
                prop_dictionary_set(entry, "interrupt", pn_intr);
                prop_dictionary_set(entry, "type", pn_ist);
diff -r b557dde00fc2 -r bd516c71785c sys/arch/powerpc/booke/e500_intr.c
--- a/sys/arch/powerpc/booke/e500_intr.c        Fri Jul 22 19:52:30 2022 +0000
+++ b/sys/arch/powerpc/booke/e500_intr.c        Fri Jul 22 19:54:14 2022 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
        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 *
diff -r b557dde00fc2 -r bd516c71785c sys/arch/powerpc/booke/pci/pq3pci.c
--- a/sys/arch/powerpc/booke/pci/pq3pci.c       Fri Jul 22 19:52:30 2022 +0000
+++ b/sys/arch/powerpc/booke/pci/pq3pci.c       Fri Jul 22 19:54:14 2022 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
        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 @@
        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);
 }



Home | Main Index | Thread Index | Old Index