Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm malloc(9) -> kmem(9)



details:   https://anonhg.NetBSD.org/src/rev/7cb8cc67aba9
branches:  trunk
changeset: 946182:7cb8cc67aba9
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Nov 20 18:16:40 2020 +0000

description:
malloc(9) -> kmem(9)

diffstat:

 sys/arch/arm/imx/imx51_ipuv3.c      |  10 +++++-----
 sys/arch/arm/imx/imxuart.c          |  12 ++++++------
 sys/arch/arm/iomd/iomd_irqhandler.c |  12 ++++++------
 sys/arch/arm/iomd/iomdkbc.c         |  14 +++++++-------
 sys/arch/arm/ixp12x0/ixp12x0_com.c  |   8 ++++----
 sys/arch/arm/ixp12x0/ixp12x0_intr.c |   8 ++++----
 sys/arch/arm/marvell/mvsoc_sdhc.c   |   8 ++++----
 sys/arch/arm/ofw/ofw_irqhandler.c   |  12 ++++++------
 8 files changed, 42 insertions(+), 42 deletions(-)

diffs (truncated from 346 to 300 lines):

diff -r 5c85b892f8fe -r 7cb8cc67aba9 sys/arch/arm/imx/imx51_ipuv3.c
--- a/sys/arch/arm/imx/imx51_ipuv3.c    Fri Nov 20 18:03:52 2020 +0000
+++ b/sys/arch/arm/imx/imx51_ipuv3.c    Fri Nov 20 18:16:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: imx51_ipuv3.c,v 1.8 2019/11/10 21:16:23 chs Exp $      */
+/*     $NetBSD: imx51_ipuv3.c,v 1.9 2020/11/20 18:16:40 thorpej Exp $  */
 
 /*
  * Copyright (c) 2011, 2012  Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imx51_ipuv3.c,v 1.8 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx51_ipuv3.c,v 1.9 2020/11/20 18:16:40 thorpej Exp $");
 
 #include "opt_imx51_ipuv3.h"
 
@@ -35,7 +35,7 @@
 #include <sys/systm.h>
 #include <sys/conf.h>
 #include <sys/uio.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/kernel.h>                        /* for cold */
 
 #include <sys/bus.h>
@@ -932,7 +932,7 @@
        width = geometry->panel_width;
        height = geometry->panel_height;
 
-       scr = malloc(sizeof(*scr), M_DEVBUF, M_WAITOK | M_ZERO);
+       scr = kmem_zalloc(sizeof(*scr), KM_SLEEP);
        scr->nsegs = 0;
        scr->depth = depth;
        scr->stride = width * depth / 8;
@@ -944,7 +944,7 @@
                aprint_error_dev(sc->dev,
                    "failed to allocate %u bytes of video memory: %d\n",
                    scr->stride * height, error);
-               free(scr, M_DEVBUF);
+               kmem_free(scr, sizeof(*scr));
                return error;
        }
 
diff -r 5c85b892f8fe -r 7cb8cc67aba9 sys/arch/arm/imx/imxuart.c
--- a/sys/arch/arm/imx/imxuart.c        Fri Nov 20 18:03:52 2020 +0000
+++ b/sys/arch/arm/imx/imxuart.c        Fri Nov 20 18:16:40 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: imxuart.c,v 1.25 2020/05/20 09:18:25 hkenken Exp $ */
+/* $NetBSD: imxuart.c,v 1.26 2020/11/20 18:16:40 thorpej Exp $ */
 
 /*
  * Copyright (c) 2009, 2010  Genetec Corporation.  All rights reserved.
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.25 2020/05/20 09:18:25 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.26 2020/11/20 18:16:40 thorpej Exp $");
 
 #include "opt_imxuart.h"
 #include "opt_ddb.h"
@@ -148,7 +148,7 @@
 #include <sys/kernel.h>
 #include <sys/syslog.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/timepps.h>
 #include <sys/vnode.h>
 #include <sys/kauth.h>
@@ -354,8 +354,8 @@
        tp->t_hwiflow = imxuhwiflow;
 
        sc->sc_tty = tp;
-       sc->sc_rbuf = malloc(sizeof (*sc->sc_rbuf) * imxuart_rbuf_size,
-           M_DEVBUF, M_WAITOK);
+       sc->sc_rbuf = kmem_alloc(sizeof (*sc->sc_rbuf) * imxuart_rbuf_size,
+           KM_SLEEP);
        sc->sc_rbuf_size = imxuart_rbuf_size;
        sc->sc_rbuf_in = sc->sc_rbuf_out = 0;
        sc->sc_txfifo_len = 32;
@@ -542,7 +542,7 @@
        }
 
        /* Free the receive buffer. */
-       free(sc->sc_rbuf, M_DEVBUF);
+       kmem_free(sc->sc_rbuf, sizeof(*sc->sc_rbuf) * sc->sc_rbuf_size);
 
        /* Detach and free the tty. */
        tty_detach(sc->sc_tty);
diff -r 5c85b892f8fe -r 7cb8cc67aba9 sys/arch/arm/iomd/iomd_irqhandler.c
--- a/sys/arch/arm/iomd/iomd_irqhandler.c       Fri Nov 20 18:03:52 2020 +0000
+++ b/sys/arch/arm/iomd/iomd_irqhandler.c       Fri Nov 20 18:16:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iomd_irqhandler.c,v 1.23 2019/11/10 21:16:23 chs Exp $ */
+/*     $NetBSD: iomd_irqhandler.c,v 1.24 2020/11/20 18:18:51 thorpej Exp $     */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,14 +40,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.23 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.24 2020/11/20 18:18:51 thorpej Exp $");
 
 #include "opt_irqstats.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/syslog.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 
 #include <arm/cpufunc.h>
 #include <arm/iomd/iomdreg.h>
@@ -346,7 +346,7 @@
 {
        irqhandler_t *ih;
 
-       ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
+       ih = kmem_alloc(sizeof(*ih), KM_SLEEP);
        ih->ih_level = level;
        ih->ih_name = name;
        ih->ih_func = ih_func;
@@ -354,7 +354,7 @@
        ih->ih_flags = 0;
 
        if (irq_claim(irq, ih) != 0) {
-               free(ih, M_DEVBUF);
+               kmem_free(ih, sizeof(*ih));
                return NULL;
        }
        return ih;
@@ -367,7 +367,7 @@
        irqhandler_t *ih = (irqhandler_t *)arg;
 
        if (irq_release(ih->ih_num, ih) == 0) {
-               free(ih, M_DEVBUF);
+               kmem_free(ih, sizeof(*ih));
                return 0 ;
        }
        return 1;
diff -r 5c85b892f8fe -r 7cb8cc67aba9 sys/arch/arm/iomd/iomdkbc.c
--- a/sys/arch/arm/iomd/iomdkbc.c       Fri Nov 20 18:03:52 2020 +0000
+++ b/sys/arch/arm/iomd/iomdkbc.c       Fri Nov 20 18:16:40 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iomdkbc.c,v 1.6 2019/11/10 21:16:23 chs Exp $ */
+/* $NetBSD: iomdkbc.c,v 1.7 2020/11/20 18:18:51 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2004 Ben Harris
@@ -28,11 +28,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iomdkbc.c,v 1.6 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iomdkbc.c,v 1.7 2020/11/20 18:18:51 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/systm.h>
 
 #include <dev/pckbport/pckbportvar.h>
@@ -133,8 +133,8 @@
                        /* Have an iomdkbc as console.  Assume it's this one.*/
                        t = &iomdkbc_cntag;
                } else {
-                       t = malloc(sizeof(struct iomdkbc_internal), M_DEVBUF,
-                           M_WAITOK | M_ZERO);
+                       t = kmem_zalloc(sizeof(struct iomdkbc_internal),
+                           KM_SLEEP);
                        t->t_haveport[PCKBPORT_KBD_SLOT] = 1;
                        t->t_iot = ka->ka_iot;
                        t->t_ioh[PCKBPORT_KBD_SLOT] = ka->ka_ioh;
@@ -151,8 +151,8 @@
 
        if (strcmp(pa->pa_name, "opms") == 0) {
                if (t == NULL) {
-                       t = malloc(sizeof(struct iomdkbc_internal), M_DEVBUF,
-                           M_WAITOK | M_ZERO);
+                       t = kmem_zalloc(sizeof(struct iomdkbc_internal),
+                           KM_SLEEP);
                }
                t->t_haveport[PCKBPORT_AUX_SLOT] = 1;
                t->t_iot = pa->pa_iot;
diff -r 5c85b892f8fe -r 7cb8cc67aba9 sys/arch/arm/ixp12x0/ixp12x0_com.c
--- a/sys/arch/arm/ixp12x0/ixp12x0_com.c        Fri Nov 20 18:03:52 2020 +0000
+++ b/sys/arch/arm/ixp12x0/ixp12x0_com.c        Fri Nov 20 18:16:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ixp12x0_com.c,v 1.48 2019/11/10 21:16:24 chs Exp $ */
+/*     $NetBSD: ixp12x0_com.c,v 1.49 2020/11/20 18:26:26 thorpej Exp $ */
 /*
  * Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.48 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.49 2020/11/20 18:26:26 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -82,7 +82,7 @@
 #include <sys/file.h>
 #include <sys/device.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/tty.h>
 #include <sys/uio.h>
 #include <sys/vnode.h>
@@ -212,7 +212,7 @@
        tp->t_hwiflow = ixpcomhwiflow;
 
        sc->sc_tty = tp;
-       sc->sc_rbuf = malloc(IXPCOM_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
+       sc->sc_rbuf = kmem_alloc(IXPCOM_RING_SIZE << 1, KM_SLEEP);
        sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
        sc->sc_rbavail = IXPCOM_RING_SIZE;
        sc->sc_ebuf = sc->sc_rbuf + (IXPCOM_RING_SIZE << 1);
diff -r 5c85b892f8fe -r 7cb8cc67aba9 sys/arch/arm/ixp12x0/ixp12x0_intr.c
--- a/sys/arch/arm/ixp12x0/ixp12x0_intr.c       Fri Nov 20 18:03:52 2020 +0000
+++ b/sys/arch/arm/ixp12x0/ixp12x0_intr.c       Fri Nov 20 18:16:40 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixp12x0_intr.c,v 1.32 2019/11/10 21:16:24 chs Exp $ */
+/* $NetBSD: ixp12x0_intr.c,v 1.33 2020/11/20 18:26:26 thorpej Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixp12x0_intr.c,v 1.32 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp12x0_intr.c,v 1.33 2020/11/20 18:26:26 thorpej Exp $");
 
 /*
  * Interrupt support for the Intel ixp12x0
@@ -38,7 +38,7 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/termios.h>
 #include <sys/bus.h>
 #include <sys/intr.h>
@@ -342,7 +342,7 @@
        if (ipl < 0 || ipl > NIPL)
                panic("ixp12x0_intr_establish: IPL %d out of range", ipl);
 
-       ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
+       ih = kmem_alloc(sizeof(*ih), KM_SLEEP);
        ih->ih_func = ih_func;
        ih->ih_arg = arg;
        ih->ih_irq = irq;
diff -r 5c85b892f8fe -r 7cb8cc67aba9 sys/arch/arm/marvell/mvsoc_sdhc.c
--- a/sys/arch/arm/marvell/mvsoc_sdhc.c Fri Nov 20 18:03:52 2020 +0000
+++ b/sys/arch/arm/marvell/mvsoc_sdhc.c Fri Nov 20 18:16:40 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mvsoc_sdhc.c,v 1.1 2017/01/07 16:19:28 kiyohara Exp $  */
+/*     $NetBSD: mvsoc_sdhc.c,v 1.2 2020/11/20 18:26:26 thorpej Exp $   */
 /*
  * Copyright (c) 2016 KIYOHARA Takashi
  * All rights reserved.
@@ -26,13 +26,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mvsoc_sdhc.c,v 1.1 2017/01/07 16:19:28 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsoc_sdhc.c,v 1.2 2020/11/20 18:26:26 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
 #include <sys/device.h>
 #include <sys/errno.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/systm.h>
 
 #include <dev/marvell/marvellreg.h>
@@ -75,7 +75,7 @@
        int error;
 
        sc->sc_dev = self;
-       sc->sc_host = malloc(sizeof(*sc->sc_host), M_DEVBUF, M_WAITOK | M_ZERO);
+       sc->sc_host = kmem_zalloc(sizeof(*sc->sc_host), KM_SLEEP);
        sc->sc_dmat = mva->mva_dmat;
        /* Must require the DMA.  This sdhc can't 32bit access to SDHC_DATA. */
        sc->sc_flags = SDHC_FLAG_USE_DMA;
diff -r 5c85b892f8fe -r 7cb8cc67aba9 sys/arch/arm/ofw/ofw_irqhandler.c
--- a/sys/arch/arm/ofw/ofw_irqhandler.c Fri Nov 20 18:03:52 2020 +0000
+++ b/sys/arch/arm/ofw/ofw_irqhandler.c Fri Nov 20 18:16:40 2020 +0000
@@ -1,4 +1,4 @@



Home | Main Index | Thread Index | Old Index