Module Name:    src
Committed By:   thorpej
Date:           Fri Nov 20 18:34:45 UTC 2020

Modified Files:
        src/sys/arch/arm/omap: omap_gpio.c
        src/sys/arch/arm/s3c2xx0: s3c2440_dma.c s3c24x0_lcd.c s3c2800_pci.c
            sscom.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/omap/omap_gpio.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/s3c2xx0/s3c2440_dma.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/s3c2xx0/s3c2800_pci.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/arm/s3c2xx0/sscom.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/omap/omap_gpio.c
diff -u src/sys/arch/arm/omap/omap_gpio.c:1.9 src/sys/arch/arm/omap/omap_gpio.c:1.10
--- src/sys/arch/arm/omap/omap_gpio.c:1.9	Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/omap/omap_gpio.c	Fri Nov 20 18:34:45 2020
@@ -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 @@ omap_gpio_intr_establish(u_int gpio, int
 		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 @@ omap_gpio_intr_disestablish(void *cookie
 	sc->sc_handlers[relnum] = NULL;
 
 
-	free(gh, M_DEVBUF);
+	kmem_free(gh, sizeof(*gh));
 }
 
 void

Index: src/sys/arch/arm/s3c2xx0/s3c2440_dma.c
diff -u src/sys/arch/arm/s3c2xx0/s3c2440_dma.c:1.4 src/sys/arch/arm/s3c2xx0/s3c2440_dma.c:1.5
--- src/sys/arch/arm/s3c2xx0/s3c2440_dma.c:1.4	Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/s3c2xx0/s3c2440_dma.c	Fri Nov 20 18:34:45 2020
@@ -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 @@ dmac_xfer_t
 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 @@ s3c2440_dmac_allocate_xfer(void) {
 
 void
 s3c2440_dmac_free_xfer(dmac_xfer_t dx) {
-	free(dx, M_DEVBUF);
+	kmem_free(dx, sizeof(struct dmac_xfer_state));
 }
 
 int

Index: src/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c
diff -u src/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c:1.14 src/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c:1.15
--- src/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c:1.14	Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/s3c2xx0/s3c24x0_lcd.c	Fri Nov 20 18:34:45 2020
@@ -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 @@ s3c24x0_lcd_new_screen(struct s3c24x0_lc
 		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 @@ s3c24x0_lcd_new_screen(struct s3c24x0_lc
 			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 @@ s3c24x0_lcd_free_screen(void *v, void *c
 	if (scr->nsegs > 0)
 		bus_dmamem_free(sc->dma_tag, scr->segs, scr->nsegs);
 
-	free(scr, M_DEVBUF);
+	kmem_free(scr, sizeof(*scr));
 }
 
 int

Index: src/sys/arch/arm/s3c2xx0/s3c2800_pci.c
diff -u src/sys/arch/arm/s3c2xx0/s3c2800_pci.c:1.29 src/sys/arch/arm/s3c2xx0/s3c2800_pci.c:1.30
--- src/sys/arch/arm/s3c2xx0/s3c2800_pci.c:1.29	Tue Jul  7 03:38:46 2020
+++ src/sys/arch/arm/s3c2xx0/s3c2800_pci.c	Fri Nov 20 18:34:45 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: s3c2800_pci.
 #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 @@ s3c2800_pci_intr_establish(void *pcv, pc
 	    "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;

Index: src/sys/arch/arm/s3c2xx0/sscom.c
diff -u src/sys/arch/arm/s3c2xx0/sscom.c:1.48 src/sys/arch/arm/s3c2xx0/sscom.c:1.49
--- src/sys/arch/arm/s3c2xx0/sscom.c:1.48	Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/s3c2xx0/sscom.c	Fri Nov 20 18:34:45 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.
 #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 @@ sscom_attach_subr(struct sscom_softc *sc
 	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);

Reply via email to