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/3e50a710399f
branches:  trunk
changeset: 978380:3e50a710399f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Nov 20 18:34:45 2020 +0000

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

diffstat:

 sys/arch/arm/omap/omap_gpio.c           |  10 +++++-----
 sys/arch/arm/s3c2xx0/s3c2440_dma.c      |   6 +++---
 sys/arch/arm/s3c2xx0/s3c24x0_lcd.c      |  12 ++++++------
 sys/arch/arm/s3c2xx0/s3c2800_pci.c      |   8 ++++----
 sys/arch/arm/s3c2xx0/sscom.c            |   8 ++++----
 sys/arch/arm/sa11x0/sa1111.c            |  10 +++++-----
 sys/arch/arm/sa11x0/sa11x0_com.c        |  10 +++++-----
 sys/arch/arm/sa11x0/sa11x0_irqhandler.c |  10 +++++-----
 8 files changed, 37 insertions(+), 37 deletions(-)

diffs (truncated from 331 to 300 lines):

diff -r d993c5ac510a -r 3e50a710399f sys/arch/arm/omap/omap_gpio.c
--- a/sys/arch/arm/omap/omap_gpio.c     Fri Nov 20 18:16:40 2020 +0000
+++ b/sys/arch/arm/omap/omap_gpio.c     Fri Nov 20 18:34:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: omap_gpio.c,v 1.9 2019/11/10 21:16:24 chs Exp $ */
+/*     $NetBSD: omap_gpio.c,v 1.10 2020/11/20 18:34:45 thorpej Exp $ */
 
 /*
  * The OMAP GPIO Controller interface is inspired by pxa2x0_gpio.c
@@ -38,12 +38,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap_gpio.c,v 1.9 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap_gpio.c,v 1.10 2020/11/20 18:34:45 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 
 #include <machine/intr.h>
 #include <sys/bus.h>
@@ -275,7 +275,7 @@
                panic("omapgpio: Illegal shared interrupt on pin %d", gpio);
        }
 
-       gh = malloc(sizeof(struct gpio_irq_handler), M_DEVBUF, M_WAITOK);
+       gh = kmem_alloc(sizeof(*gh), KM_SLEEP);
        gh->gh_func = func;
        gh->gh_arg = arg;
        gh->gh_spl = spl;
@@ -368,7 +368,7 @@
        sc->sc_handlers[relnum] = NULL;
 
 
-       free(gh, M_DEVBUF);
+       kmem_free(gh, sizeof(*gh));
 }
 
 void
diff -r d993c5ac510a -r 3e50a710399f sys/arch/arm/s3c2xx0/s3c2440_dma.c
--- a/sys/arch/arm/s3c2xx0/s3c2440_dma.c        Fri Nov 20 18:16:40 2020 +0000
+++ b/sys/arch/arm/s3c2xx0/s3c2440_dma.c        Fri Nov 20 18:34:45 2020 +0000
@@ -33,7 +33,7 @@
 #include <sys/systm.h>
 #include <sys/device.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/queue.h>
 
 #include <sys/mutex.h>
@@ -276,7 +276,7 @@
 s3c2440_dmac_allocate_xfer(void) {
        struct dmac_xfer_state *dxs;
 
-       dxs = malloc(sizeof(struct dmac_xfer_state), M_DEVBUF, M_WAITOK);
+       dxs = kmem_alloc(sizeof(struct dmac_xfer_state), KM_SLEEP);
 
        dxs->dxs_xfer.dx_done = NULL;
        dxs->dxs_xfer.dx_sync_bus = DMAC_SYNC_BUS_AUTO;
@@ -288,7 +288,7 @@
 
 void
 s3c2440_dmac_free_xfer(dmac_xfer_t dx) {
-       free(dx, M_DEVBUF);
+       kmem_free(dx, sizeof(struct dmac_xfer_state));
 }
 
 int
diff -r d993c5ac510a -r 3e50a710399f sys/arch/arm/s3c2xx0/s3c24x0_lcd.c
--- a/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c        Fri Nov 20 18:16:40 2020 +0000
+++ b/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c        Fri Nov 20 18:34:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: s3c24x0_lcd.c,v 1.14 2019/11/10 21:16:24 chs Exp $ */
+/* $NetBSD: s3c24x0_lcd.c,v 1.15 2020/11/20 18:34:45 thorpej Exp $ */
 
 /*
  * Copyright (c) 2004  Genetec Corporation.  All rights reserved.
@@ -34,13 +34,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: s3c24x0_lcd.c,v 1.14 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: s3c24x0_lcd.c,v 1.15 2020/11/20 18:34:45 thorpej Exp $");
 
 #include <sys/param.h>
 #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 <uvm/uvm_extern.h>
@@ -338,7 +338,7 @@
                return NULL;
        }
 
-       scr = malloc(sizeof *scr, M_DEVBUF, M_ZERO | M_WAITOK);
+       scr = kmem_zalloc(sizeof *scr, KM_SLEEP);
        scr->nsegs = 0;
        scr->depth = depth;
        scr->stride = virtual_width * depth / 8;
@@ -392,7 +392,7 @@
                        bus_dmamem_unmap(sc->dma_tag, scr->buf_va, size);
                if (scr->nsegs)
                        bus_dmamem_free(sc->dma_tag, scr->segs, scr->nsegs);
-               free(scr, M_DEVBUF);
+               kmem_free(scr, sizeof(*scr));
        }
        return NULL;
 }
@@ -608,7 +608,7 @@
        if (scr->nsegs > 0)
                bus_dmamem_free(sc->dma_tag, scr->segs, scr->nsegs);
 
-       free(scr, M_DEVBUF);
+       kmem_free(scr, sizeof(*scr));
 }
 
 int
diff -r d993c5ac510a -r 3e50a710399f sys/arch/arm/s3c2xx0/s3c2800_pci.c
--- a/sys/arch/arm/s3c2xx0/s3c2800_pci.c        Fri Nov 20 18:16:40 2020 +0000
+++ b/sys/arch/arm/s3c2xx0/s3c2800_pci.c        Fri Nov 20 18:34:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: s3c2800_pci.c,v 1.29 2020/07/07 03:38:46 thorpej Exp $ */
+/*     $NetBSD: s3c2800_pci.c,v 1.30 2020/11/20 18:34:45 thorpej Exp $ */
 
 /*
  * Copyright (c) 2002 Fujitsu Component Limited
@@ -100,7 +100,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: s3c2800_pci.c,v 1.29 2020/07/07 03:38:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: s3c2800_pci.c,v 1.30 2020/11/20 18:34:45 thorpej Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -109,7 +109,7 @@
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -517,7 +517,7 @@
            "func=%p, arg=%p, xname=%s)\n", pcv, ih, level, func, arg, xname);
 #endif
 
-       handler = malloc(sizeof *handler, M_DEVBUF, M_WAITOK);
+       handler = kmem_alloc(sizeof *handler, KM_SLEEP);
        handler->func = func;
        handler->arg = arg;
        handler->level = level;
diff -r d993c5ac510a -r 3e50a710399f sys/arch/arm/s3c2xx0/sscom.c
--- a/sys/arch/arm/s3c2xx0/sscom.c      Fri Nov 20 18:16:40 2020 +0000
+++ b/sys/arch/arm/s3c2xx0/sscom.c      Fri Nov 20 18:34:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sscom.c,v 1.48 2019/11/10 21:16:24 chs Exp $ */
+/*     $NetBSD: sscom.c,v 1.49 2020/11/20 18:34:45 thorpej Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 Fujitsu Component Limited
@@ -98,7 +98,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.48 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.49 2020/11/20 18:34:45 thorpej Exp $");
 
 #include "opt_sscom.h"
 #include "opt_ddb.h"
@@ -135,7 +135,7 @@
 #include <sys/syslog.h>
 #include <sys/types.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>
@@ -481,7 +481,7 @@
        tp->t_hwiflow = sscomhwiflow;
 
        sc->sc_tty = tp;
-       sc->sc_rbuf = malloc(sscom_rbuf_size << 1, M_DEVBUF, M_WAITOK);
+       sc->sc_rbuf = kmem_alloc(sscom_rbuf_size << 1, KM_SLEEP);
        sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
        sc->sc_rbavail = sscom_rbuf_size;
        sc->sc_ebuf = sc->sc_rbuf + (sscom_rbuf_size << 1);
diff -r d993c5ac510a -r 3e50a710399f sys/arch/arm/sa11x0/sa1111.c
--- a/sys/arch/arm/sa11x0/sa1111.c      Fri Nov 20 18:16:40 2020 +0000
+++ b/sys/arch/arm/sa11x0/sa1111.c      Fri Nov 20 18:34:45 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: sa1111.c,v 1.25 2019/11/10 21:16:24 chs Exp $ */
+/*      $NetBSD: sa1111.c,v 1.26 2020/11/20 18:37:30 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sa1111.c,v 1.25 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa1111.c,v 1.26 2020/11/20 18:37:30 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -43,7 +43,7 @@
 #include <sys/conf.h>
 #include <sys/device.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/uio.h>
 
 #include <sys/bus.h>
@@ -124,7 +124,7 @@
        struct sacc_softc *sc = (struct sacc_softc *)ic;
        struct sacc_intrhand **p, *ih;
 
-       ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
+       ih = kmem_alloc(sizeof *ih, KM_SLEEP);
 
        if (irq < 0 || irq > SACCIC_LEN ||
            !(type == IST_EDGE_RAISE || type == IST_EDGE_FALL))
@@ -186,7 +186,7 @@
        sacc_intr_calculatemasks(sc);
        splx(s);
 
-       free(ih, M_DEVBUF);
+       kmem_free(ih, sizeof(*ih));
 }
 
 static void
diff -r d993c5ac510a -r 3e50a710399f sys/arch/arm/sa11x0/sa11x0_com.c
--- a/sys/arch/arm/sa11x0/sa11x0_com.c  Fri Nov 20 18:16:40 2020 +0000
+++ b/sys/arch/arm/sa11x0/sa11x0_com.c  Fri Nov 20 18:34:45 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: sa11x0_com.c,v 1.57 2019/11/10 21:16:24 chs Exp $        */
+/*      $NetBSD: sa11x0_com.c,v 1.58 2020/11/20 18:37:30 thorpej Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.57 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.58 2020/11/20 18:37:30 thorpej Exp $");
 
 #include "opt_com.h"
 #include "opt_console.h"
@@ -85,7 +85,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>
@@ -311,7 +311,7 @@
        tp->t_hwiflow = sacomhwiflow;
 
        sc->sc_tty = tp;
-       sc->sc_rbuf = malloc(SACOM_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
+       sc->sc_rbuf = kmem_alloc(SACOM_RING_SIZE << 1, KM_SLEEP);
        sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
        sc->sc_rbavail = SACOM_RING_SIZE;
        sc->sc_ebuf = sc->sc_rbuf + (SACOM_RING_SIZE << 1);
@@ -377,7 +377,7 @@
        vdevgone(maj, mn, mn, VCHR);
 
        /* Free the receive buffer. */
-       free(sc->sc_rbuf, M_DEVBUF);
+       kmem_free(sc->sc_rbuf, SACOM_RING_SIZE << 1);
 
        /* Detach and free the tty. */
        tty_detach(sc->sc_tty);
diff -r d993c5ac510a -r 3e50a710399f sys/arch/arm/sa11x0/sa11x0_irqhandler.c
--- a/sys/arch/arm/sa11x0/sa11x0_irqhandler.c   Fri Nov 20 18:16:40 2020 +0000
+++ b/sys/arch/arm/sa11x0/sa11x0_irqhandler.c   Fri Nov 20 18:34:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sa11x0_irqhandler.c,v 1.19 2019/11/10 21:16:24 chs Exp $       */
+/*     $NetBSD: sa11x0_irqhandler.c,v 1.20 2020/11/20 18:37:30 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_irqhandler.c,v 1.19 2019/11/10 21:16:24 chs Exp $");



Home | Main Index | Thread Index | Old Index