Module Name:    src
Committed By:   thorpej
Date:           Fri Nov 20 18:03:53 UTC 2020

Modified Files:
        src/sys/arch/arm/at91: at91aic.c at91dbgu.c
        src/sys/arch/arm/clps711x: clpscom.c
        src/sys/arch/arm/ep93xx: ep93xx_intr.c epcom.c
        src/sys/arch/arm/footbridge: footbridge_com.c footbridge_irqhandler.c
        src/sys/arch/arm/footbridge/isa: isa_machdep.c

Log Message:
malloc(9) -> kmem(9)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/at91/at91aic.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/at91/at91dbgu.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/clps711x/clpscom.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/ep93xx/ep93xx_intr.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/ep93xx/epcom.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/footbridge/footbridge_com.c
cvs rdiff -u -r1.26 -r1.27 \
    src/sys/arch/arm/footbridge/footbridge_irqhandler.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/footbridge/isa/isa_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/arm/at91/at91aic.c
diff -u src/sys/arch/arm/at91/at91aic.c:1.11 src/sys/arch/arm/at91/at91aic.c:1.12
--- src/sys/arch/arm/at91/at91aic.c:1.11	Wed Mar 26 08:51:59 2014
+++ src/sys/arch/arm/at91/at91aic.c	Fri Nov 20 18:03:52 2020
@@ -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 @@ at91aic_intr_establish(int irq, int ipl,
 		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 @@ at91aic_intr_establish(int irq, int ipl,
 		}
 #endif
 	} else {
-		free(ih, M_DEVBUF);
+		kmem_free(ih, sizeof(*ih));
 		ih = NULL;
 	}
 

Index: src/sys/arch/arm/at91/at91dbgu.c
diff -u src/sys/arch/arm/at91/at91dbgu.c:1.17 src/sys/arch/arm/at91/at91dbgu.c:1.18
--- src/sys/arch/arm/at91/at91dbgu.c:1.17	Sun Dec 15 16:48:25 2019
+++ src/sys/arch/arm/at91/at91dbgu.c	Fri Nov 20 18:03:52 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v
 #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 @@ at91dbgu_attach(device_t parent, device_
 	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);

Index: src/sys/arch/arm/clps711x/clpscom.c
diff -u src/sys/arch/arm/clps711x/clpscom.c:1.8 src/sys/arch/arm/clps711x/clpscom.c:1.9
--- src/sys/arch/arm/clps711x/clpscom.c:1.8	Sun Nov 10 21:16:23 2019
+++ src/sys/arch/arm/clps711x/clpscom.c	Fri Nov 20 18:03:52 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: clpscom.c,v 
 #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 @@ clpscom_attach(device_t parent, device_t
 	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;
 

Index: src/sys/arch/arm/ep93xx/ep93xx_intr.c
diff -u src/sys/arch/arm/ep93xx/ep93xx_intr.c:1.25 src/sys/arch/arm/ep93xx/ep93xx_intr.c:1.26
--- src/sys/arch/arm/ep93xx/ep93xx_intr.c:1.25	Sun Nov 10 21:16:23 2019
+++ src/sys/arch/arm/ep93xx/ep93xx_intr.c	Fri Nov 20 18:03:52 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.
 
 #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 @@ ep93xx_intr_establish(int irq, int ipl, 
 	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 @@ ep93xx_intr_disestablish(void *cookie)
 	TAILQ_REMOVE(&iq->iq_list, ih, ih_list);
 	ep93xx_intr_calculate_masks();
 	restore_interrupts(oldirqstate);
+
+	kmem_free(ih, sizeof(*ih));
 }
 
 void

Index: src/sys/arch/arm/ep93xx/epcom.c
diff -u src/sys/arch/arm/ep93xx/epcom.c:1.31 src/sys/arch/arm/ep93xx/epcom.c:1.32
--- src/sys/arch/arm/ep93xx/epcom.c:1.31	Sun Nov 10 21:16:23 2019
+++ src/sys/arch/arm/ep93xx/epcom.c	Fri Nov 20 18:03:52 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.
 #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 @@ epcom_attach_subr(struct epcom_softc *sc
 	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);

Index: src/sys/arch/arm/footbridge/footbridge_com.c
diff -u src/sys/arch/arm/footbridge/footbridge_com.c:1.38 src/sys/arch/arm/footbridge/footbridge_com.c:1.39
--- src/sys/arch/arm/footbridge/footbridge_com.c:1.38	Fri Jul 25 08:10:32 2014
+++ src/sys/arch/arm/footbridge/footbridge_com.c	Fri Nov 20 18:03:52 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: footbridge_c
 #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 @@ fcomopen(dev_t dev, int flag, int mode, 
 	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 @@ fcomclose(dev_t dev, int flag, int mode,
 	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;
 

Index: src/sys/arch/arm/footbridge/footbridge_irqhandler.c
diff -u src/sys/arch/arm/footbridge/footbridge_irqhandler.c:1.26 src/sys/arch/arm/footbridge/footbridge_irqhandler.c:1.27
--- src/sys/arch/arm/footbridge/footbridge_irqhandler.c:1.26	Sun Nov 10 21:16:23 2019
+++ src/sys/arch/arm/footbridge/footbridge_irqhandler.c	Fri Nov 20 18:03:52 2020
@@ -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 @@ footbridge_intr_claim(int irq, int ipl, 
 	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;

Index: src/sys/arch/arm/footbridge/isa/isa_machdep.c
diff -u src/sys/arch/arm/footbridge/isa/isa_machdep.c:1.22 src/sys/arch/arm/footbridge/isa/isa_machdep.c:1.23
--- src/sys/arch/arm/footbridge/isa/isa_machdep.c:1.22	Sun Nov 10 21:16:23 2019
+++ src/sys/arch/arm/footbridge/isa/isa_machdep.c	Fri Nov 20 18:03:53 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: isa_machdep.
 #include <sys/kernel.h>
 #include <sys/syslog.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/proc.h>
 
 #define _ARM32_BUS_DMA_PRIVATE
@@ -338,7 +338,7 @@ isa_intr_establish(isa_chipset_tag_t ic,
 #if 0
 	printf("isa_intr_establish(%d, %d, %d)\n", irq, type, level);
 #endif
-	ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
+	ih = kmem_alloc(sizeof *ih, KM_SLEEP);
 
 	if (!LEGAL_IRQ(irq) || type == IST_NONE)
 		panic("intr_establish: bogus irq or type");
@@ -411,7 +411,7 @@ isa_intr_disestablish(isa_chipset_tag_t 
 
 	restore_interrupts(oldirqstate);
 
-	free(ih, M_DEVBUF);
+	kmem_free(ih, sizeof(*ih));
 
 	if (TAILQ_EMPTY(&(iq->iq_list)))
 		iq->iq_ist = IST_NONE;

Reply via email to