Module Name:    src
Committed By:   thorpej
Date:           Fri Nov 20 18:37:31 UTC 2020

Modified Files:
        src/sys/arch/arm/sa11x0: sa1111.c sa11x0_com.c sa11x0_irqhandler.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/sa11x0/sa1111.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/arm/sa11x0/sa11x0_com.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/sa11x0/sa11x0_irqhandler.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/sa11x0/sa1111.c
diff -u src/sys/arch/arm/sa11x0/sa1111.c:1.25 src/sys/arch/arm/sa11x0/sa1111.c:1.26
--- src/sys/arch/arm/sa11x0/sa1111.c:1.25	Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/sa11x0/sa1111.c	Fri Nov 20 18:37:30 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: sa1111.c,v 1
 #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 @@ sacc_intr_establish(sacc_chipset_tag_t *
 	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_disestablish(sacc_chipset_tag_
 	sacc_intr_calculatemasks(sc);
 	splx(s);
 
-	free(ih, M_DEVBUF);
+	kmem_free(ih, sizeof(*ih));
 }
 
 static void

Index: src/sys/arch/arm/sa11x0/sa11x0_com.c
diff -u src/sys/arch/arm/sa11x0/sa11x0_com.c:1.57 src/sys/arch/arm/sa11x0/sa11x0_com.c:1.58
--- src/sys/arch/arm/sa11x0/sa11x0_com.c:1.57	Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/sa11x0/sa11x0_com.c	Fri Nov 20 18:37:30 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c
 #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 @@ sacom_attach_subr(struct sacom_softc *sc
 	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 @@ sacom_detach(device_t dev, int flags)
 	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);

Index: src/sys/arch/arm/sa11x0/sa11x0_irqhandler.c
diff -u src/sys/arch/arm/sa11x0/sa11x0_irqhandler.c:1.19 src/sys/arch/arm/sa11x0/sa11x0_irqhandler.c:1.20
--- src/sys/arch/arm/sa11x0/sa11x0_irqhandler.c:1.19	Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/sa11x0/sa11x0_irqhandler.c	Fri Nov 20 18:37:30 2020
@@ -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 $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_irqhandler.c,v 1.20 2020/11/20 18:37:30 thorpej Exp $");
 
 #include "opt_irqstats.h"
 
@@ -79,7 +79,7 @@ __KERNEL_RCSID(0, "$NetBSD: sa11x0_irqha
 #include <sys/syslog.h>
 #include <sys/cpu.h>
 #include <sys/intr.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -167,7 +167,7 @@ sa11x0_intr_establish(sa11x0_chipset_tag
 	struct irqhandler **p, *q, *ih;
 	static struct irqhandler fakehand = {fakeintr};
 
-	ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
+	ih = kmem_alloc(sizeof *ih, KM_SLEEP);
 
 	if (irq < 0 || irq >= ICU_LEN || type == IST_NONE)
 		panic("intr_establish: bogus irq or type");
@@ -249,7 +249,7 @@ sa11x0_intr_disestablish(sa11x0_chipset_
 		*p = q->ih_next;
 	else
 		panic("intr_disestablish: handler not registered");
-	free(ih, M_DEVBUF);
+	kmem_free(ih, sizeof(*ih));
 
 	intr_calculatemasks();
 	saved_cpsr = SetCPSR(I32_bit, I32_bit);

Reply via email to