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/be8e4c4ecc22
branches:  trunk
changeset: 1016413:be8e4c4ecc22
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Nov 20 18:03:52 2020 +0000

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

diffstat:

 sys/arch/arm/at91/at91aic.c                     |  10 +++++-----
 sys/arch/arm/at91/at91dbgu.c                    |  10 +++++-----
 sys/arch/arm/clps711x/clpscom.c                 |   8 ++++----
 sys/arch/arm/ep93xx/ep93xx_intr.c               |  10 ++++++----
 sys/arch/arm/ep93xx/epcom.c                     |   8 ++++----
 sys/arch/arm/footbridge/footbridge_com.c        |  14 +++++++-------
 sys/arch/arm/footbridge/footbridge_irqhandler.c |   8 ++++----
 sys/arch/arm/footbridge/isa/isa_machdep.c       |  10 +++++-----
 sys/arch/arm/gemini/gemini_ipi.c                |   8 ++++----
 sys/arch/arm/gemini/gemini_lpchc.c              |  10 +++++-----
 sys/arch/arm/gemini/gemini_pci.c                |  10 +++++-----
 11 files changed, 54 insertions(+), 52 deletions(-)

diffs (truncated from 448 to 300 lines):

diff -r d2ffeaeb78f2 -r be8e4c4ecc22 sys/arch/arm/at91/at91aic.c
--- a/sys/arch/arm/at91/at91aic.c       Fri Nov 20 17:48:25 2020 +0000
+++ b/sys/arch/arm/at91/at91aic.c       Fri Nov 20 18:03:52 2020 +0000
@@ -1,5 +1,5 @@
-/*     $Id: at91aic.c,v 1.11 2014/03/26 08:51:59 christos Exp $        */
-/*     $NetBSD: at91aic.c,v 1.11 2014/03/26 08:51:59 christos Exp $    */
+/*     $Id: at91aic.c,v 1.12 2020/11/20 18:03:52 thorpej Exp $ */
+/*     $NetBSD: at91aic.c,v 1.12 2020/11/20 18:03:52 thorpej Exp $     */
 
 /*
  * Copyright (c) 2007 Embedtronics Oy.
@@ -44,7 +44,7 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/termios.h>
 
 #include <uvm/uvm_extern.h>
@@ -307,7 +307,7 @@
                panic("intr_establish: interrupt type %d is invalid", type);
        }
 
-       ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
+       ih = kmem_alloc(sizeof(*ih), KM_SLEEP);
        if (ih == NULL)
                return (NULL);
 
@@ -338,7 +338,7 @@
                }
 #endif
        } else {
-               free(ih, M_DEVBUF);
+               kmem_free(ih, sizeof(*ih));
                ih = NULL;
        }
 
diff -r d2ffeaeb78f2 -r be8e4c4ecc22 sys/arch/arm/at91/at91dbgu.c
--- a/sys/arch/arm/at91/at91dbgu.c      Fri Nov 20 17:48:25 2020 +0000
+++ b/sys/arch/arm/at91/at91dbgu.c      Fri Nov 20 18:03:52 2020 +0000
@@ -1,5 +1,5 @@
-/*     $Id: at91dbgu.c,v 1.17 2019/12/15 16:48:25 tsutsui Exp $        */
-/*     $NetBSD: at91dbgu.c,v 1.17 2019/12/15 16:48:25 tsutsui Exp $ */
+/*     $Id: at91dbgu.c,v 1.18 2020/11/20 18:03:52 thorpej Exp $        */
+/*     $NetBSD: at91dbgu.c,v 1.18 2020/11/20 18:03:52 thorpej Exp $ */
 
 /*
  *
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.17 2019/12/15 16:48:25 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.18 2020/11/20 18:03:52 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -106,7 +106,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>
@@ -249,7 +249,7 @@
        tp->t_hwiflow = at91dbgu_hwiflow;
 
        sc->sc_tty = tp;
-       sc->sc_rbuf = malloc(AT91DBGU_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
+       sc->sc_rbuf = kmem_alloc(AT91DBGU_RING_SIZE << 1, KM_SLEEP);
        sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
        sc->sc_rbavail = AT91DBGU_RING_SIZE;
        sc->sc_ebuf = sc->sc_rbuf + (AT91DBGU_RING_SIZE << 1);
diff -r d2ffeaeb78f2 -r be8e4c4ecc22 sys/arch/arm/clps711x/clpscom.c
--- a/sys/arch/arm/clps711x/clpscom.c   Fri Nov 20 17:48:25 2020 +0000
+++ b/sys/arch/arm/clps711x/clpscom.c   Fri Nov 20 18:03:52 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: clpscom.c,v 1.8 2019/11/10 21:16:23 chs Exp $      */
+/*      $NetBSD: clpscom.c,v 1.9 2020/11/20 18:03:52 thorpej Exp $      */
 /*
  * Copyright (c) 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clpscom.c,v 1.8 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clpscom.c,v 1.9 2020/11/20 18:03:52 thorpej Exp $");
 
 #include "rnd.h"
 
@@ -38,7 +38,7 @@
 #include <sys/intr.h>
 #include <sys/kauth.h>
 #include <sys/lwp.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/systm.h>
 #include <sys/termios.h>
 #include <sys/tty.h>
@@ -222,7 +222,7 @@
        sc->sc_tty->t_hwiflow = clpscom_hwiflow;
 
        sc->sc_tbc = 0;
-       sc->sc_rbuf = malloc(CLPSCOM_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
+       sc->sc_rbuf = kmem_alloc(CLPSCOM_RING_SIZE << 1, KM_SLEEP);
        sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
        sc->sc_rbavail = CLPSCOM_RING_SIZE;
 
diff -r d2ffeaeb78f2 -r be8e4c4ecc22 sys/arch/arm/ep93xx/ep93xx_intr.c
--- a/sys/arch/arm/ep93xx/ep93xx_intr.c Fri Nov 20 17:48:25 2020 +0000
+++ b/sys/arch/arm/ep93xx/ep93xx_intr.c Fri Nov 20 18:03:52 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ep93xx_intr.c,v 1.25 2019/11/10 21:16:23 chs Exp $ */
+/* $NetBSD: ep93xx_intr.c,v 1.26 2020/11/20 18:03:52 thorpej Exp $ */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.25 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.26 2020/11/20 18:03:52 thorpej Exp $");
 
 /*
  * Interrupt support for the Cirrus Logic EP93XX
@@ -41,7 +41,7 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/termios.h>
 #include <sys/lwp.h>
 
@@ -287,7 +287,7 @@
        if (ipl < 0 || ipl > NIPL)
                panic("ep93xx_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;
@@ -314,6 +314,8 @@
        TAILQ_REMOVE(&iq->iq_list, ih, ih_list);
        ep93xx_intr_calculate_masks();
        restore_interrupts(oldirqstate);
+
+       kmem_free(ih, sizeof(*ih));
 }
 
 void
diff -r d2ffeaeb78f2 -r be8e4c4ecc22 sys/arch/arm/ep93xx/epcom.c
--- a/sys/arch/arm/ep93xx/epcom.c       Fri Nov 20 17:48:25 2020 +0000
+++ b/sys/arch/arm/ep93xx/epcom.c       Fri Nov 20 18:03:52 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: epcom.c,v 1.31 2019/11/10 21:16:23 chs Exp $ */
+/*     $NetBSD: epcom.c,v 1.32 2020/11/20 18:03:52 thorpej Exp $ */
 /*
  * Copyright (c) 1998, 1999, 2001, 2002, 2004 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.31 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.32 2020/11/20 18:03:52 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -103,7 +103,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>
@@ -213,7 +213,7 @@
        tp->t_hwiflow = epcomhwiflow;
 
        sc->sc_tty = tp;
-       sc->sc_rbuf = malloc(EPCOM_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
+       sc->sc_rbuf = kmem_alloc(EPCOM_RING_SIZE << 1, KM_SLEEP);
        sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
        sc->sc_rbavail = EPCOM_RING_SIZE;
        sc->sc_ebuf = sc->sc_rbuf + (EPCOM_RING_SIZE << 1);
diff -r d2ffeaeb78f2 -r be8e4c4ecc22 sys/arch/arm/footbridge/footbridge_com.c
--- a/sys/arch/arm/footbridge/footbridge_com.c  Fri Nov 20 17:48:25 2020 +0000
+++ b/sys/arch/arm/footbridge/footbridge_com.c  Fri Nov 20 18:03:52 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: footbridge_com.c,v 1.38 2014/07/25 08:10:32 dholland Exp $     */
+/*     $NetBSD: footbridge_com.c,v 1.39 2020/11/20 18:03:52 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1997 Mark Brinicombe
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: footbridge_com.c,v 1.38 2014/07/25 08:10:32 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: footbridge_com.c,v 1.39 2020/11/20 18:03:52 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ddbparam.h"
@@ -50,7 +50,7 @@
 #include <sys/conf.h>
 #include <sys/syslog.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/termios.h>
 #include <sys/kauth.h>
 #include <sys/bus.h>
@@ -239,8 +239,8 @@
        if (!(tp = sc->sc_tty))
                sc->sc_tty = tp = tty_alloc();
        if (!sc->sc_rxbuffer[0]) {
-               sc->sc_rxbuffer[0] = malloc(RX_BUFFER_SIZE, M_DEVBUF, M_WAITOK);
-               sc->sc_rxbuffer[1] = malloc(RX_BUFFER_SIZE, M_DEVBUF, M_WAITOK);
+               sc->sc_rxbuffer[0] = kmem_alloc(RX_BUFFER_SIZE, KM_SLEEP);
+               sc->sc_rxbuffer[1] = kmem_alloc(RX_BUFFER_SIZE, KM_SLEEP);
                sc->sc_rxpos = 0;
                sc->sc_rxcur = 0;
                sc->sc_rxbuf = sc->sc_rxbuffer[sc->sc_rxcur];
@@ -295,8 +295,8 @@
        if (sc->sc_rxbuffer[0] == NULL)
                panic("fcomclose: rx buffers not allocated");
 #endif /* DIAGNOSTIC */
-       free(sc->sc_rxbuffer[0], M_DEVBUF);
-       free(sc->sc_rxbuffer[1], M_DEVBUF);
+       kmem_free(sc->sc_rxbuffer[0], RX_BUFFER_SIZE);
+       kmem_free(sc->sc_rxbuffer[1], RX_BUFFER_SIZE);
        sc->sc_rxbuffer[0] = NULL;
        sc->sc_rxbuffer[1] = NULL;
 
diff -r d2ffeaeb78f2 -r be8e4c4ecc22 sys/arch/arm/footbridge/footbridge_irqhandler.c
--- a/sys/arch/arm/footbridge/footbridge_irqhandler.c   Fri Nov 20 17:48:25 2020 +0000
+++ b/sys/arch/arm/footbridge/footbridge_irqhandler.c   Fri Nov 20 18:03:52 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: footbridge_irqhandler.c,v 1.26 2019/11/10 21:16:23 chs Exp $   */
+/*     $NetBSD: footbridge_irqhandler.c,v 1.27 2020/11/20 18:03:52 thorpej Exp $       */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,13 +40,13 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0,"$NetBSD: footbridge_irqhandler.c,v 1.26 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0,"$NetBSD: footbridge_irqhandler.c,v 1.27 2020/11/20 18:03:52 thorpej Exp $");
 
 #include "opt_irqstats.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 
 #include <machine/intr.h>
 #include <machine/cpu.h>
@@ -227,7 +227,7 @@
        if (irq < 0 || irq > NIRQ)
                panic("footbridge_intr_establish: IRQ %d out of range", irq);
 
-       ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
+       ih = kmem_alloc(sizeof(*ih), KM_SLEEP);
        ih->ih_func = func;
        ih->ih_arg = arg;
        ih->ih_ipl = ipl;
diff -r d2ffeaeb78f2 -r be8e4c4ecc22 sys/arch/arm/footbridge/isa/isa_machdep.c
--- a/sys/arch/arm/footbridge/isa/isa_machdep.c Fri Nov 20 17:48:25 2020 +0000
+++ b/sys/arch/arm/footbridge/isa/isa_machdep.c Fri Nov 20 18:03:52 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isa_machdep.c,v 1.22 2019/11/10 21:16:23 chs Exp $     */
+/*     $NetBSD: isa_machdep.c,v 1.23 2020/11/20 18:03:53 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1996-1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.22 2019/11/10 21:16:23 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.23 2020/11/20 18:03:53 thorpej Exp $");
 
 #include "opt_irqstats.h"
 
@@ -74,7 +74,7 @@
 #include <sys/kernel.h>
 #include <sys/syslog.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>



Home | Main Index | Thread Index | Old Index