Module Name: src
Committed By: thorpej
Date: Sun Nov 22 03:57:19 UTC 2020
Modified Files:
src/sys/arch/shark/isa: isa_irqhandler.c isa_shark_machdep.c
src/sys/arch/shark/ofw: if_cs_ofisa_machdep.c igsfb_ofbus.c
Log Message:
malloc(9) -> kmem(9) (easy, straight-forward cases only, for now)
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/shark/isa/isa_irqhandler.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/shark/isa/isa_shark_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/shark/ofw/if_cs_ofisa_machdep.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/shark/ofw/igsfb_ofbus.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/shark/isa/isa_irqhandler.c
diff -u src/sys/arch/shark/isa/isa_irqhandler.c:1.28 src/sys/arch/shark/isa/isa_irqhandler.c:1.29
--- src/sys/arch/shark/isa/isa_irqhandler.c:1.28 Sun Nov 10 21:16:32 2019
+++ src/sys/arch/shark/isa/isa_irqhandler.c Sun Nov 22 03:57:19 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_irqhandler.c,v 1.28 2019/11/10 21:16:32 chs Exp $ */
+/* $NetBSD: isa_irqhandler.c,v 1.29 2020/11/22 03:57:19 thorpej Exp $ */
/*
* Copyright 1997
@@ -75,12 +75,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isa_irqhandler.c,v 1.28 2019/11/10 21:16:32 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_irqhandler.c,v 1.29 2020/11/22 03:57:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/syslog.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/intr.h>
#include <arm/locore.h>
@@ -311,14 +311,14 @@ intr_claim(int irq, int level, int (*ih_
{
irqhandler_t *ih;
- ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK | M_ZERO);
+ ih = kmem_zalloc(sizeof(*ih), KM_SLEEP);
ih->ih_level = level;
ih->ih_func = ih_func;
ih->ih_arg = ih_arg;
ih->ih_flags = 0;
if (irq_claim(irq, ih, group, name) != 0) {
- free(ih, M_DEVBUF);
+ kmem_free(ih, sizeof(*ih));
return(NULL);
}
@@ -331,7 +331,7 @@ intr_release(void *arg)
irqhandler_t *ih = (irqhandler_t *)arg;
if (irq_release(ih->ih_num, ih) == 0) {
- free(ih, M_DEVBUF);
+ kmem_free(ih, sizeof(*ih));
return(0);
}
return(1);
Index: src/sys/arch/shark/isa/isa_shark_machdep.c
diff -u src/sys/arch/shark/isa/isa_shark_machdep.c:1.17 src/sys/arch/shark/isa/isa_shark_machdep.c:1.18
--- src/sys/arch/shark/isa/isa_shark_machdep.c:1.17 Sun Nov 10 21:16:32 2019
+++ src/sys/arch/shark/isa/isa_shark_machdep.c Sun Nov 22 03:57:19 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_shark_machdep.c,v 1.17 2019/11/10 21:16:32 chs Exp $ */
+/* $NetBSD: isa_shark_machdep.c,v 1.18 2020/11/22 03:57:19 thorpej Exp $ */
/*
* Copyright 1997
@@ -34,14 +34,14 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isa_shark_machdep.c,v 1.17 2019/11/10 21:16:32 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_shark_machdep.c,v 1.18 2020/11/22 03:57:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/syslog.h>
#include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <machine/intr.h>
#include <machine/irqhandler.h>
@@ -167,7 +167,7 @@ isa_intr_establish(isa_chipset_tag_t ic,
{
irqhandler_t *ih;
- ih = malloc(sizeof *ih, M_DEVBUF, M_ZERO | M_WAITOK);
+ ih = kmem_zalloc(sizeof *ih, KM_SLEEP);
if (!LEGAL_IRQ(irq) || type == IST_NONE)
panic("intr_establish: bogus irq or type");
Index: src/sys/arch/shark/ofw/if_cs_ofisa_machdep.c
diff -u src/sys/arch/shark/ofw/if_cs_ofisa_machdep.c:1.13 src/sys/arch/shark/ofw/if_cs_ofisa_machdep.c:1.14
--- src/sys/arch/shark/ofw/if_cs_ofisa_machdep.c:1.13 Sun Nov 10 21:16:32 2019
+++ src/sys/arch/shark/ofw/if_cs_ofisa_machdep.c Sun Nov 22 03:57:19 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_cs_ofisa_machdep.c,v 1.13 2019/11/10 21:16:32 chs Exp $ */
+/* $NetBSD: if_cs_ofisa_machdep.c,v 1.14 2020/11/22 03:57:19 thorpej Exp $ */
/*
* Copyright 1998
@@ -38,14 +38,14 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cs_ofisa_machdep.c,v 1.13 2019/11/10 21:16:32 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cs_ofisa_machdep.c,v 1.14 2020/11/22 03:57:19 thorpej Exp $");
#include "opt_compat_old_ofw.h"
#include <sys/param.h>
#include <sys/device.h>
#include <sys/systm.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/socket.h>
#include <sys/bus.h>
#include <sys/rndsource.h>
@@ -141,7 +141,7 @@ cs_ofisa_md_media_fixup(device_t parent,
if (1) { /* XXX old firmware compat enabled */
if (media == NULL) {
- media = malloc(2 * sizeof(int), M_TEMP, M_WAITOK);
+ media = kmem_alloc(2 * sizeof(int), KM_SLEEP);
media[0] = IFM_ETHER | IFM_10_T;
media[1] = IFM_ETHER | IFM_10_T | IFM_FDX;
*nmediap = 2;
Index: src/sys/arch/shark/ofw/igsfb_ofbus.c
diff -u src/sys/arch/shark/ofw/igsfb_ofbus.c:1.18 src/sys/arch/shark/ofw/igsfb_ofbus.c:1.19
--- src/sys/arch/shark/ofw/igsfb_ofbus.c:1.18 Sun Nov 10 21:16:32 2019
+++ src/sys/arch/shark/ofw/igsfb_ofbus.c Sun Nov 22 03:57:19 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: igsfb_ofbus.c,v 1.18 2019/11/10 21:16:32 chs Exp $ */
+/* $NetBSD: igsfb_ofbus.c,v 1.19 2020/11/22 03:57:19 thorpej Exp $ */
/*
* Copyright (c) 2006 Michael Lorenz
@@ -31,13 +31,13 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.18 2019/11/10 21:16:32 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.19 2020/11/22 03:57:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
#include <sys/buf.h>
#include <sys/bus.h>
#include <uvm/uvm.h>
@@ -229,8 +229,8 @@ igsfb_ofbus_attach(device_t parent, devi
sc->sc_dc = &igsfb_console_dc;
} else {
isconsole = 0;
- sc->sc_dc = malloc(sizeof(struct igsfb_devconfig),
- M_DEVBUF, M_WAITOK | M_ZERO);
+ sc->sc_dc = kmem_zalloc(sizeof(struct igsfb_devconfig),
+ KM_SLEEP);
if (OF_getprop(oba->oba_phandle, "reg",
regs, sizeof(regs)) <= 0)
{