Module Name: src
Committed By: thorpej
Date: Fri Nov 20 18:49:45 UTC 2020
Modified Files:
src/sys/arch/arm/xilinx: zynq_uart.c
src/sys/arch/arm/xscale: becc_icu.c i80321_icu.c ixp425_intr.c
pxa2x0_gpio.c pxa2x0_lcd.c
Log Message:
malloc(9) -> kmem(9)
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/xilinx/zynq_uart.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/xscale/becc_icu.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/xscale/i80321_icu.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/xscale/ixp425_intr.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/xscale/pxa2x0_gpio.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/xscale/pxa2x0_lcd.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/xilinx/zynq_uart.c
diff -u src/sys/arch/arm/xilinx/zynq_uart.c:1.2 src/sys/arch/arm/xilinx/zynq_uart.c:1.3
--- src/sys/arch/arm/xilinx/zynq_uart.c:1.2 Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/xilinx/zynq_uart.c Fri Nov 20 18:49:44 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: zynq_uart.c,v 1.2 2019/11/10 21:16:24 chs Exp $ */
+/* $NetBSD: zynq_uart.c,v 1.3 2020/11/20 18:49:44 thorpej Exp $ */
/*
* Copyright (c) 2012 Genetec Corporation. All rights reserved.
@@ -96,7 +96,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zynq_uart.c,v 1.2 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zynq_uart.c,v 1.3 2020/11/20 18:49:44 thorpej Exp $");
#include "opt_soc.h"
#include "opt_console.h"
@@ -126,7 +126,7 @@ __KERNEL_RCSID(0, "$NetBSD: zynq_uart.c,
#include <sys/file.h>
#include <sys/kauth.h>
#include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/poll.h>
#include <sys/proc.h>
#include <sys/systm.h>
@@ -412,8 +412,8 @@ zynquart_attach_common(device_t parent,
tp->t_hwiflow = zynquarthwiflow;
sc->sc_tty = tp;
- sc->sc_rbuf = malloc(sizeof (*sc->sc_rbuf) * zynquart_rbuf_size,
- M_DEVBUF, M_WAITOK);
+ sc->sc_rbuf = kmem_alloc(sizeof (*sc->sc_rbuf) * zynquart_rbuf_size,
+ KM_SLEEP);
sc->sc_rbuf_size = zynquart_rbuf_size;
sc->sc_rbuf_in = sc->sc_rbuf_out = 0;
sc->sc_txfifo_len = 64;
@@ -538,7 +538,7 @@ zynquart_detach(device_t self, int flags
}
/* Free the receive buffer. */
- free(sc->sc_rbuf, M_DEVBUF);
+ kmem_free(sc->sc_rbuf, sizeof(*sc->sc_rbuf) * sc->sc_rbuf_size);
/* Detach and free the tty. */
tty_detach(sc->sc_tty);
Index: src/sys/arch/arm/xscale/becc_icu.c
diff -u src/sys/arch/arm/xscale/becc_icu.c:1.14 src/sys/arch/arm/xscale/becc_icu.c:1.15
--- src/sys/arch/arm/xscale/becc_icu.c:1.14 Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/xscale/becc_icu.c Fri Nov 20 18:49:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: becc_icu.c,v 1.14 2019/11/10 21:16:24 chs Exp $ */
+/* $NetBSD: becc_icu.c,v 1.15 2020/11/20 18:49:45 thorpej Exp $ */
/*
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: becc_icu.c,v 1.14 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: becc_icu.c,v 1.15 2020/11/20 18:49:45 thorpej Exp $");
#ifndef EVBARM_SPL_NOINLINE
#define EVBARM_SPL_NOINLINE
@@ -48,7 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: becc_icu.c,v
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/bus.h>
#include <sys/intr.h>
@@ -293,7 +293,7 @@ becc_intr_establish(int irq, int ipl, in
if (irq < 0 || irq > NIRQ)
panic("becc_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/xscale/i80321_icu.c
diff -u src/sys/arch/arm/xscale/i80321_icu.c:1.25 src/sys/arch/arm/xscale/i80321_icu.c:1.26
--- src/sys/arch/arm/xscale/i80321_icu.c:1.25 Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/xscale/i80321_icu.c Fri Nov 20 18:49:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: i80321_icu.c,v 1.25 2019/11/10 21:16:24 chs Exp $ */
+/* $NetBSD: i80321_icu.c,v 1.26 2020/11/20 18:49:45 thorpej Exp $ */
/*
* Copyright (c) 2001, 2002, 2006 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.25 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.26 2020/11/20 18:49:45 thorpej Exp $");
#ifndef EVBARM_SPL_NOINLINE
#define EVBARM_SPL_NOINLINE
@@ -48,7 +48,7 @@ __KERNEL_RCSID(0, "$NetBSD: i80321_icu.c
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <uvm/uvm_extern.h>
@@ -309,7 +309,7 @@ i80321_intr_establish(int irq, int ipl,
if (irq < 0 || irq > NIRQ)
panic("i80321_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/xscale/ixp425_intr.c
diff -u src/sys/arch/arm/xscale/ixp425_intr.c:1.27 src/sys/arch/arm/xscale/ixp425_intr.c:1.28
--- src/sys/arch/arm/xscale/ixp425_intr.c:1.27 Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/xscale/ixp425_intr.c Fri Nov 20 18:49:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixp425_intr.c,v 1.27 2019/11/10 21:16:24 chs Exp $ */
+/* $NetBSD: ixp425_intr.c,v 1.28 2020/11/20 18:49:45 thorpej Exp $ */
/*
* Copyright (c) 2003
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixp425_intr.c,v 1.27 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp425_intr.c,v 1.28 2020/11/20 18:49:45 thorpej Exp $");
#ifndef EVBARM_SPL_NOINLINE
#define EVBARM_SPL_NOINLINE
@@ -74,7 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: ixp425_intr.
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/bus.h>
#include <machine/intr.h>
@@ -343,7 +343,7 @@ ixp425_intr_establish(int irq, int ipl,
irq, ipl, (uint32_t) func, (uint32_t) arg);
#endif
- 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/xscale/pxa2x0_gpio.c
diff -u src/sys/arch/arm/xscale/pxa2x0_gpio.c:1.18 src/sys/arch/arm/xscale/pxa2x0_gpio.c:1.19
--- src/sys/arch/arm/xscale/pxa2x0_gpio.c:1.18 Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/xscale/pxa2x0_gpio.c Fri Nov 20 18:49:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0_gpio.c,v 1.18 2019/11/10 21:16:24 chs Exp $ */
+/* $NetBSD: pxa2x0_gpio.c,v 1.19 2020/11/20 18:49:45 thorpej Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_gpio.c,v 1.18 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_gpio.c,v 1.19 2020/11/20 18:49:45 thorpej Exp $");
#include "gpio.h"
#include "opt_pxa2x0_gpio.h"
@@ -44,7 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: pxa2x0_gpio.
#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>
@@ -280,7 +280,7 @@ pxa2x0_gpio_intr_establish(u_int gpio, i
if (sc->sc_handlers[gpio] != NULL)
panic("pxa2x0_gpio_intr_establish: illegal shared interrupt");
- 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;
@@ -365,7 +365,7 @@ pxa2x0_gpio_intr_disestablish(void *cook
#endif
}
- free(gh, M_DEVBUF);
+ kmem_free(gh, sizeof(*gh));
}
static int
Index: src/sys/arch/arm/xscale/pxa2x0_lcd.c
diff -u src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.37 src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.38
--- src/sys/arch/arm/xscale/pxa2x0_lcd.c:1.37 Sun Nov 10 21:16:24 2019
+++ src/sys/arch/arm/xscale/pxa2x0_lcd.c Fri Nov 20 18:49:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0_lcd.c,v 1.37 2019/11/10 21:16:24 chs Exp $ */
+/* $NetBSD: pxa2x0_lcd.c,v 1.38 2020/11/20 18:49:45 thorpej Exp $ */
/*
* Copyright (c) 2002 Genetec Corporation. All rights reserved.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.37 2019/11/10 21:16:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.38 2020/11/20 18:49:45 thorpej Exp $");
#include "opt_pxa2x0_lcd.h"
@@ -46,7 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c
#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>
@@ -515,7 +515,7 @@ pxa2x0_lcd_new_screen(struct pxa2x0_lcd_
return EINVAL;
}
- scr = malloc(sizeof(*scr), M_DEVBUF, M_WAITOK | M_ZERO);
+ scr = kmem_zalloc(sizeof(*scr), KM_SLEEP);
scr->nsegs = 0;
scr->depth = depth;
scr->buf_size = size;
@@ -627,7 +627,7 @@ pxa2x0_lcd_new_screen(struct pxa2x0_lcd_
bus_dmamem_unmap(dma_tag, scr->buf_va, size);
if (scr->nsegs)
bus_dmamem_free(dma_tag, scr->segs, scr->nsegs);
- free(scr, M_DEVBUF);
+ kmem_free(scr, sizeof(*scr));
}
*scrpp = NULL;
return error;
@@ -850,7 +850,7 @@ pxa2x0_lcd_free_screen(void *v, void *co
bus_dmamem_unmap(sc->dma_tag, scr->buf_va, scr->map_size);
if (scr->nsegs > 0)
bus_dmamem_free(sc->dma_tag, scr->segs, scr->nsegs);
- free(scr, M_DEVBUF);
+ kmem_free(scr, sizeof(*scr));
}
int