Module Name:    src
Committed By:   thorpej
Date:           Sat Nov 21 00:27:52 UTC 2020

Modified Files:
        src/sys/arch/sun2/dev: sc_mbmem.c
        src/sys/arch/sun3/dev: cg4.c eeprom.c fd.c si.c si_sebuf.c xd.c xy.c
        src/sys/arch/sun68k/sun68k: bus.c isr.c vme_sun68k.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sun2/dev/sc_mbmem.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/sun3/dev/cg4.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/sun3/dev/eeprom.c
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/sun3/dev/fd.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sun3/dev/si.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/sun3/dev/si_sebuf.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/sun3/dev/xd.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/sun3/dev/xy.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sun68k/sun68k/bus.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sun68k/sun68k/isr.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sun68k/sun68k/vme_sun68k.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/sun2/dev/sc_mbmem.c
diff -u src/sys/arch/sun2/dev/sc_mbmem.c:1.14 src/sys/arch/sun2/dev/sc_mbmem.c:1.15
--- src/sys/arch/sun2/dev/sc_mbmem.c:1.14	Sat Nov 21 04:16:52 2009
+++ src/sys/arch/sun2/dev/sc_mbmem.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sc_mbmem.c,v 1.14 2009/11/21 04:16:52 rmind Exp $	*/
+/*	$NetBSD: sc_mbmem.c,v 1.15 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -59,13 +59,13 @@
  ****************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sc_mbmem.c,v 1.14 2009/11/21 04:16:52 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sc_mbmem.c,v 1.15 2020/11/21 00:27:52 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/errno.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/device.h>
 #include <sys/buf.h>
 #include <sys/proc.h>
@@ -164,9 +164,7 @@ sunsc_mbmem_attach(device_t parent, devi
 	
 	/* Allocate DMA handles. */
 	i = SUNSCPAL_OPENINGS * sizeof(struct sunscpal_dma_handle);
-	sc->sc_dma_handles = malloc(i, M_DEVBUF, M_WAITOK);
-	if (sc->sc_dma_handles == NULL)
-		panic("sc: DMA handles malloc failed");
+	sc->sc_dma_handles = kmem_alloc(i, KM_SLEEP);
 	for (i = 0; i < SUNSCPAL_OPENINGS; i++)
 		if (bus_dmamap_create(sc->sunscpal_dmat, SUNSCPAL_MAX_DMA_LEN,
 		    1, SUNSCPAL_MAX_DMA_LEN,

Index: src/sys/arch/sun3/dev/cg4.c
diff -u src/sys/arch/sun3/dev/cg4.c:1.41 src/sys/arch/sun3/dev/cg4.c:1.42
--- src/sys/arch/sun3/dev/cg4.c:1.41	Fri Jul 25 08:10:35 2014
+++ src/sys/arch/sun3/dev/cg4.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cg4.c,v 1.41 2014/07/25 08:10:35 dholland Exp $	*/
+/*	$NetBSD: cg4.c,v 1.42 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -55,14 +55,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cg4.c,v 1.41 2014/07/25 08:10:35 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cg4.c,v 1.42 2020/11/21 00:27:52 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/conf.h>
 #include <sys/device.h>
 #include <sys/ioctl.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/mman.h>
 #include <sys/proc.h>
 #include <sys/tty.h>
@@ -573,7 +573,7 @@ cg4b_init(struct cg4_softc *sc)
 	int i;
 
 	/* Need a buffer for colormap format translation. */
-	btcm = malloc(sizeof(*btcm), M_DEVBUF, M_WAITOK);
+	btcm = kmem_alloc(sizeof(*btcm), KM_SLEEP);
 	sc->sc_btcm = btcm;
 
 	/*

Index: src/sys/arch/sun3/dev/eeprom.c
diff -u src/sys/arch/sun3/dev/eeprom.c:1.33 src/sys/arch/sun3/dev/eeprom.c:1.34
--- src/sys/arch/sun3/dev/eeprom.c:1.33	Sun Nov 10 21:16:33 2019
+++ src/sys/arch/sun3/dev/eeprom.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: eeprom.c,v 1.33 2019/11/10 21:16:33 chs Exp $	*/
+/*	$NetBSD: eeprom.c,v 1.34 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,14 +38,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: eeprom.c,v 1.33 2019/11/10 21:16:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eeprom.c,v 1.34 2020/11/21 00:27:52 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
 #include <sys/conf.h>
 #include <sys/buf.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/proc.h>
 #include <sys/kernel.h>
 
@@ -105,7 +105,7 @@ eeprom_attach(device_t parent, device_t 
 		panic("%s: can't map va", __func__);
 
 	/* Keep a "soft" copy of the EEPROM to make access simpler. */
-	eeprom_copy = malloc(ee_size, M_DEVBUF, M_WAITOK);
+	eeprom_copy = kmem_alloc(ee_size, KM_SLEEP);
 
 	/*
 	 * On the 3/80, do not touch the last 40 bytes!

Index: src/sys/arch/sun3/dev/fd.c
diff -u src/sys/arch/sun3/dev/fd.c:1.83 src/sys/arch/sun3/dev/fd.c:1.84
--- src/sys/arch/sun3/dev/fd.c:1.83	Sun Nov 10 21:16:33 2019
+++ src/sys/arch/sun3/dev/fd.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.83 2019/11/10 21:16:33 chs Exp $	*/
+/*	$NetBSD: fd.c,v 1.84 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.83 2019/11/10 21:16:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.84 2020/11/21 00:27:52 thorpej Exp $");
 
 #include "opt_ddb.h"
 
@@ -88,7 +88,7 @@ __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.83 
 #include <sys/fdio.h>
 #include <sys/buf.h>
 #include <sys/bufq.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/proc.h>
 #include <sys/uio.h>
 #include <sys/stat.h>
@@ -1733,8 +1733,7 @@ fdioctl(dev_t dev, u_long cmd, void *add
 			return EINVAL;
 		}
 
-		fd_formb = malloc(sizeof(struct ne7_fd_formb),
-		    M_TEMP, M_WAITOK);
+		fd_formb = kmem_alloc(sizeof(*fd_formb), KM_SLEEP);
 		fd_formb->head = form_cmd->head;
 		fd_formb->cyl = form_cmd->cylinder;
 		fd_formb->transfer_rate = fd->sc_type->rate;
@@ -1758,7 +1757,7 @@ fdioctl(dev_t dev, u_long cmd, void *add
 		}
 
 		error = fdformat(dev, fd_formb, l->l_proc);
-		free(fd_formb, M_TEMP);
+		kmem_free(fd_formb, sizeof(*fd_formb));
 		return error;
 
 	case FDIOCGETOPTS:		/* get drive options */
@@ -1985,7 +1984,7 @@ fd_read_md_image(size_t *sizep, void **a
 
 	dev = makedev(cdevsw_lookup_major(&fd_cdevsw), 0);	/* XXX */
 
-	addr = malloc(FDMICROROOTSIZE, M_DEVBUF, M_WAITOK);
+	addr = kmem_alloc(FDMICROROOTSIZE, KM_SLEEP);
 	*addrp = addr;
 
 	if (fdopen(dev, 0, S_IFCHR, NULL))

Index: src/sys/arch/sun3/dev/si.c
diff -u src/sys/arch/sun3/dev/si.c:1.63 src/sys/arch/sun3/dev/si.c:1.64
--- src/sys/arch/sun3/dev/si.c:1.63	Sat Nov 21 04:16:52 2009
+++ src/sys/arch/sun3/dev/si.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: si.c,v 1.63 2009/11/21 04:16:52 rmind Exp $	*/
+/*	$NetBSD: si.c,v 1.64 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -70,13 +70,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: si.c,v 1.63 2009/11/21 04:16:52 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: si.c,v 1.64 2020/11/21 00:27:52 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/errno.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/device.h>
 #include <sys/buf.h>
 #include <sys/proc.h>
@@ -164,10 +164,7 @@ si_attach(struct si_softc *sc)
 	 * Allocate DMA handles.
 	 */
 	i = SCI_OPENINGS * sizeof(struct si_dma_handle);
-	sc->sc_dma = (struct si_dma_handle *)
-		malloc(i, M_DEVBUF, M_WAITOK);
-	if (sc->sc_dma == NULL)
-		panic("si: dvma_malloc failed");
+	sc->sc_dma = kmem_alloc(i, KM_SLEEP);
 	for (i = 0; i < SCI_OPENINGS; i++)
 		sc->sc_dma[i].dh_flags = 0;
 

Index: src/sys/arch/sun3/dev/si_sebuf.c
diff -u src/sys/arch/sun3/dev/si_sebuf.c:1.29 src/sys/arch/sun3/dev/si_sebuf.c:1.30
--- src/sys/arch/sun3/dev/si_sebuf.c:1.29	Thu Nov  7 17:50:18 2013
+++ src/sys/arch/sun3/dev/si_sebuf.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: si_sebuf.c,v 1.29 2013/11/07 17:50:18 christos Exp $	*/
+/*	$NetBSD: si_sebuf.c,v 1.30 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -37,13 +37,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: si_sebuf.c,v 1.29 2013/11/07 17:50:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: si_sebuf.c,v 1.30 2020/11/21 00:27:52 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/errno.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/device.h>
 #include <sys/buf.h>
 #include <sys/proc.h>
@@ -250,9 +250,7 @@ se_attach(device_t parent, device_t self
 	 * Allocate DMA handles.
 	 */
 	i = SCI_OPENINGS * sizeof(struct se_dma_handle);
-	sc->sc_dma = malloc(i, M_DEVBUF, M_WAITOK);
-	if (sc->sc_dma == NULL)
-		panic("se: dma_malloc failed");
+	sc->sc_dma = kmem_alloc(i, KM_SLEEP);
 	for (i = 0; i < SCI_OPENINGS; i++)
 		sc->sc_dma[i].dh_flags = 0;
 

Index: src/sys/arch/sun3/dev/xd.c
diff -u src/sys/arch/sun3/dev/xd.c:1.74 src/sys/arch/sun3/dev/xd.c:1.75
--- src/sys/arch/sun3/dev/xd.c:1.74	Sun Nov 10 21:16:33 2019
+++ src/sys/arch/sun3/dev/xd.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xd.c,v 1.74 2019/11/10 21:16:33 chs Exp $	*/
+/*	$NetBSD: xd.c,v 1.75 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1995 Charles D. Cranor
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.74 2019/11/10 21:16:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.75 2020/11/21 00:27:52 thorpej Exp $");
 
 #undef XDC_DEBUG		/* full debug */
 #define XDC_DIAG		/* extra sanity checks */
@@ -64,7 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.74 
 #include <sys/buf.h>
 #include <sys/bufq.h>
 #include <sys/uio.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/device.h>
 #include <sys/disklabel.h>
 #include <sys/disk.h>
@@ -446,8 +446,8 @@ xdcattach(device_t parent, device_t self
 	memset(xdc->iopbase, 0, XDC_MAXIOPB * sizeof(struct xd_iopb));
 	xdc->dvmaiopb = (struct xd_iopb *)dvma_kvtopa(xdc->iopbase,
 	    xdc->bustype);
-	xdc->reqs = malloc(XDC_MAXIOPB * sizeof(struct xd_iorq),
-	    M_DEVBUF, M_WAITOK | M_ZERO);
+	xdc->reqs = kmem_zalloc(XDC_MAXIOPB * sizeof(struct xd_iorq),
+	    KM_SLEEP);
 
 	/* init free list, iorq to iopb pointers, and non-zero fields in the
 	 * iopb which never change. */

Index: src/sys/arch/sun3/dev/xy.c
diff -u src/sys/arch/sun3/dev/xy.c:1.79 src/sys/arch/sun3/dev/xy.c:1.80
--- src/sys/arch/sun3/dev/xy.c:1.79	Sun Nov 10 21:16:33 2019
+++ src/sys/arch/sun3/dev/xy.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xy.c,v 1.79 2019/11/10 21:16:33 chs Exp $	*/
+/*	$NetBSD: xy.c,v 1.80 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1995 Charles D. Cranor
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.79 2019/11/10 21:16:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.80 2020/11/21 00:27:52 thorpej Exp $");
 
 #undef XYC_DEBUG		/* full debug */
 #undef XYC_DIAG			/* extra sanity checks */
@@ -64,7 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.79 
 #include <sys/buf.h>
 #include <sys/bufq.h>
 #include <sys/uio.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/device.h>
 #include <sys/disklabel.h>
 #include <sys/disk.h>
@@ -390,8 +390,8 @@ xycattach(device_t parent, device_t self
 	xyc->iopbase = tmp;
 	xyc->dvmaiopb =
 	    (struct xy_iopb *)dvma_kvtopa(xyc->iopbase, xyc->bustype);
-	xyc->reqs = malloc(XYC_MAXIOPB * sizeof(struct xy_iorq),
-	    M_DEVBUF, M_WAITOK | M_ZERO);
+	xyc->reqs = kmem_zalloc(XYC_MAXIOPB * sizeof(struct xy_iorq),
+	    KM_SLEEP);
 
 	/*
 	 * init iorq to iopb pointers, and non-zero fields in the

Index: src/sys/arch/sun68k/sun68k/bus.c
diff -u src/sys/arch/sun68k/sun68k/bus.c:1.23 src/sys/arch/sun68k/sun68k/bus.c:1.24
--- src/sys/arch/sun68k/sun68k/bus.c:1.23	Thu Jul  7 06:55:39 2016
+++ src/sys/arch/sun68k/sun68k/bus.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.23 2016/07/07 06:55:39 msaitoh Exp $	*/
+/*	$NetBSD: bus.c,v 1.24 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -153,13 +153,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.23 2016/07/07 06:55:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.24 2020/11/21 00:27:52 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/mbuf.h>
 
 #include <uvm/uvm.h> /* XXX: not _extern ... need vm_map_create */ 
@@ -174,6 +174,14 @@ __KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.23
 
 #include <sun68k/sun68k/control.h>
 
+static size_t
+_bus_dmamap_mapsize(int const nsegments)
+{
+	KASSERT(nsegments > 0);
+	return sizeof(struct sun68k_bus_dmamap) +
+	    (sizeof(bus_dma_segment_t) * (nsegments - 1));
+}
+
 /*
  * Common function for DMA map creation.  May be called by bus-specific
  * DMA map creation functions.
@@ -184,7 +192,6 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 {
 	struct sun68k_bus_dmamap *map;
 	void *mapstore;
-	size_t mapsize;
 
 	/*
 	 * Allocate and initialize the DMA map.  The end of the map
@@ -198,13 +205,10 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	 * The bus_dmamap_t includes one bus_dma_segment_t, hence
 	 * the (nsegments - 1).
 	 */
-	mapsize = sizeof(struct sun68k_bus_dmamap) +
-	    (sizeof(bus_dma_segment_t) * (nsegments - 1));
-	if ((mapstore = malloc(mapsize, M_DMAMAP,
-	    (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+	if ((mapstore = kmem_zalloc(_bus_dmamap_mapsize(nsegments),
+	    (flags & BUS_DMA_NOWAIT) ? KM_NOSLEEP : KM_SLEEP)) == NULL)
 		return (ENOMEM);
 
-	memset(mapstore, 0, mapsize);
 	map = (struct sun68k_bus_dmamap *)mapstore;
 	map->_dm_size = size;
 	map->_dm_segcnt = nsegments;
@@ -234,7 +238,7 @@ _bus_dmamap_destroy(bus_dma_tag_t t, bus
 	if (map->dm_mapsize != 0)
 		bus_dmamap_unload(t, map);
 
-	free(map, M_DMAMAP);
+	kmem_free(map, _bus_dmamap_mapsize(map->_dm_segcnt));
 }
 
 /*
@@ -257,8 +261,8 @@ extern	paddr_t avail_end;
 	low = avail_start;
 	high = avail_end;
 
-	if ((mlist = malloc(sizeof(*mlist), M_DEVBUF,
-	    (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+	if ((mlist = kmem_alloc(sizeof(*mlist),
+	    (flags & BUS_DMA_NOWAIT) ? KM_NOSLEEP : KM_SLEEP)) == NULL)
 		return (ENOMEM);
 
 	/*
@@ -267,7 +271,7 @@ extern	paddr_t avail_end;
 	error = uvm_pglistalloc(size, low, high, 0, 0,
 				mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
 	if (error) {
-		free(mlist, M_DEVBUF);
+		kmem_free(mlist, sizeof(*mlist));
 		return (error);
 	}
 
@@ -300,6 +304,7 @@ extern	paddr_t avail_end;
 void 
 _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
 {
+	struct pglist *mlist = segs[0]._ds_mlist;
 
 	if (nsegs != 1)
 		panic("bus_dmamem_free: nsegs = %d", nsegs);
@@ -307,8 +312,8 @@ _bus_dmamem_free(bus_dma_tag_t t, bus_dm
 	/*
 	 * Return the list of physical pages back to the VM system.
 	 */
-	uvm_pglistfree(segs[0]._ds_mlist);
-	free(segs[0]._ds_mlist, M_DEVBUF);
+	uvm_pglistfree(mlist);
+	kmem_free(mlist, sizeof(*mlist));
 }
 
 /*

Index: src/sys/arch/sun68k/sun68k/isr.c
diff -u src/sys/arch/sun68k/sun68k/isr.c:1.25 src/sys/arch/sun68k/sun68k/isr.c:1.26
--- src/sys/arch/sun68k/sun68k/isr.c:1.25	Sun Nov 10 21:16:33 2019
+++ src/sys/arch/sun68k/sun68k/isr.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: isr.c,v 1.25 2019/11/10 21:16:33 chs Exp $	*/
+/*	$NetBSD: isr.c,v 1.26 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -34,12 +34,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.25 2019/11/10 21:16:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.26 2020/11/21 00:27:52 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/vmmeter.h>
 #include <sys/cpu.h>
 #include <sys/intr.h>
@@ -147,7 +147,7 @@ isr_add_autovect(isr_func_t handler, voi
 
 	if ((level < 0) || (level >= NUM_LEVELS))
 		panic("isr_add: bad level=%d", level);
-	new_isr = malloc(sizeof(struct isr), M_DEVBUF, M_WAITOK);
+	new_isr = kmem_alloc(sizeof(struct isr), KM_SLEEP);
 	new_isr->isr_intr = handler;
 	new_isr->isr_arg = arg;
 	new_isr->isr_ipl = level;

Index: src/sys/arch/sun68k/sun68k/vme_sun68k.c
diff -u src/sys/arch/sun68k/sun68k/vme_sun68k.c:1.16 src/sys/arch/sun68k/sun68k/vme_sun68k.c:1.17
--- src/sys/arch/sun68k/sun68k/vme_sun68k.c:1.16	Sun Nov 10 21:16:33 2019
+++ src/sys/arch/sun68k/sun68k/vme_sun68k.c	Sat Nov 21 00:27:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vme_sun68k.c,v 1.16 2019/11/10 21:16:33 chs Exp $	*/
+/*	$NetBSD: vme_sun68k.c,v 1.17 2020/11/21 00:27:52 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -30,13 +30,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vme_sun68k.c,v 1.16 2019/11/10 21:16:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vme_sun68k.c,v 1.17 2020/11/21 00:27:52 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/extent.h>
 #include <sys/systm.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/errno.h>
 
 #include <sys/proc.h>
@@ -268,8 +268,7 @@ sun68k_vme_intr_map(void *cookie, int le
 {
 	struct sun68k_vme_intr_handle *svih;
 
-	svih = malloc(sizeof(struct sun68k_vme_intr_handle),
-	    M_DEVBUF, M_WAITOK);
+	svih = kmem_alloc(sizeof(struct sun68k_vme_intr_handle), KM_SLEEP);
 	svih->pri = level;
 	svih->vec = vec;
 	*ihp = svih;

Reply via email to