From 77652cad100daa0b8fbb1c161c9d63e32b528141 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 5 Sep 2006 03:48:13 +0000 Subject: [PATCH] Rename malloc->kmalloc, free->kfree, and realloc->krealloc. Pass 2 --- sys/bus/cam/scsi/scsi_ch.c | 4 ++-- sys/bus/eisa/eisaconf.c | 4 ++-- sys/bus/firewire/firewire.c | 6 +++--- sys/bus/firewire/fwdev.c | 4 ++-- sys/bus/firewire/fwdma.c | 4 ++-- sys/bus/firewire/fwmem.c | 4 ++-- sys/bus/firewire/fwohci.c | 4 ++-- sys/bus/isa/pnpparse.c | 4 ++-- sys/bus/pccard/pccard_cis.c | 4 ++-- sys/bus/usb/uhci.c | 4 ++-- sys/bus/usb/uhub.c | 4 ++-- sys/bus/usb/usb_subr.c | 6 +++--- sys/config/LINT | 4 +++- sys/dev/acpica5/acpi_cmbat.c | 4 ++-- sys/dev/acpica5/acpi_cpu.c | 4 ++-- sys/dev/agp/agp_amd.c | 4 ++-- sys/dev/crypto/ubsec/ubsec.c | 6 +++--- sys/dev/disk/aic7xxx/aic79xx.c | 4 ++-- sys/dev/disk/aic7xxx/aic7xxx.c | 8 ++++---- sys/dev/disk/ccd/ccd.c | 10 +++++----- sys/dev/disk/ispfw/ispfw.c | 4 ++-- sys/dev/disk/sbp/sbp.c | 6 +++--- sys/dev/disk/trm/trm.c | 4 ++-- sys/dev/disk/vpo/vpoio.c | 4 ++-- sys/dev/drm/drm_ioctl.h | 4 ++-- sys/dev/drm/drm_memory.h | 10 +++++----- sys/dev/drm/drm_os_freebsd.h | 6 +++--- sys/dev/drm/drm_scatter.h | 6 +++--- sys/dev/misc/syscons/scvtb.c | 4 ++-- sys/dev/misc/syscons/syscons.c | 4 ++-- sys/dev/netif/de/if_de.c | 6 +++--- sys/dev/netif/em/if_em.c | 4 ++-- sys/dev/netif/fwe/if_fwe.c | 4 ++-- sys/dev/netif/fxp/if_fxp.c | 4 ++-- sys/dev/netif/ic/if_ic.c | 6 +++--- sys/dev/netif/kue/if_kue.c | 4 ++-- sys/dev/netif/mn/if_mn.c | 4 ++-- sys/dev/netif/my/if_my.c | 4 ++-- sys/dev/netif/pdq_layer/pdqvar.h | 6 +++--- sys/dev/netif/sbni/if_sbni_pci.c | 4 ++-- sys/dev/netif/tx/if_tx.c | 8 ++++---- sys/dev/netif/txp/if_txp.c | 6 +++--- sys/dev/raid/ida/ida.c | 4 ++-- sys/dev/raid/ips/ips.c | 4 ++-- sys/dev/raid/ips/ips_ioctl.c | 4 ++-- sys/dev/raid/pst/pst-iop.c | 6 +++--- sys/dev/raid/pst/pst-raid.c | 4 ++-- sys/dev/raid/twa/twa.c | 4 ++-- sys/dev/raid/twa/twa_freebsd.c | 4 ++-- sys/dev/raid/vinum/vinum.c | 4 ++-- sys/dev/raid/vinum/vinumext.h | 6 +++--- sys/dev/serial/digi/digi.c | 6 +++--- sys/dev/serial/rp/rp.c | 6 +++--- sys/dev/serial/rp/rp_isa.c | 8 ++++---- sys/dev/serial/rp/rp_pci.c | 6 +++--- sys/dev/serial/si/si.c | 4 ++-- sys/dev/usbmisc/ugen/ugen.c | 4 ++-- sys/dev/usbmisc/ums/ums.c | 4 ++-- sys/dev/video/fb/splash.c | 4 ++-- sys/emulation/linux/linux_util.h | 4 ++-- sys/emulation/ndis/kern_ndis.c | 8 ++++---- sys/emulation/ndis/subr_ndis.c | 8 ++++---- sys/emulation/posix4/posix4.h | 6 +++--- sys/i386/conf/LINT | 4 +++- sys/i386/i386/busdma_machdep.c | 6 +++--- sys/i386/i386/i686_mem.c | 4 ++-- sys/i386/i386/k6_mem.c | 4 ++-- sys/i386/i386/mem.c | 6 +++--- sys/kern/kern_descrip.c | 6 +++--- sys/kern/kern_ktr.c | 4 ++-- sys/kern/kern_linker.c | 6 +++--- sys/kern/kern_memio.c | 6 +++--- sys/kern/kern_module.c | 4 ++-- sys/kern/kern_objcache.c | 6 +++--- sys/kern/kern_synch.c | 4 ++-- sys/kern/kern_timeout.c | 4 ++-- sys/kern/link_aout.c | 4 ++-- sys/kern/lwkt_caps.c | 4 ++-- sys/kern/subr_bus.c | 6 +++--- sys/kern/subr_diskslice.c | 4 ++-- sys/kern/subr_eventhandler.c | 6 +++--- sys/kern/subr_rman.c | 4 ++-- sys/kern/vfs_cluster.c | 4 ++-- sys/kern/vfs_jops.c | 4 ++-- sys/net/bridge/if_bridge.c | 4 ++-- sys/net/dummynet/ip_dummynet.c | 6 +++--- sys/net/ef/if_ef.c | 4 ++-- sys/net/i4b/layer4/i4b_i4bdrv.c | 6 +++--- sys/net/if_media.c | 4 ++-- sys/net/ipfw/ip_fw.c | 4 ++-- sys/net/ipfw/ip_fw2.c | 4 ++-- sys/net/pf/pf_if.c | 4 ++-- sys/net/pf/pf_ioctl.c | 8 ++++---- sys/net/radix.h | 6 +++--- sys/netinet/tcp_subr.c | 6 +++--- sys/netinet6/ah_core.c | 10 +++++----- sys/netinet6/in6.c | 6 +++--- sys/netinet6/ip6_output.c | 10 +++++----- sys/netinet6/ipsec.c | 4 ++-- sys/netproto/802_11/wlan/ieee80211_node.c | 6 +++--- .../802_11/wlan_ratectl/amrr/ieee80211_ratectl_amrr.c | 4 ++-- .../802_11/wlan_ratectl/onoe/ieee80211_ratectl_onoe.c | 4 ++-- sys/netproto/atm/port.h | 10 +++++----- sys/opencrypto/crypto.c | 6 +++--- sys/opencrypto/cryptosoft.c | 4 ++-- sys/platform/pc32/i386/busdma_machdep.c | 6 +++--- sys/platform/pc32/i386/i686_mem.c | 4 ++-- sys/platform/pc32/i386/k6_mem.c | 4 ++-- sys/platform/pc32/i386/mem.c | 6 +++--- sys/sys/posix4.h | 6 +++--- sys/vfs/gnu/ext2fs/ext2_vfsops.c | 6 +++--- sys/vfs/isofs/cd9660/cd9660_node.c | 4 ++-- sys/vfs/msdosfs/msdosfs_vfsops.c | 4 ++-- sys/vfs/nfs/bootp_subr.c | 4 ++-- sys/vfs/nfs/nfs_socket.c | 4 ++-- sys/vfs/nfs/nfs_srvcache.c | 4 ++-- sys/vfs/nullfs/null_vfsops.c | 4 ++-- 117 files changed, 298 insertions(+), 294 deletions(-) diff --git a/sys/bus/cam/scsi/scsi_ch.c b/sys/bus/cam/scsi/scsi_ch.c index 85346321cd..59e4dc773a 100644 --- a/sys/bus/cam/scsi/scsi_ch.c +++ b/sys/bus/cam/scsi/scsi_ch.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/cam/scsi/scsi_ch.c,v 1.20.2.2 2000/10/31 08:09:49 dwmalone Exp $ - * $DragonFly: src/sys/bus/cam/scsi/scsi_ch.c,v 1.15 2006/09/05 00:55:32 dillon Exp $ + * $DragonFly: src/sys/bus/cam/scsi/scsi_ch.c,v 1.16 2006/09/05 03:48:07 dillon Exp $ */ /* * Derived from the NetBSD SCSI changer driver. @@ -1171,7 +1171,7 @@ chgetelemstatus(struct cam_periph *periph, } user_data = (struct changer_element_status *) - malloc(avail * sizeof(struct changer_element_status), + kmalloc(avail * sizeof(struct changer_element_status), M_DEVBUF, M_INTWAIT | M_ZERO); desc = (struct read_element_status_descriptor *)((uintptr_t)data + diff --git a/sys/bus/eisa/eisaconf.c b/sys/bus/eisa/eisaconf.c index b5e7293243..9fc7a90508 100644 --- a/sys/bus/eisa/eisaconf.c +++ b/sys/bus/eisa/eisaconf.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/eisa/eisaconf.c,v 1.55 2000/01/14 07:13:57 peter Exp $ - * $DragonFly: src/sys/bus/eisa/eisaconf.c,v 1.7 2006/09/05 00:55:34 dillon Exp $ + * $DragonFly: src/sys/bus/eisa/eisaconf.c,v 1.8 2006/09/05 03:48:08 dillon Exp $ */ #include "opt_eisa.h" @@ -105,7 +105,7 @@ mainboard_probe(device_t dev) if (eisa_get_slot(dev) != 0) return (ENXIO); - idstring = malloc(8 + sizeof(" (System Board)") + 1, + idstring = kmalloc(8 + sizeof(" (System Board)") + 1, M_DEVBUF, M_INTWAIT); sprintf(idstring, "%c%c%c%03x%01x (System Board)", EISA_MFCTR_CHAR0(id), diff --git a/sys/bus/firewire/firewire.c b/sys/bus/firewire/firewire.c index 4f1f64c3cc..7e1b3a7769 100644 --- a/sys/bus/firewire/firewire.c +++ b/sys/bus/firewire/firewire.c @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/firewire/firewire.c,v 1.68 2004/01/08 14:58:09 simokawa Exp $ - * $DragonFly: src/sys/bus/firewire/firewire.c,v 1.15 2006/09/05 00:55:35 dillon Exp $ + * $DragonFly: src/sys/bus/firewire/firewire.c,v 1.16 2006/09/05 03:48:09 dillon Exp $ * */ @@ -759,9 +759,9 @@ fw_init(struct firewire_comm *fc) fc->it[i]->maxq = FWMAXQUEUE; } /* Initialize csr registers */ - fc->topology_map = malloc(sizeof(struct fw_topology_map), + fc->topology_map = kmalloc(sizeof(struct fw_topology_map), M_FW, M_WAITOK | M_ZERO); - fc->speed_map = malloc(sizeof(struct fw_speed_map), + fc->speed_map = kmalloc(sizeof(struct fw_speed_map), M_FW, M_WAITOK | M_ZERO); CSRARC(fc, TOPO_MAP) = 0x3f1 << 16; CSRARC(fc, TOPO_MAP + 4) = 1; diff --git a/sys/bus/firewire/fwdev.c b/sys/bus/firewire/fwdev.c index a2ee50f891..a6394675ee 100644 --- a/sys/bus/firewire/fwdev.c +++ b/sys/bus/firewire/fwdev.c @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/firewire/fwdev.c,v 1.36 2004/01/22 14:41:17 simokawa Exp $ - * $DragonFly: src/sys/bus/firewire/fwdev.c,v 1.13 2006/09/05 00:55:35 dillon Exp $ + * $DragonFly: src/sys/bus/firewire/fwdev.c,v 1.14 2006/09/05 03:48:09 dillon Exp $ * */ @@ -112,7 +112,7 @@ fwdev_allocbuf(struct firewire_comm *fc, struct fw_xferq *q, if (q->flag & (FWXFERQ_RUNNING | FWXFERQ_EXTBUF)) return(EBUSY); - q->bulkxfer = (struct fw_bulkxfer *) malloc( + q->bulkxfer = (struct fw_bulkxfer *) kmalloc( sizeof(struct fw_bulkxfer) * b->nchunk, M_FW, M_WAITOK); if (q->bulkxfer == NULL) diff --git a/sys/bus/firewire/fwdma.c b/sys/bus/firewire/fwdma.c index b9c87ff3a9..69992c002b 100644 --- a/sys/bus/firewire/fwdma.c +++ b/sys/bus/firewire/fwdma.c @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/bus/firewire/fwdma.c,v 1.6 2006/09/05 00:55:35 dillon Exp $ + * $DragonFly: src/sys/bus/firewire/fwdma.c,v 1.7 2006/09/05 03:48:09 dillon Exp $ */ #ifndef __DragonFly__ @@ -170,7 +170,7 @@ fwdma_malloc_multiseg(struct firewire_comm *fc, int alignment, ssize = rounddown(PAGE_SIZE, esize); nseg = howmany(n, ssize / esize); } - am = (struct fwdma_alloc_multi *)malloc(sizeof(struct fwdma_alloc_multi) + am = (struct fwdma_alloc_multi *)kmalloc(sizeof(struct fwdma_alloc_multi) + sizeof(struct fwdma_seg)*nseg, M_FW, M_WAITOK); if (am == NULL) { printf("fwdma_malloc_multiseg: malloc failed\n"); diff --git a/sys/bus/firewire/fwmem.c b/sys/bus/firewire/fwmem.c index 983948a372..52adcf48bd 100644 --- a/sys/bus/firewire/fwmem.c +++ b/sys/bus/firewire/fwmem.c @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/bus/firewire/fwmem.c,v 1.11 2006/09/05 00:55:35 dillon Exp $ + * $DragonFly: src/sys/bus/firewire/fwmem.c,v 1.12 2006/09/05 03:48:09 dillon Exp $ */ #ifndef __DragonFly__ @@ -287,7 +287,7 @@ fwmem_open (struct dev_open_args *ap) fms = (struct fwmem_softc *)dev->si_drv1; fms->refcount ++; } else { - fms = (struct fwmem_softc *)malloc(sizeof(struct fwmem_softc), + fms = (struct fwmem_softc *)kmalloc(sizeof(struct fwmem_softc), M_FWMEM, M_WAITOK); if (fms == NULL) return ENOMEM; diff --git a/sys/bus/firewire/fwohci.c b/sys/bus/firewire/fwohci.c index 42a69201ee..9989ed06c2 100644 --- a/sys/bus/firewire/fwohci.c +++ b/sys/bus/firewire/fwohci.c @@ -33,7 +33,7 @@ * * $FreeBSD: src/sys/dev/firewire/fwohci.c,v 1.72 2004/01/22 14:41:17 simokawa Exp $ * $FreeBSD: src/sys/dev/firewire/fwohci.c,v 1.1.2.19 2003/05/01 06:24:37 simokawa Exp $ - * $DragonFly: src/sys/bus/firewire/fwohci.c,v 1.11 2006/09/05 00:55:35 dillon Exp $ + * $DragonFly: src/sys/bus/firewire/fwohci.c,v 1.12 2006/09/05 03:48:09 dillon Exp $ */ #define ATRQ_CH 0 @@ -1230,7 +1230,7 @@ fwohci_db_init(struct fwohci_softc *sc, struct fwohci_dbch *dbch) /* DB entry must start at 16 bytes bounary. */ STAILQ_INIT(&dbch->db_trq); db_tr = (struct fwohcidb_tr *) - malloc(sizeof(struct fwohcidb_tr) * dbch->ndb, + kmalloc(sizeof(struct fwohcidb_tr) * dbch->ndb, M_FW, M_WAITOK | M_ZERO); if(db_tr == NULL){ printf("fwohci_db_init: malloc(1) failed\n"); diff --git a/sys/bus/isa/pnpparse.c b/sys/bus/isa/pnpparse.c index fd8176b55a..f7cb30eab2 100644 --- a/sys/bus/isa/pnpparse.c +++ b/sys/bus/isa/pnpparse.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/isa/pnpparse.c,v 1.14 2003/06/11 00:32:45 obrien Exp $ - * $DragonFly: src/sys/bus/isa/pnpparse.c,v 1.7 2006/09/05 00:55:35 dillon Exp $ + * $DragonFly: src/sys/bus/isa/pnpparse.c,v 1.8 2006/09/05 03:48:09 dillon Exp $ */ #include @@ -422,7 +422,7 @@ pnp_parse_resources(device_t dev, u_char *resources, int len, int ldn) parent = device_get_parent(dev); id = isa_get_logicalid(dev); - configs = malloc(sizeof(*configs)*(1 + MAXDEP), + configs = kmalloc(sizeof(*configs)*(1 + MAXDEP), M_DEVBUF, M_WAITOK | M_ZERO); config = &configs[0]; priorities[0] = 0; diff --git a/sys/bus/pccard/pccard_cis.c b/sys/bus/pccard/pccard_cis.c index 1dbdf12991..0bb00e95f1 100644 --- a/sys/bus/pccard/pccard_cis.c +++ b/sys/bus/pccard/pccard_cis.c @@ -1,6 +1,6 @@ /* $NetBSD: pcmcia_cis.c,v 1.17 2000/02/10 09:01:52 chopps Exp $ */ /* $FreeBSD: src/sys/dev/pccard/pccard_cis.c,v 1.23 2002/11/14 14:02:32 mux Exp $ */ -/* $DragonFly: src/sys/bus/pccard/pccard_cis.c,v 1.4 2006/09/05 00:55:36 dillon Exp $ */ +/* $DragonFly: src/sys/bus/pccard/pccard_cis.c,v 1.5 2006/09/05 03:48:09 dillon Exp $ */ /* * Copyright (c) 1997 Marc Horowitz. All rights reserved. @@ -839,7 +839,7 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg) break; } if (state->pf == NULL) { - state->pf = malloc(sizeof(*state->pf), + state->pf = kmalloc(sizeof(*state->pf), M_DEVBUF, M_INTWAIT | M_ZERO); state->pf->number = state->count++; state->pf->last_config_index = -1; diff --git a/sys/bus/usb/uhci.c b/sys/bus/usb/uhci.c index 7b2bdf8653..255d1e1b8d 100644 --- a/sys/bus/usb/uhci.c +++ b/sys/bus/usb/uhci.c @@ -2,7 +2,7 @@ * $NetBSD: uhci.c,v 1.80 2000/01/19 01:16:38 augustss Exp $ * $NetBSD: uhci.c,v 1.170 2003/02/19 01:35:04 augustss Exp $ * $FreeBSD: src/sys/dev/usb/uhci.c,v 1.149 2003/11/10 00:08:41 joe Exp $ - * $DragonFly: src/sys/bus/usb/uhci.c,v 1.15 2006/09/05 00:55:36 dillon Exp $ + * $DragonFly: src/sys/bus/usb/uhci.c,v 1.16 2006/09/05 03:48:09 dillon Exp $ */ /* Also already incorporated from NetBSD: @@ -2557,7 +2557,7 @@ uhci_setup_isoc(usbd_pipe_handle pipe) int i; iso = &upipe->u.iso; - iso->stds = malloc(UHCI_VFRAMELIST_COUNT * sizeof (uhci_soft_td_t *), + iso->stds = kmalloc(UHCI_VFRAMELIST_COUNT * sizeof (uhci_soft_td_t *), M_USBHC, M_INTWAIT); token = rd ? UHCI_TD_IN (0, endpt, addr, 0) : diff --git a/sys/bus/usb/uhub.c b/sys/bus/usb/uhub.c index f89a07b54c..d2560c46c8 100644 --- a/sys/bus/usb/uhub.c +++ b/sys/bus/usb/uhub.c @@ -1,7 +1,7 @@ /* * $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ * $FreeBSD: src/sys/dev/usb/uhub.c,v 1.54 2003/08/24 17:55:55 obrien Exp $ - * $DragonFly: src/sys/bus/usb/uhub.c,v 1.7 2006/09/05 00:55:36 dillon Exp $ + * $DragonFly: src/sys/bus/usb/uhub.c,v 1.8 2006/09/05 03:48:09 dillon Exp $ */ /* @@ -216,7 +216,7 @@ USB_ATTACH(uhub) USBDEVNAME(sc->sc_dev), nports, nports != 1 ? "s" : "", nremov, dev->self_powered ? "self" : "bus"); - hub = malloc(sizeof(*hub) + (nports-1) * sizeof(struct usbd_port), + hub = kmalloc(sizeof(*hub) + (nports-1) * sizeof(struct usbd_port), M_USBDEV, M_WAITOK); dev->hub = hub; dev->hub->hubsoftc = sc; diff --git a/sys/bus/usb/usb_subr.c b/sys/bus/usb/usb_subr.c index 1e10d29c3c..c9ee4ddab7 100644 --- a/sys/bus/usb/usb_subr.c +++ b/sys/bus/usb/usb_subr.c @@ -1,7 +1,7 @@ /* * $NetBSD: usb_subr.c,v 1.99 2002/07/11 21:14:34 augustss Exp $ * $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.58 2003/09/01 07:47:42 ticso Exp $ - * $DragonFly: src/sys/bus/usb/usb_subr.c,v 1.12 2006/09/05 00:55:36 dillon Exp $ + * $DragonFly: src/sys/bus/usb/usb_subr.c,v 1.13 2006/09/05 03:48:09 dillon Exp $ */ /* Also already have from NetBSD: @@ -467,7 +467,7 @@ usbd_fill_iface_data(usbd_device_handle dev, int ifaceidx, int altidx) nendpt = ifc->idesc->bNumEndpoints; DPRINTFN(4,("usbd_fill_iface_data: found idesc nendpt=%d\n", nendpt)); if (nendpt != 0) { - ifc->endpoints = malloc(nendpt * sizeof(struct usbd_endpoint), + ifc->endpoints = kmalloc(nendpt * sizeof(struct usbd_endpoint), M_USB, M_INTWAIT); } else { ifc->endpoints = NULL; @@ -710,7 +710,7 @@ usbd_set_config_index(usbd_device_handle dev, int index, int msg) /* Allocate and fill interface data. */ nifc = cdp->bNumInterface; - dev->ifaces = malloc(nifc * sizeof(struct usbd_interface), + dev->ifaces = kmalloc(nifc * sizeof(struct usbd_interface), M_USB, M_INTWAIT); DPRINTFN(5,("usbd_set_config_index: dev=%p cdesc=%p\n", dev, cdp)); dev->cdesc = cdp; diff --git a/sys/config/LINT b/sys/config/LINT index 64a4fdcf82..ca42db04dc 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -3,7 +3,7 @@ # as much of the source tree as it can. # # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $ -# $DragonFly: src/sys/config/LINT,v 1.91 2006/09/03 09:07:20 sephe Exp $ +# $DragonFly: src/sys/config/LINT,v 1.92 2006/09/05 03:48:11 dillon Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -65,6 +65,8 @@ makeoptions CONF_CFLAGS=-fno-builtin #Don't allow use of memcmp, etc. #makeoptions INSTALLSTRIPPED=1 #makeoptions INSTALLSTRIPPEDMODULES=1 +options KMALLOC_ONLY + # # Certain applications can grow to be larger than the 128M limit # that FreeBSD initially imposes. Below are some options to diff --git a/sys/dev/acpica5/acpi_cmbat.c b/sys/dev/acpica5/acpi_cmbat.c index bd89e62ff9..ced57aa6df 100644 --- a/sys/dev/acpica5/acpi_cmbat.c +++ b/sys/dev/acpica5/acpi_cmbat.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi_cmbat.c,v 1.29 2004/05/30 20:08:23 phk Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi_cmbat.c,v 1.7 2006/09/05 00:55:36 dillon Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi_cmbat.c,v 1.8 2006/09/05 03:48:09 dillon Exp $ */ #include "opt_acpi.h" @@ -464,7 +464,7 @@ acpi_cmbat_get_total_battinfo(struct acpi_battinfo *battinfo) } if (bat == NULL) { bat_units = acpi_cmbat_units; - bat = malloc(sizeof(struct acpi_cmbat_softc *) * bat_units, + bat = kmalloc(sizeof(struct acpi_cmbat_softc *) * bat_units, M_ACPICMBAT, M_INTWAIT); /* Collect softc pointers */ diff --git a/sys/dev/acpica5/acpi_cpu.c b/sys/dev/acpica5/acpi_cpu.c index ec7e864934..fc27670c27 100644 --- a/sys/dev/acpica5/acpi_cpu.c +++ b/sys/dev/acpica5/acpi_cpu.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.41 2004/06/24 00:38:51 njl Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi_cpu.c,v 1.13 2006/08/07 23:27:22 y0netan1 Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi_cpu.c,v 1.14 2006/09/05 03:48:09 dillon Exp $ */ #include "opt_acpi.h" @@ -198,7 +198,7 @@ acpi_cpu_probe(device_t dev) handle = acpi_get_handle(dev); if (cpu_softc == NULL) - cpu_softc = malloc(sizeof(struct acpi_cpu_softc *) * + cpu_softc = kmalloc(sizeof(struct acpi_cpu_softc *) * SMP_MAXCPU, M_TEMP /* XXX */, M_INTWAIT | M_ZERO); /* Get our Processor object. */ diff --git a/sys/dev/agp/agp_amd.c b/sys/dev/agp/agp_amd.c index 915e98053a..9086e6b97a 100644 --- a/sys/dev/agp/agp_amd.c +++ b/sys/dev/agp/agp_amd.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/pci/agp_amd.c,v 1.3.2.4 2002/04/25 23:41:36 cokane Exp $ - * $DragonFly: src/sys/dev/agp/agp_amd.c,v 1.6 2006/09/05 00:55:36 dillon Exp $ + * $DragonFly: src/sys/dev/agp/agp_amd.c,v 1.7 2006/09/05 03:48:09 dillon Exp $ */ #include "opt_bus.h" @@ -96,7 +96,7 @@ agp_amd_alloc_gatt(device_t dev) * directory. */ gatt->ag_entries = entries; - gatt->ag_virtual = malloc(entries * sizeof(u_int32_t), + gatt->ag_virtual = kmalloc(entries * sizeof(u_int32_t), M_AGP, M_INTWAIT | M_ZERO); /* diff --git a/sys/dev/crypto/ubsec/ubsec.c b/sys/dev/crypto/ubsec/ubsec.c index a8e43d2d4a..80ece49efd 100644 --- a/sys/dev/crypto/ubsec/ubsec.c +++ b/sys/dev/crypto/ubsec/ubsec.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.6.2.12 2003/06/04 17:56:59 sam Exp $ */ -/* $DragonFly: src/sys/dev/crypto/ubsec/ubsec.c,v 1.10 2006/09/05 00:55:37 dillon Exp $ */ +/* $DragonFly: src/sys/dev/crypto/ubsec/ubsec.c,v 1.11 2006/09/05 03:48:09 dillon Exp $ */ /* $OpenBSD: ubsec.c,v 1.115 2002/09/24 18:33:26 jason Exp $ */ /* @@ -854,7 +854,7 @@ ubsec_newsession(void *arg, u_int32_t *sidp, struct cryptoini *cri) return (EINVAL); if (sc->sc_sessions == NULL) { - ses = sc->sc_sessions = malloc(sizeof(struct ubsec_session), + ses = sc->sc_sessions = kmalloc(sizeof(struct ubsec_session), M_DEVBUF, M_INTWAIT); sesn = 0; sc->sc_nsessions = 1; @@ -868,7 +868,7 @@ ubsec_newsession(void *arg, u_int32_t *sidp, struct cryptoini *cri) if (ses == NULL) { sesn = sc->sc_nsessions; - ses = malloc((sesn + 1) * sizeof(struct ubsec_session), + ses = kmalloc((sesn + 1) * sizeof(struct ubsec_session), M_DEVBUF, M_INTWAIT); bcopy(sc->sc_sessions, ses, sesn * sizeof(struct ubsec_session)); diff --git a/sys/dev/disk/aic7xxx/aic79xx.c b/sys/dev/disk/aic7xxx/aic79xx.c index 17a782ea04..54766054f4 100644 --- a/sys/dev/disk/aic7xxx/aic79xx.c +++ b/sys/dev/disk/aic7xxx/aic79xx.c @@ -40,7 +40,7 @@ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#198 $ * * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.3.2.5 2003/06/10 03:26:07 gibbs Exp $ - * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx.c,v 1.8 2006/09/05 00:55:37 dillon Exp $ + * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx.c,v 1.9 2006/09/05 03:48:09 dillon Exp $ */ #include "aic79xx_osm.h" @@ -5799,7 +5799,7 @@ ahd_init(struct ahd_softc *ahd) AHD_ASSERT_MODES(ahd, AHD_MODE_SCSI_MSK, AHD_MODE_SCSI_MSK); ahd->stack_size = ahd_probe_stack_size(ahd); - ahd->saved_stack = malloc(ahd->stack_size * sizeof(uint16_t), + ahd->saved_stack = kmalloc(ahd->stack_size * sizeof(uint16_t), M_DEVBUF, M_WAITOK); /* diff --git a/sys/dev/disk/aic7xxx/aic7xxx.c b/sys/dev/disk/aic7xxx/aic7xxx.c index 6df244b787..941c6177c8 100644 --- a/sys/dev/disk/aic7xxx/aic7xxx.c +++ b/sys/dev/disk/aic7xxx/aic7xxx.c @@ -40,7 +40,7 @@ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#134 $ * * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.41.2.27 2003/06/10 03:26:08 gibbs Exp $ - * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx.c,v 1.8 2006/09/05 00:55:37 dillon Exp $ + * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx.c,v 1.9 2006/09/05 03:48:09 dillon Exp $ */ #include "aic7xxx_osm.h" @@ -3807,7 +3807,7 @@ ahc_alloc(void *platform_arg, char *name) ahc = device_get_softc((device_t)platform_arg); #endif memset(ahc, 0, sizeof(*ahc)); - ahc->seep_config = malloc(sizeof(*ahc->seep_config), + ahc->seep_config = kmalloc(sizeof(*ahc->seep_config), M_DEVBUF, M_WAITOK); LIST_INIT(&ahc->pending_scbs); /* We don't know our unit number until the OSM sets it */ @@ -3848,7 +3848,7 @@ ahc_softc_init(struct ahc_softc *ahc) ahc->pause = ahc->unpause | PAUSE; /* XXX The shared scb data stuff should be deprecated */ if (ahc->scb_data == NULL) { - ahc->scb_data = malloc(sizeof(*ahc->scb_data), + ahc->scb_data = kmalloc(sizeof(*ahc->scb_data), M_DEVBUF, M_WAITOK | M_ZERO); } @@ -4243,7 +4243,7 @@ ahc_init_scbdata(struct ahc_softc *ahc) SLIST_INIT(&scb_data->sg_maps); /* Allocate SCB resources */ - scb_data->scbarray = malloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, + scb_data->scbarray = kmalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, M_DEVBUF, M_INTWAIT | M_ZERO); /* Determine the number of hardware SCBs and initialize them */ diff --git a/sys/dev/disk/ccd/ccd.c b/sys/dev/disk/ccd/ccd.c index b270f2dcc2..9229483015 100644 --- a/sys/dev/disk/ccd/ccd.c +++ b/sys/dev/disk/ccd/ccd.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/ccd/ccd.c,v 1.73.2.1 2001/09/11 09:49:52 kris Exp $ */ -/* $DragonFly: src/sys/dev/disk/ccd/ccd.c,v 1.35 2006/09/05 00:55:37 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/ccd/ccd.c,v 1.36 2006/09/05 03:48:10 dillon Exp $ */ /* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */ @@ -362,7 +362,7 @@ ccdinit(struct ccddevice *ccd, char **cpaths, struct ucred *cred) cs->sc_nccdisks = ccd->ccd_ndev; /* Allocate space for the component info. */ - cs->sc_cinfo = malloc(cs->sc_nccdisks * sizeof(struct ccdcinfo), + cs->sc_cinfo = kmalloc(cs->sc_nccdisks * sizeof(struct ccdcinfo), M_DEVBUF, M_WAITOK); /* @@ -602,7 +602,7 @@ ccdinterleave(struct ccd_softc *cs, int unit) * Allocate space for ii_index. We might allocate more then * we use. */ - ii->ii_index = malloc((sizeof(int) * cs->sc_nccdisks), + ii->ii_index = kmalloc((sizeof(int) * cs->sc_nccdisks), M_DEVBUF, M_WAITOK); /* @@ -1315,9 +1315,9 @@ ccdioctl(struct dev_ioctl_args *ap) * Allocate space for and copy in the array of * componet pathnames and device numbers. */ - cpp = malloc(ccio->ccio_ndisks * sizeof(char *), + cpp = kmalloc(ccio->ccio_ndisks * sizeof(char *), M_DEVBUF, M_WAITOK); - vpp = malloc(ccio->ccio_ndisks * sizeof(struct vnode *), + vpp = kmalloc(ccio->ccio_ndisks * sizeof(struct vnode *), M_DEVBUF, M_WAITOK); error = copyin((caddr_t)ccio->ccio_disks, (caddr_t)cpp, diff --git a/sys/dev/disk/ispfw/ispfw.c b/sys/dev/disk/ispfw/ispfw.c index 9d6aa6ac51..e3643f4a47 100644 --- a/sys/dev/disk/ispfw/ispfw.c +++ b/sys/dev/disk/ispfw/ispfw.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/ispfw/ispfw.c,v 1.2.2.5 2002/10/12 00:13:09 mjacob Exp $ */ -/* $DragonFly: src/sys/dev/disk/ispfw/ispfw.c,v 1.6 2006/09/05 00:55:37 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/ispfw/ispfw.c,v 1.7 2006/09/05 03:48:10 dillon Exp $ */ /* * ISP Firmware Helper Pseudo Device for FreeBSD * @@ -73,7 +73,7 @@ addcaller(const u_int16_t **caller) if (callp[i] == caller) return (1); } - newcallp = malloc((ncallers + 1) * sizeof (const u_int16_t ***), + newcallp = kmalloc((ncallers + 1) * sizeof (const u_int16_t ***), M_DEVBUF, M_WAITOK); for (i = 0; i < ncallers; i++) { newcallp[i] = callp[i]; diff --git a/sys/dev/disk/sbp/sbp.c b/sys/dev/disk/sbp/sbp.c index 3c6a751487..e82658d556 100644 --- a/sys/dev/disk/sbp/sbp.c +++ b/sys/dev/disk/sbp/sbp.c @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/firewire/sbp.c,v 1.74 2004/01/08 14:58:09 simokawa Exp $ - * $DragonFly: src/sys/dev/disk/sbp/sbp.c,v 1.17 2006/09/05 00:55:38 dillon Exp $ + * $DragonFly: src/sys/dev/disk/sbp/sbp.c,v 1.18 2006/09/05 03:48:10 dillon Exp $ * */ @@ -471,7 +471,7 @@ END_DEBUG * note: realloc() does not support M_ZERO. We must zero * the extended region manually. */ - newluns = realloc(target->luns, + newluns = krealloc(target->luns, sizeof(struct sbp_dev *) * maxlun, M_SBP, M_WAITOK); @@ -499,7 +499,7 @@ END_DEBUG sdev = target->luns[lun]; if (sdev == NULL) { - sdev = malloc(sizeof(struct sbp_dev), + sdev = kmalloc(sizeof(struct sbp_dev), M_SBP, M_WAITOK | M_ZERO); target->luns[lun] = sdev; sdev->lun_id = lun; diff --git a/sys/dev/disk/trm/trm.c b/sys/dev/disk/trm/trm.c index 67bd7fd4a2..c722e34858 100644 --- a/sys/dev/disk/trm/trm.c +++ b/sys/dev/disk/trm/trm.c @@ -45,7 +45,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/trm/trm.c,v 1.2.2.2 2002/12/19 20:34:45 cognet Exp $ - * $DragonFly: src/sys/dev/disk/trm/trm.c,v 1.11 2006/08/03 16:40:47 swildner Exp $ + * $DragonFly: src/sys/dev/disk/trm/trm.c,v 1.12 2006/09/05 03:48:10 dillon Exp $ */ /* @@ -2871,7 +2871,7 @@ trm_initACB(PACB pACB, u_int16_t unit) if (pACB->AdaptSCSIID != i) { for (j = 0; j < (pACB->max_lun +1); j++) { pACB->scan_devices[i][j] = 1; - pACB->pDCB[i][j]= (PDCB) malloc ( + pACB->pDCB[i][j]= (PDCB) kmalloc ( sizeof (struct _DCB), M_DEVBUF, M_WAITOK); trm_initDCB(pACB, pACB->pDCB[i][j], unit, i, j); diff --git a/sys/dev/disk/vpo/vpoio.c b/sys/dev/disk/vpo/vpoio.c index fbb95d34f5..a7887b3287 100644 --- a/sys/dev/disk/vpo/vpoio.c +++ b/sys/dev/disk/vpo/vpoio.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ppbus/vpoio.c,v 1.10.2.3 2001/10/02 05:27:20 nsouch Exp $ - * $DragonFly: src/sys/dev/disk/vpo/vpoio.c,v 1.6 2005/02/17 13:59:35 joerg Exp $ + * $DragonFly: src/sys/dev/disk/vpo/vpoio.c,v 1.7 2006/09/05 03:48:10 dillon Exp $ * */ @@ -593,7 +593,7 @@ vpoio_attach(struct vpoio_data *vpo) device_t ppbus = device_get_parent(vpo->vpo_dev); int error = 0; - vpo->vpo_nibble_inbyte_msq = malloc(sizeof(nibble_inbyte_submicroseq), + vpo->vpo_nibble_inbyte_msq = kmalloc(sizeof(nibble_inbyte_submicroseq), M_DEVBUF, M_WAITOK); bcopy((void *)nibble_inbyte_submicroseq, diff --git a/sys/dev/drm/drm_ioctl.h b/sys/dev/drm/drm_ioctl.h index 07f87dba4e..87da369f24 100644 --- a/sys/dev/drm/drm_ioctl.h +++ b/sys/dev/drm/drm_ioctl.h @@ -29,7 +29,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/drm_ioctl.h,v 1.4.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_ioctl.h,v 1.3 2004/02/13 01:23:57 joerg Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_ioctl.h,v 1.4 2006/09/05 03:48:10 dillon Exp $ */ #include "dev/drm/drmP.h" @@ -63,7 +63,7 @@ int DRM(irq_busid)( DRM_IOCTL_ARGS ) break; } - free(kids, M_TEMP); + kfree(kids, M_TEMP); if (i != num_kids) id.irq = pci_get_irq(dev); diff --git a/sys/dev/drm/drm_memory.h b/sys/dev/drm/drm_memory.h index 45e1159d91..cad61c740c 100644 --- a/sys/dev/drm/drm_memory.h +++ b/sys/dev/drm/drm_memory.h @@ -29,7 +29,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/drm_memory.h,v 1.8.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_memory.h,v 1.4 2004/05/13 19:44:32 dillon Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_memory.h,v 1.5 2006/09/05 03:48:10 dillon Exp $ */ #include "dev/drm/drmP.h" @@ -147,7 +147,7 @@ int DRM(mem_info) DRM_SYSCTL_HANDLER_ARGS int ret; drm_mem_stats_t *stats; - stats = malloc(sizeof(DRM(mem_stats)), DRM(M_DRM), M_WAITOK); + stats = kmalloc(sizeof(DRM(mem_stats)), DRM(M_DRM), M_WAITOK); DRM_SPINLOCK(&DRM(mem_lock)); bcopy(DRM(mem_stats), stats, sizeof(DRM(mem_stats))); @@ -155,7 +155,7 @@ int DRM(mem_info) DRM_SYSCTL_HANDLER_ARGS ret = DRM(_mem_info)(stats, oidp, arg1, arg2, req); - free(stats, DRM(M_DRM)); + kfree(stats, DRM(M_DRM)); return ret; } #endif /* __FreeBSD__ */ @@ -169,7 +169,7 @@ void *DRM(alloc)(size_t size, int area) return NULL; } - if (!(pt = malloc(size, DRM(M_DRM), M_NOWAIT))) { + if (!(pt = kmalloc(size, DRM(M_DRM), M_NOWAIT))) { DRM_SPINLOCK(&DRM(mem_lock)); ++DRM(mem_stats)[area].fail_count; DRM_SPINUNLOCK(&DRM(mem_lock)); @@ -222,7 +222,7 @@ void DRM(free)(void *pt, size_t size, int area) if (!pt) DRM_MEM_ERROR(area, "Attempt to free NULL pointer\n"); else - free(pt, DRM(M_DRM)); + kfree(pt, DRM(M_DRM)); DRM_SPINLOCK(&DRM(mem_lock)); DRM(mem_stats)[area].bytes_freed += size; free_count = ++DRM(mem_stats)[area].free_count; diff --git a/sys/dev/drm/drm_os_freebsd.h b/sys/dev/drm/drm_os_freebsd.h index 59ac2b26d1..cdd1e547e6 100644 --- a/sys/dev/drm/drm_os_freebsd.h +++ b/sys/dev/drm/drm_os_freebsd.h @@ -1,6 +1,6 @@ /* * $FreeBSD: src/sys/dev/drm/drm_os_freebsd.h,v 1.10.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_os_freebsd.h,v 1.18 2006/07/28 02:17:36 dillon Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_os_freebsd.h,v 1.19 2006/09/05 03:48:10 dillon Exp $ */ #include #include @@ -115,8 +115,8 @@ #define DRM_TASKQUEUE_ARGS void *arg, int pending #define DRM_IRQ_ARGS void *arg #define DRM_DEVICE drm_device_t *dev = kdev->si_drv1 -#define DRM_MALLOC(size) malloc( size, DRM(M_DRM), M_NOWAIT ) -#define DRM_FREE(pt,size) free( pt, DRM(M_DRM) ) +#define DRM_MALLOC(size) kmalloc( size, DRM(M_DRM), M_NOWAIT ) +#define DRM_FREE(pt,size) kfree( pt, DRM(M_DRM) ) #define DRM_VTOPHYS(addr) vtophys(addr) /* Read/write from bus space, with byteswapping to le if necessary */ diff --git a/sys/dev/drm/drm_scatter.h b/sys/dev/drm/drm_scatter.h index 977635350d..fbbbea6047 100644 --- a/sys/dev/drm/drm_scatter.h +++ b/sys/dev/drm/drm_scatter.h @@ -27,7 +27,7 @@ * Gareth Hughes * * $FreeBSD: src/sys/dev/drm/drm_scatter.h,v 1.4.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_scatter.h,v 1.3 2005/02/17 13:59:35 joerg Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_scatter.h,v 1.4 2006/09/05 03:48:10 dillon Exp $ */ #include "dev/drm/drmP.h" @@ -38,7 +38,7 @@ void DRM(sg_cleanup)( drm_sg_mem_t *entry ) { - free( entry->virtual, DRM(M_DRM) ); + kfree( entry->virtual, DRM(M_DRM) ); DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), @@ -84,7 +84,7 @@ int DRM(sg_alloc)( DRM_IOCTL_ARGS ) } bzero( (void *)entry->busaddr, pages * sizeof(*entry->busaddr) ); - entry->virtual = malloc( pages << PAGE_SHIFT, DRM(M_DRM), M_WAITOK ); + entry->virtual = kmalloc( pages << PAGE_SHIFT, DRM(M_DRM), M_WAITOK ); if ( !entry->virtual ) { DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), diff --git a/sys/dev/misc/syscons/scvtb.c b/sys/dev/misc/syscons/scvtb.c index f53f382c52..640d78f6ea 100644 --- a/sys/dev/misc/syscons/scvtb.c +++ b/sys/dev/misc/syscons/scvtb.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/syscons/scvtb.c,v 1.5.2.1 2001/07/16 05:21:23 yokota Exp $ - * $DragonFly: src/sys/dev/misc/syscons/scvtb.c,v 1.8 2006/09/05 00:55:38 dillon Exp $ + * $DragonFly: src/sys/dev/misc/syscons/scvtb.c,v 1.9 2006/09/05 03:48:10 dillon Exp $ */ #include "opt_syscons.h" @@ -56,7 +56,7 @@ sc_vtb_init(sc_vtb_t *vtb, int type, int cols, int rows, void *buf, int wait) case VTB_MEMORY: case VTB_RINGBUFFER: if ((buf == NULL) && (cols*rows != 0)) { - vtb->vtb_buffer = malloc(cols*rows*sizeof(uint16_t), + vtb->vtb_buffer = kmalloc(cols*rows*sizeof(uint16_t), M_SYSCONS, M_ZERO | ((wait) ? M_WAITOK : M_NOWAIT)); if (vtb->vtb_buffer != NULL) { diff --git a/sys/dev/misc/syscons/syscons.c b/sys/dev/misc/syscons/syscons.c index d0d74bcdc4..71783f4750 100644 --- a/sys/dev/misc/syscons/syscons.c +++ b/sys/dev/misc/syscons/syscons.c @@ -29,7 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/dev/syscons/syscons.c,v 1.336.2.17 2004/03/25 08:41:09 ru Exp $ - * $DragonFly: src/sys/dev/misc/syscons/syscons.c,v 1.26 2006/09/05 00:55:38 dillon Exp $ + * $DragonFly: src/sys/dev/misc/syscons/syscons.c,v 1.27 2006/09/05 03:48:10 dillon Exp $ */ #include "use_splash.h" @@ -299,7 +299,7 @@ sc_attach_unit(int unit, int flags) if (sc_console->tsw->te_size > 0) { /* assert(sc_console->ts != NULL); */ kernel_console_ts = sc_console->ts; - sc_console->ts = malloc(sc_console->tsw->te_size, + sc_console->ts = kmalloc(sc_console->tsw->te_size, M_SYSCONS, M_WAITOK); bcopy(kernel_console_ts, sc_console->ts, sc_console->tsw->te_size); (*sc_console->tsw->te_default_attr)(sc_console, diff --git a/sys/dev/netif/de/if_de.c b/sys/dev/netif/de/if_de.c index f62c0aa83f..0aa7f16004 100644 --- a/sys/dev/netif/de/if_de.c +++ b/sys/dev/netif/de/if_de.c @@ -1,7 +1,7 @@ /* $NetBSD: if_de.c,v 1.86 1999/06/01 19:17:59 thorpej Exp $ */ /* $FreeBSD: src/sys/pci/if_de.c,v 1.123.2.4 2000/08/04 23:25:09 peter Exp $ */ -/* $DragonFly: src/sys/dev/netif/de/if_de.c,v 1.44 2006/09/05 00:55:39 dillon Exp $ */ +/* $DragonFly: src/sys/dev/netif/de/if_de.c,v 1.45 2006/09/05 03:48:10 dillon Exp $ */ /*- * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com) @@ -4146,9 +4146,9 @@ tulip_pci_attach(device_t dev) tulip_initcsrs(sc, csr_base + csroffset, csrsize); - sc->tulip_rxdescs = malloc(sizeof(tulip_desc_t) * TULIP_RXDESCS, + sc->tulip_rxdescs = kmalloc(sizeof(tulip_desc_t) * TULIP_RXDESCS, M_DEVBUF, M_INTWAIT); - sc->tulip_txdescs = malloc(sizeof(tulip_desc_t) * TULIP_TXDESCS, + sc->tulip_txdescs = kmalloc(sizeof(tulip_desc_t) * TULIP_TXDESCS, M_DEVBUF, M_INTWAIT); tulip_initring(sc, &sc->tulip_rxinfo, sc->tulip_rxdescs, TULIP_RXDESCS); diff --git a/sys/dev/netif/em/if_em.c b/sys/dev/netif/em/if_em.c index 6a68eee4ed..d297fca533 100644 --- a/sys/dev/netif/em/if_em.c +++ b/sys/dev/netif/em/if_em.c @@ -64,7 +64,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/dev/netif/em/if_em.c,v 1.48 2006/09/05 00:55:40 dillon Exp $ + * $DragonFly: src/sys/dev/netif/em/if_em.c,v 1.49 2006/09/05 03:48:10 dillon Exp $ * $FreeBSD$ */ /* @@ -2227,7 +2227,7 @@ em_dma_free(struct adapter *adapter, struct em_dma_alloc *dma) static int em_allocate_transmit_structures(struct adapter * adapter) { - adapter->tx_buffer_area = malloc(sizeof(struct em_buffer) * + adapter->tx_buffer_area = kmalloc(sizeof(struct em_buffer) * adapter->num_tx_desc, M_DEVBUF, M_NOWAIT | M_ZERO); if (adapter->tx_buffer_area == NULL) { device_printf(adapter->dev, "Unable to allocate tx_buffer memory\n"); diff --git a/sys/dev/netif/fwe/if_fwe.c b/sys/dev/netif/fwe/if_fwe.c index ba7c0e62a2..7a68b327ca 100644 --- a/sys/dev/netif/fwe/if_fwe.c +++ b/sys/dev/netif/fwe/if_fwe.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/firewire/if_fwe.c,v 1.27 2004/01/08 14:58:09 simokawa Exp $ - * $DragonFly: src/sys/dev/netif/fwe/if_fwe.c,v 1.25 2006/09/05 00:55:40 dillon Exp $ + * $DragonFly: src/sys/dev/netif/fwe/if_fwe.c,v 1.26 2006/09/05 03:48:10 dillon Exp $ */ #include "opt_inet.h" @@ -304,7 +304,7 @@ found: xferq->psize = MCLBYTES; xferq->queued = 0; xferq->buf = NULL; - xferq->bulkxfer = (struct fw_bulkxfer *) malloc( + xferq->bulkxfer = (struct fw_bulkxfer *) kmalloc( sizeof(struct fw_bulkxfer) * xferq->bnchunk, M_FWE, M_WAITOK); if (xferq->bulkxfer == NULL) { diff --git a/sys/dev/netif/fxp/if_fxp.c b/sys/dev/netif/fxp/if_fxp.c index 6034f3e485..1daf148d87 100644 --- a/sys/dev/netif/fxp/if_fxp.c +++ b/sys/dev/netif/fxp/if_fxp.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.110.2.30 2003/06/12 16:47:05 mux Exp $ - * $DragonFly: src/sys/dev/netif/fxp/if_fxp.c,v 1.44 2006/09/05 00:55:40 dillon Exp $ + * $DragonFly: src/sys/dev/netif/fxp/if_fxp.c,v 1.45 2006/09/05 03:48:10 dillon Exp $ */ /* @@ -472,7 +472,7 @@ fxp_attach(device_t dev) CSR_WRITE_4(sc, FXP_CSR_PORT, FXP_PORT_SELECTIVE_RESET); DELAY(10); - sc->cbl_base = malloc(sizeof(struct fxp_cb_tx) * FXP_NTXCB, + sc->cbl_base = kmalloc(sizeof(struct fxp_cb_tx) * FXP_NTXCB, M_DEVBUF, M_WAITOK | M_ZERO); sc->fxp_stats = kmalloc(sizeof(struct fxp_stats), M_DEVBUF, diff --git a/sys/dev/netif/ic/if_ic.c b/sys/dev/netif/ic/if_ic.c index 20b3b3bce6..c8b6b90f2e 100644 --- a/sys/dev/netif/ic/if_ic.c +++ b/sys/dev/netif/ic/if_ic.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/iicbus/if_ic.c,v 1.8 1999/12/29 04:35:39 peter Exp $ - * $DragonFly: src/sys/dev/netif/ic/if_ic.c,v 1.15 2006/09/05 00:55:40 dillon Exp $ + * $DragonFly: src/sys/dev/netif/ic/if_ic.c,v 1.16 2006/09/05 03:48:10 dillon Exp $ */ /* @@ -194,14 +194,14 @@ icioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) if ((error = iicbus_request_bus(parent, icdev, IIC_WAIT|IIC_INTR))) return (error); - sc->ic_obuf = malloc(sc->ic_if.if_mtu + ICHDRLEN, + sc->ic_obuf = kmalloc(sc->ic_if.if_mtu + ICHDRLEN, M_DEVBUF, M_WAITOK); if (!sc->ic_obuf) { iicbus_release_bus(parent, icdev); return ENOBUFS; } - sc->ic_ifbuf = malloc(sc->ic_if.if_mtu + ICHDRLEN, + sc->ic_ifbuf = kmalloc(sc->ic_if.if_mtu + ICHDRLEN, M_DEVBUF, M_WAITOK); if (!sc->ic_ifbuf) { iicbus_release_bus(parent, icdev); diff --git a/sys/dev/netif/kue/if_kue.c b/sys/dev/netif/kue/if_kue.c index b5ff98081d..69e8c9ddf5 100644 --- a/sys/dev/netif/kue/if_kue.c +++ b/sys/dev/netif/kue/if_kue.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/usb/if_kue.c,v 1.17.2.9 2003/04/13 02:39:25 murray Exp $ - * $DragonFly: src/sys/dev/netif/kue/if_kue.c,v 1.20 2006/09/05 00:55:40 dillon Exp $ + * $DragonFly: src/sys/dev/netif/kue/if_kue.c,v 1.21 2006/09/05 03:48:10 dillon Exp $ */ /* @@ -470,7 +470,7 @@ USB_ATTACH(kue) err = kue_ctl(sc, KUE_CTL_READ, KUE_CMD_GET_ETHER_DESCRIPTOR, 0, (char *)&sc->kue_desc, sizeof(sc->kue_desc)); - sc->kue_mcfilters = malloc(KUE_MCFILTCNT(sc) * ETHER_ADDR_LEN, + sc->kue_mcfilters = kmalloc(KUE_MCFILTCNT(sc) * ETHER_ADDR_LEN, M_USBDEV, M_WAITOK); ifp = &sc->arpcom.ac_if; diff --git a/sys/dev/netif/mn/if_mn.c b/sys/dev/netif/mn/if_mn.c index eb809aebbd..8dbf82524a 100644 --- a/sys/dev/netif/mn/if_mn.c +++ b/sys/dev/netif/mn/if_mn.c @@ -22,7 +22,7 @@ * this gadget. * * $FreeBSD: src/sys/pci/if_mn.c,v 1.11.2.3 2001/01/23 12:47:09 phk Exp $ - * $DragonFly: src/sys/dev/netif/mn/if_mn.c,v 1.12 2006/09/05 00:55:40 dillon Exp $ + * $DragonFly: src/sys/dev/netif/mn/if_mn.c,v 1.13 2006/09/05 03:48:10 dillon Exp $ */ /* @@ -828,7 +828,7 @@ mn_create_channel(struct softc *sc, int chan) { struct schan *sch; - sch = sc->ch[chan] = (struct schan *)malloc(sizeof *sc->ch[chan], + sch = sc->ch[chan] = (struct schan *)kmalloc(sizeof *sc->ch[chan], M_MN, M_WAITOK | M_ZERO); sch->sc = sc; sch->state = DOWN; diff --git a/sys/dev/netif/my/if_my.c b/sys/dev/netif/my/if_my.c index 0bea17a1ef..322122ff70 100644 --- a/sys/dev/netif/my/if_my.c +++ b/sys/dev/netif/my/if_my.c @@ -26,7 +26,7 @@ * Written by: yen_cw@myson.com.tw available at: http://www.myson.com.tw/ * * $FreeBSD: src/sys/dev/my/if_my.c,v 1.2.2.4 2002/04/17 02:05:27 julian Exp $ - * $DragonFly: src/sys/dev/netif/my/if_my.c,v 1.24 2005/12/31 14:07:59 sephe Exp $ + * $DragonFly: src/sys/dev/netif/my/if_my.c,v 1.25 2006/09/05 03:48:10 dillon Exp $ * * Myson fast ethernet PCI NIC driver * @@ -877,7 +877,7 @@ my_attach(device_t dev) sc->my_unit = unit; - sc->my_ldata_ptr = malloc(sizeof(struct my_list_data) + 8, + sc->my_ldata_ptr = kmalloc(sizeof(struct my_list_data) + 8, M_DEVBUF, M_WAITOK); if (sc->my_ldata_ptr == NULL) { printf("my%d: no memory for list buffers!\n", unit); diff --git a/sys/dev/netif/pdq_layer/pdqvar.h b/sys/dev/netif/pdq_layer/pdqvar.h index daa522465f..12c0627a9c 100644 --- a/sys/dev/netif/pdq_layer/pdqvar.h +++ b/sys/dev/netif/pdq_layer/pdqvar.h @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/pdq/pdqvar.h,v 1.3.2.1 2002/05/14 21:02:11 gallatin Exp $ - * $DragonFly: src/sys/dev/netif/pdq_layer/Attic/pdqvar.h,v 1.9 2005/05/05 22:57:44 swildner Exp $ + * $DragonFly: src/sys/dev/netif/pdq_layer/Attic/pdqvar.h,v 1.10 2006/09/05 03:48:10 dillon Exp $ * */ @@ -86,8 +86,8 @@ enum _pdq_type_t { #define PDQ_OS_USEC_DELAY(n) DELAY(n) #define PDQ_OS_MEMZERO(p, n) bzero((caddr_t)(p), (n)) #define PDQ_OS_VA_TO_PA(pdq, p) vtophys(p) -#define PDQ_OS_MEMALLOC(n) malloc(n, M_DEVBUF, M_WAITOK) -#define PDQ_OS_MEMFREE(p, n) free((void *) p, M_DEVBUF) +#define PDQ_OS_MEMALLOC(n) kmalloc(n, M_DEVBUF, M_WAITOK) +#define PDQ_OS_MEMFREE(p, n) kfree((void *) p, M_DEVBUF) #if defined(__DragonFly__) || defined(__FreeBSD__) #define PDQ_OS_MEMALLOC_CONTIG(n) vm_page_alloc_contig(n, 0, 0xffffffff, PAGE_SIZE) #define PDQ_OS_MEMFREE_CONTIG(p, n) kmem_free(kernel_map, (vm_offset_t) p, n) diff --git a/sys/dev/netif/sbni/if_sbni_pci.c b/sys/dev/netif/sbni/if_sbni_pci.c index cc56dcc951..7990f266da 100644 --- a/sys/dev/netif/sbni/if_sbni_pci.c +++ b/sys/dev/netif/sbni/if_sbni_pci.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sbni/if_sbni_pci.c,v 1.6 2002/09/28 20:59:59 phk Exp $ - * $DragonFly: src/sys/dev/netif/sbni/if_sbni_pci.c,v 1.11 2006/09/05 00:55:41 dillon Exp $ + * $DragonFly: src/sys/dev/netif/sbni/if_sbni_pci.c,v 1.12 2006/09/05 03:48:10 dillon Exp $ */ @@ -86,7 +86,7 @@ sbni_pci_probe(device_t dev) if (pci_get_subdevice(dev) == 2) { ports <<= 1; - sc->slave_sc = malloc(sizeof(struct sbni_softc), + sc->slave_sc = kmalloc(sizeof(struct sbni_softc), M_DEVBUF, M_INTWAIT | M_ZERO); device_set_desc(dev, "Granch SBNI12/PCI Dual adapter"); } else { diff --git a/sys/dev/netif/tx/if_tx.c b/sys/dev/netif/tx/if_tx.c index ed86d08df6..7baf97f0c7 100644 --- a/sys/dev/netif/tx/if_tx.c +++ b/sys/dev/netif/tx/if_tx.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/tx/if_tx.c,v 1.61.2.1 2002/10/29 01:43:49 semenu Exp $ - * $DragonFly: src/sys/dev/netif/tx/if_tx.c,v 1.36 2006/09/05 00:55:41 dillon Exp $ + * $DragonFly: src/sys/dev/netif/tx/if_tx.c,v 1.37 2006/09/05 03:48:10 dillon Exp $ */ /* @@ -432,11 +432,11 @@ epic_common_attach(epic_softc_t *sc) uint16_t sub_vid; int i; - sc->tx_flist = malloc(sizeof(struct epic_frag_list)*TX_RING_SIZE, + sc->tx_flist = kmalloc(sizeof(struct epic_frag_list)*TX_RING_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); - sc->tx_desc = malloc(sizeof(struct epic_tx_desc)*TX_RING_SIZE, + sc->tx_desc = kmalloc(sizeof(struct epic_tx_desc)*TX_RING_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); - sc->rx_desc = malloc(sizeof(struct epic_rx_desc)*RX_RING_SIZE, + sc->rx_desc = kmalloc(sizeof(struct epic_rx_desc)*RX_RING_SIZE, M_DEVBUF, M_WAITOK | M_ZERO); /* Bring the chip out of low-power mode. */ diff --git a/sys/dev/netif/txp/if_txp.c b/sys/dev/netif/txp/if_txp.c index cbcb4d7411..6648aee852 100644 --- a/sys/dev/netif/txp/if_txp.c +++ b/sys/dev/netif/txp/if_txp.c @@ -1,6 +1,6 @@ /* $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */ /* $FreeBSD: src/sys/dev/txp/if_txp.c,v 1.4.2.4 2001/12/14 19:50:43 jlemon Exp $ */ -/* $DragonFly: src/sys/dev/netif/txp/if_txp.c,v 1.38 2006/09/05 00:55:41 dillon Exp $ */ +/* $DragonFly: src/sys/dev/netif/txp/if_txp.c,v 1.39 2006/09/05 03:48:11 dillon Exp $ */ /* * Copyright (c) 2001 @@ -954,7 +954,7 @@ txp_alloc_rings(struct txp_softc *sc) struct txp_swdesc *sd; if (sc->sc_rxbufs[i].rb_sd != NULL) continue; - sc->sc_rxbufs[i].rb_sd = malloc(sizeof(struct txp_swdesc), + sc->sc_rxbufs[i].rb_sd = kmalloc(sizeof(struct txp_swdesc), M_DEVBUF, M_WAITOK); if (sc->sc_rxbufs[i].rb_sd == NULL) return(ENOBUFS); @@ -1399,7 +1399,7 @@ txp_response(struct txp_softc *sc, u_int32_t ridx, u_int16_t id, u_int16_t seq, rsp = (struct txp_rsp_desc *)(((u_int8_t *)sc->sc_rspring.base) + ridx); if (id == rsp->rsp_id && rsp->rsp_seq == seq) { - *rspp = (struct txp_rsp_desc *)malloc( + *rspp = (struct txp_rsp_desc *)kmalloc( sizeof(struct txp_rsp_desc) * (rsp->rsp_numdesc + 1), M_DEVBUF, M_INTWAIT); if ((*rspp) == NULL) diff --git a/sys/dev/raid/ida/ida.c b/sys/dev/raid/ida/ida.c index 6821117124..66d37fd85e 100644 --- a/sys/dev/raid/ida/ida.c +++ b/sys/dev/raid/ida/ida.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ida/ida.c,v 1.7.2.3 2001/03/01 01:57:32 ps Exp $ - * $DragonFly: src/sys/dev/raid/ida/ida.c,v 1.12 2006/09/05 00:55:41 dillon Exp $ + * $DragonFly: src/sys/dev/raid/ida/ida.c,v 1.13 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -198,7 +198,7 @@ ida_init(struct ida_softc *ida) STAILQ_INIT(&ida->qcb_queue); bioq_init(&ida->bio_queue); - ida->qcbs = malloc(IDA_QCB_MAX * sizeof(struct ida_qcb), + ida->qcbs = kmalloc(IDA_QCB_MAX * sizeof(struct ida_qcb), M_DEVBUF, M_INTWAIT|M_ZERO); /* diff --git a/sys/dev/raid/ips/ips.c b/sys/dev/raid/ips/ips.c index 5f3888aae7..3a04dc06ed 100644 --- a/sys/dev/raid/ips/ips.c +++ b/sys/dev/raid/ips/ips.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ips/ips.c,v 1.12 2004/05/30 04:01:29 scottl Exp $ - * $DragonFly: src/sys/dev/raid/ips/ips.c,v 1.15 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/raid/ips/ips.c,v 1.16 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -151,7 +151,7 @@ ips_cmdqueue_init(ips_softc_t *sc) int i; ips_command_t *command; - sc->commandarray = malloc(sizeof(sc->commandarray[0]) * sc->max_cmds, + sc->commandarray = kmalloc(sizeof(sc->commandarray[0]) * sc->max_cmds, M_IPSBUF, M_INTWAIT | M_ZERO); SLIST_INIT(&sc->free_cmd_list); for (i = 0; i < sc->max_cmds; i++) { diff --git a/sys/dev/raid/ips/ips_ioctl.c b/sys/dev/raid/ips/ips_ioctl.c index 8ac8fa5e5b..df2c14b68b 100644 --- a/sys/dev/raid/ips/ips_ioctl.c +++ b/sys/dev/raid/ips/ips_ioctl.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ips/ips_ioctl.c,v 1.5 2004/05/30 04:01:29 scottl Exp $ - * $DragonFly: src/sys/dev/raid/ips/ips_ioctl.c,v 1.7 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/raid/ips/ips_ioctl.c,v 1.8 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -164,7 +164,7 @@ ips_ioctl_request(ips_softc_t *sc, u_long ioctl_request, caddr_t addr, case IPS_USER_CMD: user_request = (ips_user_request *)addr; ioctl_cmd = kmalloc(sizeof(ips_ioctl_t), M_IPSBUF, M_WAITOK); - ioctl_cmd->command_buffer = malloc(sizeof(ips_generic_cmd), + ioctl_cmd->command_buffer = kmalloc(sizeof(ips_generic_cmd), M_IPSBUF, M_WAITOK); if (copyin(user_request->command_buffer, ioctl_cmd->command_buffer, sizeof(ips_generic_cmd))) { diff --git a/sys/dev/raid/pst/pst-iop.c b/sys/dev/raid/pst/pst-iop.c index 87090f9872..63d3fcab41 100644 --- a/sys/dev/raid/pst/pst-iop.c +++ b/sys/dev/raid/pst/pst-iop.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/pst/pst-iop.c,v 1.2.2.1 2002/08/18 12:32:36 sos Exp $ - * $DragonFly: src/sys/dev/raid/pst/pst-iop.c,v 1.8 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/raid/pst/pst-iop.c,v 1.9 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -77,7 +77,7 @@ iop_init(struct iop_softc *sc) } /* register iop_attach to be run when interrupts are enabled */ - sc->iop_delayed_attach = malloc(sizeof(struct intr_config_hook), + sc->iop_delayed_attach = kmalloc(sizeof(struct intr_config_hook), M_PSTIOP, M_INTWAIT | M_ZERO); sc->iop_delayed_attach->ich_func = (void *)iop_attach; sc->iop_delayed_attach->ich_arg = (void *)sc; @@ -302,7 +302,7 @@ iop_get_lct(struct iop_softc *sc) contigfree(reply, ALLOCSIZE, M_PSTIOP); return 0; } - sc->lct = malloc(reply->table_size * sizeof(struct i2o_lct_entry), + sc->lct = kmalloc(reply->table_size * sizeof(struct i2o_lct_entry), M_PSTIOP, M_INTWAIT | M_ZERO); bcopy(&reply->entry[0], sc->lct, reply->table_size * sizeof(struct i2o_lct_entry)); diff --git a/sys/dev/raid/pst/pst-raid.c b/sys/dev/raid/pst/pst-raid.c index d7f3f5ded0..fddff5dd3d 100644 --- a/sys/dev/raid/pst/pst-raid.c +++ b/sys/dev/raid/pst/pst-raid.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/pst/pst-raid.c,v 1.2.2.1 2002/08/18 12:32:36 sos Exp $ - * $DragonFly: src/sys/dev/raid/pst/pst-raid.c,v 1.17 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/raid/pst/pst-raid.c,v 1.18 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -235,7 +235,7 @@ pst_start(struct pst_softc *psc) if (psc->outstanding < (I2O_IOP_OUTBOUND_FRAME_COUNT - 1) && (bio = bioq_first(&psc->bio_queue))) { if ((mfa = iop_get_mfa(psc->iop)) != 0xffffffff) { - request = malloc(sizeof(struct pst_request), + request = kmalloc(sizeof(struct pst_request), M_PSTRAID, M_INTWAIT | M_ZERO); psc->outstanding++; request->psc = psc; diff --git a/sys/dev/raid/twa/twa.c b/sys/dev/raid/twa/twa.c index 03228446b0..88733e5c65 100644 --- a/sys/dev/raid/twa/twa.c +++ b/sys/dev/raid/twa/twa.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD$ - * $DragonFly: src/sys/dev/raid/twa/twa.c,v 1.5 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/raid/twa/twa.c,v 1.6 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -110,7 +110,7 @@ twa_setup(struct twa_softc *sc) } /* Allocate memory for the AEN queue. */ - if ((aen_queue = malloc(sizeof(struct twa_event_packet) * TWA_Q_LENGTH, + if ((aen_queue = kmalloc(sizeof(struct twa_event_packet) * TWA_Q_LENGTH, M_DEVBUF, M_WAITOK)) == NULL) { /* * This should not cause us to return error. We will only be diff --git a/sys/dev/raid/twa/twa_freebsd.c b/sys/dev/raid/twa/twa_freebsd.c index 1788cde18c..21db859baf 100644 --- a/sys/dev/raid/twa/twa_freebsd.c +++ b/sys/dev/raid/twa/twa_freebsd.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD$ - * $DragonFly: src/sys/dev/raid/twa/twa_freebsd.c,v 1.11 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/raid/twa/twa_freebsd.c,v 1.12 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -574,7 +574,7 @@ twa_alloc_req_pkts(struct twa_softc *sc, int num_reqs) struct twa_request *tr; int i; - sc->twa_req_buf = malloc(num_reqs * sizeof(struct twa_request), + sc->twa_req_buf = kmalloc(num_reqs * sizeof(struct twa_request), TWA_MALLOC_CLASS, M_INTWAIT); /* Allocate the bus DMA tag appropriate for PCI. */ diff --git a/sys/dev/raid/vinum/vinum.c b/sys/dev/raid/vinum/vinum.c index 2924e698bc..3289f81c6c 100644 --- a/sys/dev/raid/vinum/vinum.c +++ b/sys/dev/raid/vinum/vinum.c @@ -37,7 +37,7 @@ * * $Id: vinum.c,v 1.33 2001/01/09 06:19:15 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinum.c,v 1.38.2.3 2003/01/07 12:14:16 joerg Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinum.c,v 1.16 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinum.c,v 1.17 2006/09/05 03:48:11 dillon Exp $ */ #define STATIC static /* nothing while we're testing XXX */ @@ -139,7 +139,7 @@ vinumattach(void *dummy) cp1++; if (*cp1 != '\0') *cp1++ = '\0'; - drives = realloc(drives, (unsigned long)((i + 1) * sizeof(char *)), + drives = krealloc(drives, (unsigned long)((i + 1) * sizeof(char *)), M_TEMP, M_WAITOK); drives[i] = cp2; } diff --git a/sys/dev/raid/vinum/vinumext.h b/sys/dev/raid/vinum/vinumext.h index f5dbb4aba3..531c78c218 100644 --- a/sys/dev/raid/vinum/vinumext.h +++ b/sys/dev/raid/vinum/vinumext.h @@ -35,7 +35,7 @@ * * $Id: vinumext.h,v 1.26 2000/05/16 07:38:08 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumext.h,v 1.25.2.3 2001/05/11 02:11:06 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumext.h,v 1.8 2006/07/28 02:17:38 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumext.h,v 1.9 2006/09/05 03:48:11 dillon Exp $ */ /* vinumext.h: external definitions */ @@ -256,9 +256,9 @@ caddr_t MMalloc(int size, char *, int); void FFree(void *mem, char *, int); #define LOCKDRIVE(d) lockdrive (d, __FILE__, __LINE__) #else -#define Malloc(x) malloc((x), M_DEVBUF, \ +#define Malloc(x) kmalloc((x), M_DEVBUF, \ mycpu->gd_intr_nesting_level == 0? M_WAITOK: M_INTWAIT) -#define Free(x) free((x), M_DEVBUF) +#define Free(x) kfree((x), M_DEVBUF) #define LOCKDRIVE(d) lockdrive (d) #endif #else diff --git a/sys/dev/serial/digi/digi.c b/sys/dev/serial/digi/digi.c index 279d4355a3..d361bde4dc 100644 --- a/sys/dev/serial/digi/digi.c +++ b/sys/dev/serial/digi/digi.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/digi/digi.c,v 1.36 2003/09/26 09:05:57 phk Exp $ - * $DragonFly: src/sys/dev/serial/digi/digi.c,v 1.6 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/serial/digi/digi.c,v 1.7 2006/09/05 03:48:11 dillon Exp $ */ /*- @@ -540,12 +540,12 @@ digi_init(struct digi_softc *sc) if (sc->ports) kfree(sc->ports, M_TTYS); - sc->ports = malloc(sizeof(struct digi_p) * sc->numports, + sc->ports = kmalloc(sizeof(struct digi_p) * sc->numports, M_TTYS, M_WAITOK | M_ZERO); if (sc->ttys) kfree(sc->ttys, M_TTYS); - sc->ttys = malloc(sizeof(struct tty) * sc->numports, + sc->ttys = kmalloc(sizeof(struct tty) * sc->numports, M_TTYS, M_WAITOK | M_ZERO); /* diff --git a/sys/dev/serial/rp/rp.c b/sys/dev/serial/rp/rp.c index a9510e966d..014545650f 100644 --- a/sys/dev/serial/rp/rp.c +++ b/sys/dev/serial/rp/rp.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/rp/rp.c,v 1.45.2.2 2002/11/07 22:26:59 tegge Exp $ - * $DragonFly: src/sys/dev/serial/rp/rp.c,v 1.17 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/serial/rp/rp.c,v 1.18 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -814,14 +814,14 @@ rp_attachcommon(CONTROLLER_T *ctlp, int num_aiops, int num_ports) RocketPortVersion, num_ports); rp_num_ports[unit] = num_ports; - ctlp->rp = rp = malloc(sizeof(struct rp_port) * num_ports, + ctlp->rp = rp = kmalloc(sizeof(struct rp_port) * num_ports, M_TTYS, M_WAITOK | M_ZERO); count = unit * 32; /* board times max ports per card SG */ for(i=count;i < (count + rp_num_ports[unit]);i++) minor_to_unit[i] = unit; - ctlp->tty = tty = malloc(sizeof(struct tty) * num_ports, + ctlp->tty = tty = kmalloc(sizeof(struct tty) * num_ports, M_TTYS, M_WAITOK | M_ZERO); crit_enter(); diff --git a/sys/dev/serial/rp/rp_isa.c b/sys/dev/serial/rp/rp_isa.c index 4b7ed741b3..50663c1048 100644 --- a/sys/dev/serial/rp/rp_isa.c +++ b/sys/dev/serial/rp/rp_isa.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/rp/rp_isa.c,v 1.3.2.1 2002/06/18 03:11:46 obrien Exp $ - * $DragonFly: src/sys/dev/serial/rp/rp_isa.c,v 1.5 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/serial/rp/rp_isa.c,v 1.6 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -174,12 +174,12 @@ rp_probe(device_t dev) /* The IO ports of AIOPs for an ISA controller are discrete. */ ctlp->io_num = 1; - ctlp->io_rid = malloc(sizeof(*(ctlp->io_rid)) * MAX_AIOPS_PER_BOARD, + ctlp->io_rid = kmalloc(sizeof(*(ctlp->io_rid)) * MAX_AIOPS_PER_BOARD, M_DEVBUF, M_WAITOK | M_ZERO); - ctlp->io = malloc(sizeof(*(ctlp->io)) * MAX_AIOPS_PER_BOARD, + ctlp->io = kmalloc(sizeof(*(ctlp->io)) * MAX_AIOPS_PER_BOARD, M_DEVBUF, M_WAITOK | M_ZERO); - ctlp->bus_ctlp = malloc(sizeof(ISACONTROLLER_t) * 1, + ctlp->bus_ctlp = kmalloc(sizeof(ISACONTROLLER_t) * 1, M_DEVBUF, M_WAITOK | M_ZERO); ctlp->io_rid[0] = 0; diff --git a/sys/dev/serial/rp/rp_pci.c b/sys/dev/serial/rp/rp_pci.c index cd1d056364..c3f7c2a861 100644 --- a/sys/dev/serial/rp/rp_pci.c +++ b/sys/dev/serial/rp/rp_pci.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/rp/rp_pci.c,v 1.3.2.1 2002/06/18 03:11:46 obrien Exp $ - * $DragonFly: src/sys/dev/serial/rp/rp_pci.c,v 1.6 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/serial/rp/rp_pci.c,v 1.7 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -155,9 +155,9 @@ rp_pciattach(device_t dev) /* The IO ports of AIOPs for a PCI controller are continuous. */ ctlp->io_num = 1; - ctlp->io_rid = malloc(sizeof(*(ctlp->io_rid)) * ctlp->io_num, + ctlp->io_rid = kmalloc(sizeof(*(ctlp->io_rid)) * ctlp->io_num, M_DEVBUF, M_WAITOK | M_ZERO); - ctlp->io = malloc(sizeof(*(ctlp->io)) * ctlp->io_num, + ctlp->io = kmalloc(sizeof(*(ctlp->io)) * ctlp->io_num, M_DEVBUF, M_WAITOK | M_ZERO); ctlp->bus_ctlp = NULL; diff --git a/sys/dev/serial/si/si.c b/sys/dev/serial/si/si.c index b982a8d14b..992b1714fb 100644 --- a/sys/dev/serial/si/si.c +++ b/sys/dev/serial/si/si.c @@ -31,7 +31,7 @@ * NO EVENT SHALL THE AUTHORS BE LIABLE. * * $FreeBSD: src/sys/dev/si/si.c,v 1.101.2.1 2001/02/26 04:23:06 jlemon Exp $ - * $DragonFly: src/sys/dev/serial/si/si.c,v 1.18 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/serial/si/si.c,v 1.19 2006/09/05 03:48:11 dillon Exp $ */ #ifndef lint @@ -509,7 +509,7 @@ try_next: modp = (struct si_module *) (maddr + (unsigned)(modp->sm_next & 0x7fff)); } - sc->sc_ports = malloc(sizeof(struct si_port) * nport, + sc->sc_ports = kmalloc(sizeof(struct si_port) * nport, M_DEVBUF, M_WAITOK | M_ZERO); sc->sc_nport = nport; for (n = 0; n < nport; ++n) { diff --git a/sys/dev/usbmisc/ugen/ugen.c b/sys/dev/usbmisc/ugen/ugen.c index f8b6d70400..bd6a11b4b7 100644 --- a/sys/dev/usbmisc/ugen/ugen.c +++ b/sys/dev/usbmisc/ugen/ugen.c @@ -2,7 +2,7 @@ * $NetBSD: ugen.c,v 1.27 1999/10/28 12:08:38 augustss Exp $ * $NetBSD: ugen.c,v 1.59 2002/07/11 21:14:28 augustss Exp $ * $FreeBSD: src/sys/dev/usb/ugen.c,v 1.81 2003/11/09 09:17:22 tanimura Exp $ - * $DragonFly: src/sys/dev/usbmisc/ugen/ugen.c,v 1.19 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/usbmisc/ugen/ugen.c,v 1.20 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -490,7 +490,7 @@ ugenopen(struct dev_open_args *ap) isize = UGETW(edesc->wMaxPacketSize); if (isize == 0) /* shouldn't happen */ return (EINVAL); - sce->ibuf = malloc(isize * UGEN_NISOFRAMES, + sce->ibuf = kmalloc(isize * UGEN_NISOFRAMES, M_USBDEV, M_WAITOK); sce->cur = sce->fill = sce->ibuf; sce->limit = sce->ibuf + isize * UGEN_NISOFRAMES; diff --git a/sys/dev/usbmisc/ums/ums.c b/sys/dev/usbmisc/ums/ums.c index f0d5d5676f..b633fbd7b2 100644 --- a/sys/dev/usbmisc/ums/ums.c +++ b/sys/dev/usbmisc/ums/ums.c @@ -1,6 +1,6 @@ /* * $FreeBSD: src/sys/dev/usb/ums.c,v 1.64 2003/11/09 09:17:22 tanimura Exp $ - * $DragonFly: src/sys/dev/usbmisc/ums/ums.c,v 1.18 2006/09/05 00:55:44 dillon Exp $ + * $DragonFly: src/sys/dev/usbmisc/ums/ums.c,v 1.19 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -281,7 +281,7 @@ USB_ATTACH(ums) hid_input, &loc_btn, 0)) break; sc->nbuttons = i - 1; - sc->sc_loc_btn = malloc(sizeof(struct hid_location)*sc->nbuttons, + sc->sc_loc_btn = kmalloc(sizeof(struct hid_location)*sc->nbuttons, M_USBDEV, M_INTWAIT); printf("%s: %d buttons%s\n", USBDEVNAME(sc->sc_dev), diff --git a/sys/dev/video/fb/splash.c b/sys/dev/video/fb/splash.c index fa860207c9..47a66324f6 100644 --- a/sys/dev/video/fb/splash.c +++ b/sys/dev/video/fb/splash.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/splash.c,v 1.8 2000/01/29 14:42:57 peter Exp $ - * $DragonFly: src/sys/dev/video/fb/splash.c,v 1.4 2006/09/05 00:55:44 dillon Exp $ + * $DragonFly: src/sys/dev/video/fb/splash.c,v 1.5 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -126,7 +126,7 @@ splash_register(splash_decoder_t *decoder) break; } if ((i >= decoders) && (decoders % DECODER_ARRAY_DELTA) == 0) { - p = malloc(sizeof(*p)*(decoders + DECODER_ARRAY_DELTA), + p = kmalloc(sizeof(*p)*(decoders + DECODER_ARRAY_DELTA), M_DEVBUF, M_NOWAIT); if (p == NULL) return ENOMEM; diff --git a/sys/emulation/linux/linux_util.h b/sys/emulation/linux/linux_util.h index 8981c7b8f9..e199c6ddec 100644 --- a/sys/emulation/linux/linux_util.h +++ b/sys/emulation/linux/linux_util.h @@ -29,7 +29,7 @@ * from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp * from: linux_util.h,v 1.2 1995/03/05 23:23:50 fvdl Exp * $FreeBSD: src/sys/compat/linux/linux_util.h,v 1.12.2.2 2000/11/02 23:31:28 obrien Exp $ - * $DragonFly: src/sys/emulation/linux/linux_util.h,v 1.9 2006/06/05 07:26:09 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_util.h,v 1.10 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -59,7 +59,7 @@ int linux_copyin_path(char *, char **, int); static __inline void linux_free_path(char **kname) { if (*kname) { - free(*kname, M_TEMP); + kfree(*kname, M_TEMP); *kname = NULL; } } diff --git a/sys/emulation/ndis/kern_ndis.c b/sys/emulation/ndis/kern_ndis.c index 6a5dc316d9..6d2c9685fe 100644 --- a/sys/emulation/ndis/kern_ndis.c +++ b/sys/emulation/ndis/kern_ndis.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.57 2004/07/11 00:19:30 wpaul Exp $ - * $DragonFly: src/sys/emulation/ndis/kern_ndis.c,v 1.11 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/emulation/ndis/kern_ndis.c,v 1.12 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -807,7 +807,7 @@ ndis_convert_res(void *arg) SLIST_INIT(&brl_rev); - rl = malloc(sizeof(ndis_resource_list) + + rl = kmalloc(sizeof(ndis_resource_list) + (sizeof(cm_partial_resource_desc) * (sc->ndis_rescnt - 1)), M_DEVBUF, M_WAITOK|M_NULLOK|M_ZERO); @@ -837,7 +837,7 @@ ndis_convert_res(void *arg) * temporary list with the entries in reverse order. */ SLIST_FOREACH(brle, brl, link) { - n = malloc(sizeof(struct resource_list_entry), + n = kmalloc(sizeof(struct resource_list_entry), M_TEMP, M_WAITOK|M_NULLOK); if (n == NULL) { error = ENOMEM; @@ -1175,7 +1175,7 @@ ndis_init_dma(void *arg) sc = arg; - sc->ndis_tmaps = malloc(sizeof(bus_dmamap_t) * sc->ndis_maxpkts, + sc->ndis_tmaps = kmalloc(sizeof(bus_dmamap_t) * sc->ndis_maxpkts, M_DEVBUF, M_WAITOK|M_ZERO); for (i = 0; i < sc->ndis_maxpkts; i++) { diff --git a/sys/emulation/ndis/subr_ndis.c b/sys/emulation/ndis/subr_ndis.c index c0f774c431..4f6bdd4b37 100644 --- a/sys/emulation/ndis/subr_ndis.c +++ b/sys/emulation/ndis/subr_ndis.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.62 2004/07/11 00:19:30 wpaul Exp $ - * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.15 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.16 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -1096,7 +1096,7 @@ ndis_alloc_mapreg(ndis_handle adapter, uint32_t dmachannel, uint8_t dmasize, block = (ndis_miniport_block *)adapter; sc = (struct ndis_softc *)block->nmb_ifp; - sc->ndis_mmaps = malloc(sizeof(bus_dmamap_t) * physmapneeded, + sc->ndis_mmaps = kmalloc(sizeof(bus_dmamap_t) * physmapneeded, M_DEVBUF, M_INTWAIT|M_ZERO); if (sc->ndis_mmaps == NULL) @@ -1418,7 +1418,7 @@ ndis_alloc_packetpool(ndis_status *status, ndis_handle *pool, ndis_packet *cur; int i; - *pool = malloc(sizeof(ndis_packet) * + *pool = kmalloc(sizeof(ndis_packet) * ((descnum + NDIS_POOL_EXTRA) + 1), M_DEVBUF, M_WAITOK|M_ZERO); cur = (ndis_packet *)*pool; @@ -1620,7 +1620,7 @@ ndis_alloc_bufpool(ndis_status *status, ndis_handle *pool, ndis_buffer *cur; int i; - *pool = malloc(sizeof(ndis_buffer) * + *pool = kmalloc(sizeof(ndis_buffer) * ((descnum + NDIS_POOL_EXTRA) + 1), M_DEVBUF, M_WAITOK|M_ZERO); cur = (ndis_buffer *)*pool; diff --git a/sys/emulation/posix4/posix4.h b/sys/emulation/posix4/posix4.h index 3f8d0cdcbe..fd27dfbd65 100644 --- a/sys/emulation/posix4/posix4.h +++ b/sys/emulation/posix4/posix4.h @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/posix4/posix4.h,v 1.6 1999/12/27 10:22:09 bde Exp $ - * $DragonFly: src/sys/emulation/posix4/Attic/posix4.h,v 1.5 2003/11/27 19:11:17 dillon Exp $ + * $DragonFly: src/sys/emulation/posix4/Attic/posix4.h,v 1.6 2006/09/05 03:48:11 dillon Exp $ */ #include "opt_posix.h" @@ -44,8 +44,8 @@ MALLOC_DECLARE(M_P31B); -#define p31b_malloc(SIZE) malloc((SIZE), M_P31B, M_WAITOK) -#define p31b_free(P) free((P), M_P31B) +#define p31b_malloc(SIZE) kmalloc((SIZE), M_P31B, M_WAITOK) +#define p31b_free(P) kfree((P), M_P31B) struct proc; diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index 5df91ffaf1..f6bbee5e38 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -3,7 +3,7 @@ # as much of the source tree as it can. # # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $ -# $DragonFly: src/sys/i386/conf/Attic/LINT,v 1.91 2006/09/03 09:07:20 sephe Exp $ +# $DragonFly: src/sys/i386/conf/Attic/LINT,v 1.92 2006/09/05 03:48:11 dillon Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -65,6 +65,8 @@ makeoptions CONF_CFLAGS=-fno-builtin #Don't allow use of memcmp, etc. #makeoptions INSTALLSTRIPPED=1 #makeoptions INSTALLSTRIPPEDMODULES=1 +options KMALLOC_ONLY + # # Certain applications can grow to be larger than the 128M limit # that FreeBSD initially imposes. Below are some options to diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c index e1e99ddf99..d72b506436 100644 --- a/sys/i386/i386/busdma_machdep.c +++ b/sys/i386/i386/busdma_machdep.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.16.2.2 2003/01/23 00:55:27 scottl Exp $ - * $DragonFly: src/sys/i386/i386/Attic/busdma_machdep.c,v 1.14 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/busdma_machdep.c,v 1.15 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -255,7 +255,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) if (dmat->segments == NULL) { KKASSERT(dmat->nsegments && dmat->nsegments < 16384); - dmat->segments = malloc(sizeof(bus_dma_segment_t) * + dmat->segments = kmalloc(sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, M_INTWAIT); } @@ -342,7 +342,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, if (dmat->segments == NULL) { KKASSERT(dmat->nsegments < 16384); - dmat->segments = malloc(sizeof(bus_dma_segment_t) * + dmat->segments = kmalloc(sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, M_INTWAIT); } diff --git a/sys/i386/i386/i686_mem.c b/sys/i386/i386/i686_mem.c index 4a2de3ec91..0a503e5bf2 100644 --- a/sys/i386/i386/i686_mem.c +++ b/sys/i386/i386/i686_mem.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/i686_mem.c,v 1.8.2.4 2002/09/24 08:12:51 mdodd Exp $ - * $DragonFly: src/sys/i386/i386/Attic/i686_mem.c,v 1.4 2005/08/29 21:08:02 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/i686_mem.c,v 1.5 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -569,7 +569,7 @@ i686_mrinit(struct mem_range_softc *sc) } sc->mr_desc = - (struct mem_range_desc *)malloc(nmdesc * sizeof(struct mem_range_desc), + (struct mem_range_desc *)kmalloc(nmdesc * sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); bzero(sc->mr_desc, nmdesc * sizeof(struct mem_range_desc)); sc->mr_ndesc = nmdesc; diff --git a/sys/i386/i386/k6_mem.c b/sys/i386/i386/k6_mem.c index abaff697c4..48c68238ea 100644 --- a/sys/i386/i386/k6_mem.c +++ b/sys/i386/i386/k6_mem.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/k6_mem.c,v 1.4.2.2 2002/09/16 21:58:41 dwmalone Exp $ - * $DragonFly: src/sys/i386/i386/Attic/k6_mem.c,v 1.5 2005/01/06 08:33:11 asmodai Exp $ + * $DragonFly: src/sys/i386/i386/Attic/k6_mem.c,v 1.6 2006/09/05 03:48:11 dillon Exp $ * */ @@ -108,7 +108,7 @@ k6_mrinit(struct mem_range_softc *sc) { sc->mr_cap = 0; sc->mr_ndesc = 2; /* XXX (BFF) For now, we only have one msr for this */ - sc->mr_desc = malloc(sc->mr_ndesc * sizeof(struct mem_range_desc), + sc->mr_desc = kmalloc(sc->mr_ndesc * sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); if (sc->mr_desc == NULL) panic("k6_mrinit: malloc returns NULL"); diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c index c5677a2a72..9f72844437 100644 --- a/sys/i386/i386/mem.c +++ b/sys/i386/i386/mem.c @@ -39,7 +39,7 @@ * from: Utah $Hdr: mem.c 1.13 89/10/08$ * from: @(#)mem.c 7.2 (Berkeley) 5/9/91 * $FreeBSD: src/sys/i386/i386/mem.c,v 1.79.2.9 2003/01/04 22:58:01 njl Exp $ - * $DragonFly: src/sys/i386/i386/Attic/mem.c,v 1.18 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/mem.c,v 1.19 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -392,7 +392,7 @@ mem_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct ucred *cred) nd = imin(mo->mo_arg[0], mem_range_softc.mr_ndesc); if (nd > 0) { md = (struct mem_range_desc *) - malloc(nd * sizeof(struct mem_range_desc), + kmalloc(nd * sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); error = mem_range_attr_get(md, &nd); if (!error) @@ -406,7 +406,7 @@ mem_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct ucred *cred) break; case MEMRANGE_SET: - md = (struct mem_range_desc *)malloc(sizeof(struct mem_range_desc), + md = (struct mem_range_desc *)kmalloc(sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); error = copyin(mo->mo_desc, md, sizeof(struct mem_range_desc)); /* clamp description string */ diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 722c8337ab..fa69c4a8e1 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -70,7 +70,7 @@ * * @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94 * $FreeBSD: src/sys/kern/kern_descrip.c,v 1.81.2.19 2004/02/28 00:43:31 tegge Exp $ - * $DragonFly: src/sys/kern/kern_descrip.c,v 1.72 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/kern_descrip.c,v 1.73 2006/09/05 03:48:12 dillon Exp $ */ #include "opt_compat.h" @@ -1543,7 +1543,7 @@ again: ni = (i - 1) / 2; } spin_unlock_rd(&fdp->fd_spin); - newfdp->fd_files = malloc(i * sizeof(struct fdnode), + newfdp->fd_files = kmalloc(i * sizeof(struct fdnode), M_FILEDESC, M_WAITOK | M_ZERO); /* @@ -2286,7 +2286,7 @@ filedesc_to_leader_alloc(struct filedesc_to_leader *old, { struct filedesc_to_leader *fdtol; - fdtol = malloc(sizeof(struct filedesc_to_leader), + fdtol = kmalloc(sizeof(struct filedesc_to_leader), M_FILEDESC_TO_LEADER, M_WAITOK); fdtol->fdl_refcount = 1; fdtol->fdl_holdcount = 0; diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c index cde41a10e7..6f17507320 100644 --- a/sys/kern/kern_ktr.c +++ b/sys/kern/kern_ktr.c @@ -62,7 +62,7 @@ * SUCH DAMAGE. */ /* - * $DragonFly: src/sys/kern/kern_ktr.c,v 1.16 2006/05/29 07:18:04 dillon Exp $ + * $DragonFly: src/sys/kern/kern_ktr.c,v 1.17 2006/09/05 03:48:12 dillon Exp $ */ /* * Kernel tracepoint facility. @@ -186,7 +186,7 @@ ktr_sysinit(void *dummy) int i; for(i = 1; i < ncpus; ++i) { - ktr_buf[i] = malloc(KTR_ENTRIES * sizeof(struct ktr_entry), + ktr_buf[i] = kmalloc(KTR_ENTRIES * sizeof(struct ktr_entry), M_KTR, M_WAITOK | M_ZERO); } } diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index e8874b6c62..a7ec7060a2 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_linker.c,v 1.41.2.3 2001/11/21 17:50:35 luigi Exp $ - * $DragonFly: src/sys/kern/kern_linker.c,v 1.29 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/kern_linker.c,v 1.30 2006/09/05 03:48:12 dillon Exp $ */ #include "opt_ddb.h" @@ -495,7 +495,7 @@ linker_file_add_dependancy(linker_file_t file, linker_file_t dep) { linker_file_t* newdeps; - newdeps = malloc((file->ndeps + 1) * sizeof(linker_file_t*), + newdeps = kmalloc((file->ndeps + 1) * sizeof(linker_file_t*), M_LINKER, M_WAITOK); if (newdeps == NULL) return ENOMEM; @@ -601,7 +601,7 @@ linker_file_lookup_symbol(linker_file_t file, const char* name, int deps, caddr_ * Round the symbol size up to align. */ common_size = (common_size + sizeof(int) - 1) & -sizeof(int); - cp = malloc(sizeof(struct common_symbol) + cp = kmalloc(sizeof(struct common_symbol) + common_size + strlen(name) + 1, M_LINKER, M_WAITOK); diff --git a/sys/kern/kern_memio.c b/sys/kern/kern_memio.c index fa9d0600d6..afafe32b88 100644 --- a/sys/kern/kern_memio.c +++ b/sys/kern/kern_memio.c @@ -39,7 +39,7 @@ * from: Utah $Hdr: mem.c 1.13 89/10/08$ * from: @(#)mem.c 7.2 (Berkeley) 5/9/91 * $FreeBSD: src/sys/i386/i386/mem.c,v 1.79.2.9 2003/01/04 22:58:01 njl Exp $ - * $DragonFly: src/sys/kern/kern_memio.c,v 1.18 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/kern_memio.c,v 1.19 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -392,7 +392,7 @@ mem_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct ucred *cred) nd = imin(mo->mo_arg[0], mem_range_softc.mr_ndesc); if (nd > 0) { md = (struct mem_range_desc *) - malloc(nd * sizeof(struct mem_range_desc), + kmalloc(nd * sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); error = mem_range_attr_get(md, &nd); if (!error) @@ -406,7 +406,7 @@ mem_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct ucred *cred) break; case MEMRANGE_SET: - md = (struct mem_range_desc *)malloc(sizeof(struct mem_range_desc), + md = (struct mem_range_desc *)kmalloc(sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); error = copyin(mo->mo_desc, md, sizeof(struct mem_range_desc)); /* clamp description string */ diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c index 45e716faf8..eb752d3199 100644 --- a/sys/kern/kern_module.c +++ b/sys/kern/kern_module.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_module.c,v 1.21 1999/11/08 06:53:30 peter Exp $ - * $DragonFly: src/sys/kern/kern_module.c,v 1.11 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/kern_module.c,v 1.12 2006/09/05 03:48:12 dillon Exp $ */ #include @@ -128,7 +128,7 @@ module_register(const moduledata_t *data, linker_file_t container) return EEXIST; } namelen = strlen(data->name) + 1; - newmod = (module_t) malloc(sizeof(struct module) + namelen, + newmod = (module_t) kmalloc(sizeof(struct module) + namelen, M_MODULE, M_WAITOK); if (newmod == 0) return ENOMEM; diff --git a/sys/kern/kern_objcache.c b/sys/kern/kern_objcache.c index 55a8e5a2d2..ca8ff9da42 100644 --- a/sys/kern/kern_objcache.c +++ b/sys/kern/kern_objcache.c @@ -29,7 +29,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/kern_objcache.c,v 1.10 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/kern_objcache.c,v 1.11 2006/09/05 03:48:12 dillon Exp $ */ #include @@ -142,7 +142,7 @@ mag_alloc(int capacity) { struct magazine *mag; - mag = malloc(__offsetof(struct magazine, objects[capacity]), + mag = kmalloc(__offsetof(struct magazine, objects[capacity]), M_OBJMAG, M_INTWAIT | M_ZERO); mag->capacity = capacity; mag->rounds = 0; @@ -164,7 +164,7 @@ objcache_create(const char *name, int cluster_limit, int mag_capacity, int cpuid; /* allocate object cache structure */ - oc = malloc(__offsetof(struct objcache, cache_percpu[ncpus]), + oc = kmalloc(__offsetof(struct objcache, cache_percpu[ncpus]), M_OBJCACHE, M_WAITOK | M_ZERO); oc->name = kstrdup(name, M_TEMP); oc->ctor = ctor; diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index ce54bbb08a..8a0c604ad7 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -37,7 +37,7 @@ * * @(#)kern_synch.c 8.9 (Berkeley) 5/19/95 * $FreeBSD: src/sys/kern/kern_synch.c,v 1.87.2.6 2002/10/13 07:29:53 kbyanc Exp $ - * $DragonFly: src/sys/kern/kern_synch.c,v 1.66 2006/09/03 18:52:28 dillon Exp $ + * $DragonFly: src/sys/kern/kern_synch.c,v 1.67 2006/09/05 03:48:12 dillon Exp $ */ #include "opt_ktrace.h" @@ -299,7 +299,7 @@ sleep_gdinit(globaldata_t gd) gd->gd_tsleep_hash = slpque_cpu0; } else { - gd->gd_tsleep_hash = malloc(sizeof(slpque_cpu0), + gd->gd_tsleep_hash = kmalloc(sizeof(slpque_cpu0), M_TSLEEP, M_WAITOK | M_ZERO); } for (i = 0; i < TABLESIZE; ++i) diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 0b42fa988d..2423217b4d 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -70,7 +70,7 @@ * * From: @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/kern_timeout.c,v 1.59.2.1 2001/11/13 18:24:52 archie Exp $ - * $DragonFly: src/sys/kern/kern_timeout.c,v 1.21 2005/12/20 19:09:33 dillon Exp $ + * $DragonFly: src/sys/kern/kern_timeout.c,v 1.22 2006/09/05 03:48:12 dillon Exp $ */ /* * DRAGONFLY BGL STATUS @@ -165,7 +165,7 @@ swi_softclock_setup(void *arg) sc = &softclock_pcpu_ary[cpu]; - sc->callwheel = malloc(sizeof(*sc->callwheel) * callwheelsize, + sc->callwheel = kmalloc(sizeof(*sc->callwheel) * callwheelsize, M_CALLOUT, M_WAITOK|M_ZERO); for (i = 0; i < callwheelsize; ++i) TAILQ_INIT(&sc->callwheel[i]); diff --git a/sys/kern/link_aout.c b/sys/kern/link_aout.c index 6ccb9a0650..bc223e57fd 100644 --- a/sys/kern/link_aout.c +++ b/sys/kern/link_aout.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/link_aout.c,v 1.26 1999/12/24 15:33:36 bde Exp $ - * $DragonFly: src/sys/kern/link_aout.c,v 1.19 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/link_aout.c,v 1.20 2006/09/05 03:48:12 dillon Exp $ */ #define FREEBSD_AOUT 1 @@ -244,7 +244,7 @@ link_aout_load_file(const char* filename, linker_file_t* result) */ af = kmalloc(sizeof(struct aout_file), M_LINKER, M_WAITOK); bzero(af, sizeof(*af)); - af->address = malloc(header.a_text + header.a_data + header.a_bss, + af->address = kmalloc(header.a_text + header.a_data + header.a_bss, M_LINKER, M_WAITOK); /* diff --git a/sys/kern/lwkt_caps.c b/sys/kern/lwkt_caps.c index 65c9a90422..849d6d49bf 100644 --- a/sys/kern/lwkt_caps.c +++ b/sys/kern/lwkt_caps.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/lwkt_caps.c,v 1.8 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/lwkt_caps.c,v 1.9 2006/09/05 03:48:12 dillon Exp $ */ /* @@ -167,7 +167,7 @@ caps_alloc(thread_t td, const char *name, int len, uid_t uid, gid_t gid, caps_kinfo_t caps; caps_kinfo_t ctmp; - caps = malloc(offsetof(struct caps_kinfo, ci_name[len+1]), + caps = kmalloc(offsetof(struct caps_kinfo, ci_name[len+1]), M_CAPS, M_WAITOK|M_ZERO); TAILQ_INIT(&caps->ci_msgpendq); TAILQ_INIT(&caps->ci_msguserq); diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index e5ae8dd853..76f989e904 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_bus.c,v 1.54.2.9 2002/10/10 15:13:32 jhb Exp $ - * $DragonFly: src/sys/kern/subr_bus.c,v 1.30 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/subr_bus.c,v 1.31 2006/09/05 03:48:12 dillon Exp $ */ #include "opt_bus.h" @@ -122,7 +122,7 @@ devclass_find_internal(const char *classname, const char *parentname, if (create && !dc) { PDEBUG(("creating %s", classname)); - dc = malloc(sizeof(struct devclass) + strlen(classname) + 1, + dc = kmalloc(sizeof(struct devclass) + strlen(classname) + 1, M_BUS, M_INTWAIT | M_ZERO); if (!dc) return(NULL); @@ -1609,7 +1609,7 @@ resource_cfgload(void *dummy __unused) if (res->u.stringval) kfree(res->u.stringval, M_TEMP); stringval = cfgres[j].u.stringval; - res->u.stringval = malloc(strlen(stringval) + 1, + res->u.stringval = kmalloc(strlen(stringval) + 1, M_TEMP, M_INTWAIT); if (res->u.stringval == NULL) break; diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index af8edf3a8a..6b93c884ea 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -44,7 +44,7 @@ * from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 * from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $ * $FreeBSD: src/sys/kern/subr_diskslice.c,v 1.82.2.6 2001/07/24 09:49:41 dd Exp $ - * $DragonFly: src/sys/kern/subr_diskslice.c,v 1.22 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/subr_diskslice.c,v 1.23 2006/09/05 03:48:12 dillon Exp $ */ #include @@ -600,7 +600,7 @@ dsmakeslicestruct(int nslices, struct disklabel *lp) struct diskslice *sp; struct diskslices *ssp; - ssp = malloc(offsetof(struct diskslices, dss_slices) + + ssp = kmalloc(offsetof(struct diskslices, dss_slices) + nslices * sizeof *sp, M_DEVBUF, M_WAITOK); ssp->dss_first_bsd_slice = COMPATIBILITY_SLICE; ssp->dss_nslices = nslices; diff --git a/sys/kern/subr_eventhandler.c b/sys/kern/subr_eventhandler.c index dfa3aa5675..fa9c4849fa 100644 --- a/sys/kern/subr_eventhandler.c +++ b/sys/kern/subr_eventhandler.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_eventhandler.c,v 1.3 1999/11/16 16:28:57 phk Exp $ - * $DragonFly: src/sys/kern/subr_eventhandler.c,v 1.4 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/subr_eventhandler.c,v 1.5 2006/09/05 03:48:12 dillon Exp $ */ #include @@ -69,7 +69,7 @@ eventhandler_register(struct eventhandler_list *list, char *name, /* Do we need to create the list? */ if (list == NULL) { - list = malloc(sizeof(struct eventhandler_list) + strlen(name) + 1, + list = kmalloc(sizeof(struct eventhandler_list) + strlen(name) + 1, M_EVENTHANDLER, M_INTWAIT); list->el_flags = 0; list->el_name = (char *)list + sizeof(struct eventhandler_list); @@ -83,7 +83,7 @@ eventhandler_register(struct eventhandler_list *list, char *name, } /* allocate an entry for this handler, populate it */ - eg = malloc(sizeof(struct eventhandler_entry_generic), + eg = kmalloc(sizeof(struct eventhandler_entry_generic), M_EVENTHANDLER, M_INTWAIT); eg->func = func; eg->ee.ee_arg = arg; diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index a038a3dfd8..a6fb8262fe 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_rman.c,v 1.10.2.1 2001/06/05 08:06:08 imp Exp $ - * $DragonFly: src/sys/kern/subr_rman.c,v 1.8 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/subr_rman.c,v 1.9 2006/09/05 03:48:12 dillon Exp $ */ /* @@ -364,7 +364,7 @@ rman_reserve_resource(struct rman *rm, u_long start, u_long end, u_long count, rv->r_dev = dev; rv->r_rm = rm; if (s->r_sharehead == 0) { - s->r_sharehead = malloc(sizeof *s->r_sharehead, + s->r_sharehead = kmalloc(sizeof *s->r_sharehead, M_RMAN, M_NOWAIT); if (s->r_sharehead == 0) { kfree(rv, M_RMAN); diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index c508687cd6..cd5d3c0b96 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -34,7 +34,7 @@ * * @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94 * $FreeBSD: src/sys/kern/vfs_cluster.c,v 1.92.2.9 2001/11/18 07:10:59 dillon Exp $ - * $DragonFly: src/sys/kern/vfs_cluster.c,v 1.27 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_cluster.c,v 1.28 2006/09/05 03:48:12 dillon Exp $ */ #include "opt_debug_cluster.h" @@ -955,7 +955,7 @@ cluster_collectbufs(struct vnode *vp, struct buf *last_bp, int lblocksize) int i, len; len = (int)(vp->v_lastw - vp->v_cstart + lblocksize) / lblocksize; - buflist = malloc(sizeof(struct buf *) * (len + 1) + sizeof(*buflist), + buflist = kmalloc(sizeof(struct buf *) * (len + 1) + sizeof(*buflist), M_SEGMENT, M_WAITOK); buflist->bs_nchildren = 0; buflist->bs_children = (struct buf **) (buflist + 1); diff --git a/sys/kern/vfs_jops.c b/sys/kern/vfs_jops.c index ddd3d33990..a1805db8a6 100644 --- a/sys/kern/vfs_jops.c +++ b/sys/kern/vfs_jops.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/vfs_jops.c,v 1.29 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_jops.c,v 1.30 2006/09/05 03:48:12 dillon Exp $ */ /* * Each mount point may have zero or more independantly configured journals @@ -855,7 +855,7 @@ journal_write(struct vop_write_args *ap) uio_one_iovec = ap->a_uio->uio_iov[0]; uio_copy.uio_iov = &uio_one_iovec; } else { - uio_copy.uio_iov = malloc(uio_copy.uio_iovcnt * sizeof(struct iovec), + uio_copy.uio_iov = kmalloc(uio_copy.uio_iovcnt * sizeof(struct iovec), M_JOURNAL, M_WAITOK); bcopy(ap->a_uio->uio_iov, uio_copy.uio_iov, uio_copy.uio_iovcnt * sizeof(struct iovec)); diff --git a/sys/net/bridge/if_bridge.c b/sys/net/bridge/if_bridge.c index f73879ab1d..4b1d9a3607 100644 --- a/sys/net/bridge/if_bridge.c +++ b/sys/net/bridge/if_bridge.c @@ -66,7 +66,7 @@ * $OpenBSD: if_bridge.c,v 1.60 2001/06/15 03:38:33 itojun Exp $ * $NetBSD: if_bridge.c,v 1.31 2005/06/01 19:45:34 jdc Exp $ * $FreeBSD: src/sys/net/if_bridge.c,v 1.26 2005/10/13 23:05:55 thompsa Exp $ - * $DragonFly: src/sys/net/bridge/if_bridge.c,v 1.9 2006/09/05 00:55:47 dillon Exp $ + * $DragonFly: src/sys/net/bridge/if_bridge.c,v 1.10 2006/09/05 03:48:12 dillon Exp $ */ /* @@ -2184,7 +2184,7 @@ bridge_rtable_init(struct bridge_softc *sc) { int i; - sc->sc_rthash = malloc(sizeof(*sc->sc_rthash) * BRIDGE_RTHASH_SIZE, + sc->sc_rthash = kmalloc(sizeof(*sc->sc_rthash) * BRIDGE_RTHASH_SIZE, M_DEVBUF, M_WAITOK); for (i = 0; i < BRIDGE_RTHASH_SIZE; i++) diff --git a/sys/net/dummynet/ip_dummynet.c b/sys/net/dummynet/ip_dummynet.c index 97eb7b6d4a..86891297cf 100644 --- a/sys/net/dummynet/ip_dummynet.c +++ b/sys/net/dummynet/ip_dummynet.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netinet/ip_dummynet.c,v 1.24.2.22 2003/05/13 09:31:06 maxim Exp $ - * $DragonFly: src/sys/net/dummynet/ip_dummynet.c,v 1.20 2006/09/05 00:55:47 dillon Exp $ + * $DragonFly: src/sys/net/dummynet/ip_dummynet.c,v 1.21 2006/09/05 03:48:12 dillon Exp $ */ #if !defined(KLD_MODULE) @@ -1414,7 +1414,7 @@ config_red(struct dn_flow_set *p, struct dn_flow_set * x) return EINVAL; } x->lookup_depth = red_lookup_depth; - x->w_q_lookup = malloc(x->lookup_depth * sizeof(int), + x->w_q_lookup = kmalloc(x->lookup_depth * sizeof(int), M_DUMMYNET, M_WAITOK); /* fill the lookup table with (1 - w_q)^x */ @@ -1447,7 +1447,7 @@ alloc_hash(struct dn_flow_set *x, struct dn_flow_set *pfs) x->rq_size = l; } else /* one is enough for null mask */ x->rq_size = 1; - x->rq = malloc((1 + x->rq_size) * sizeof(struct dn_flow_queue *), + x->rq = kmalloc((1 + x->rq_size) * sizeof(struct dn_flow_queue *), M_DUMMYNET, M_WAITOK | M_ZERO); x->rq_elements = 0; return 0 ; diff --git a/sys/net/ef/if_ef.c b/sys/net/ef/if_ef.c index 498fe24648..bf3210a657 100644 --- a/sys/net/ef/if_ef.c +++ b/sys/net/ef/if_ef.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/net/if_ef.c,v 1.2.2.4 2001/02/22 09:27:04 bp Exp $ - * $DragonFly: src/sys/net/ef/if_ef.c,v 1.19 2006/09/05 00:55:47 dillon Exp $ + * $DragonFly: src/sys/net/ef/if_ef.c,v 1.20 2006/09/05 03:48:12 dillon Exp $ */ #include "opt_inet.h" @@ -507,7 +507,7 @@ ef_load(void) TAILQ_FOREACH(ifp, &ifnet, if_link) { if (ifp->if_type != IFT_ETHER) continue; EFDEBUG("Found interface %s\n", ifp->if_xname); - efl = (struct ef_link*)malloc(sizeof(struct ef_link), + efl = (struct ef_link*)kmalloc(sizeof(struct ef_link), M_IFADDR, M_WAITOK); if (efl == NULL) { error = ENOMEM; diff --git a/sys/net/i4b/layer4/i4b_i4bdrv.c b/sys/net/i4b/layer4/i4b_i4bdrv.c index 477f111c25..5a372603aa 100644 --- a/sys/net/i4b/layer4/i4b_i4bdrv.c +++ b/sys/net/i4b/layer4/i4b_i4bdrv.c @@ -28,7 +28,7 @@ * -------------------------------------------- * * $FreeBSD: src/sys/i4b/layer4/i4b_i4bdrv.c,v 1.11.2.5 2001/12/16 15:12:59 hm Exp $ - * $DragonFly: src/sys/net/i4b/layer4/i4b_i4bdrv.c,v 1.16 2006/09/05 00:55:47 dillon Exp $ + * $DragonFly: src/sys/net/i4b/layer4/i4b_i4bdrv.c,v 1.17 2006/09/05 03:48:12 dillon Exp $ * * last edit-date: [Sat Aug 11 18:08:10 2001] * @@ -636,10 +636,10 @@ i4bioctl(struct dev_ioctl_args *ap) goto download_done; } - prots = malloc(r->numprotos * sizeof(struct isdn_dr_prot), + prots = kmalloc(r->numprotos * sizeof(struct isdn_dr_prot), M_DEVBUF, M_WAITOK); - prots2 = malloc(r->numprotos * sizeof(struct isdn_dr_prot), + prots2 = kmalloc(r->numprotos * sizeof(struct isdn_dr_prot), M_DEVBUF, M_WAITOK); if(!prots || !prots2) diff --git a/sys/net/if_media.c b/sys/net/if_media.c index 3287fd925b..342f22a1f8 100644 --- a/sys/net/if_media.c +++ b/sys/net/if_media.c @@ -1,6 +1,6 @@ /* $NetBSD: if_media.c,v 1.1 1997/03/17 02:55:15 thorpej Exp $ */ /* $FreeBSD: src/sys/net/if_media.c,v 1.9.2.4 2001/07/04 00:12:38 brooks Exp $ */ -/* $DragonFly: src/sys/net/if_media.c,v 1.10 2006/09/05 00:55:46 dillon Exp $ */ +/* $DragonFly: src/sys/net/if_media.c,v 1.11 2006/09/05 03:48:12 dillon Exp $ */ /* * Copyright (c) 1997 @@ -286,7 +286,7 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, return (EINVAL); if (ifmr->ifm_count != 0) { - kptr = (int *)malloc(ifmr->ifm_count * sizeof(int), + kptr = (int *)kmalloc(ifmr->ifm_count * sizeof(int), M_TEMP, M_WAITOK); /* diff --git a/sys/net/ipfw/ip_fw.c b/sys/net/ipfw/ip_fw.c index 8a885edb83..8fb5ef1c2a 100644 --- a/sys/net/ipfw/ip_fw.c +++ b/sys/net/ipfw/ip_fw.c @@ -14,7 +14,7 @@ * This software is provided ``AS IS'' without any warranties of any kind. * * $FreeBSD: src/sys/netinet/ip_fw.c,v 1.131.2.39 2003/01/20 02:23:07 iedowse Exp $ - * $DragonFly: src/sys/net/ipfw/Attic/ip_fw.c,v 1.18 2006/09/05 00:55:47 dillon Exp $ + * $DragonFly: src/sys/net/ipfw/Attic/ip_fw.c,v 1.19 2006/09/05 03:48:12 dillon Exp $ */ #define DEB(x) @@ -850,7 +850,7 @@ add_dyn_rule(struct ipfw_flow_id *id, u_int8_t dyn_type, struct ip_fw *rule) curr_dyn_buckets = dyn_buckets ; if (ipfw_dyn_v != NULL) kfree(ipfw_dyn_v, M_IPFW); - ipfw_dyn_v = malloc(curr_dyn_buckets * sizeof r, + ipfw_dyn_v = kmalloc(curr_dyn_buckets * sizeof r, M_IPFW, M_WAITOK | M_ZERO); if (ipfw_dyn_v == NULL) return NULL; /* failed ! */ diff --git a/sys/net/ipfw/ip_fw2.c b/sys/net/ipfw/ip_fw2.c index b7f845b244..672c7a8434 100644 --- a/sys/net/ipfw/ip_fw2.c +++ b/sys/net/ipfw/ip_fw2.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netinet/ip_fw2.c,v 1.6.2.12 2003/04/08 10:42:32 maxim Exp $ - * $DragonFly: src/sys/net/ipfw/ip_fw2.c,v 1.21 2006/09/05 00:55:47 dillon Exp $ + * $DragonFly: src/sys/net/ipfw/ip_fw2.c,v 1.22 2006/09/05 03:48:12 dillon Exp $ */ #define DEB(x) @@ -839,7 +839,7 @@ realloc_dynamic_table(void) if (ipfw_dyn_v != NULL) kfree(ipfw_dyn_v, M_IPFW); for (;;) { - ipfw_dyn_v = malloc(curr_dyn_buckets * sizeof(ipfw_dyn_rule *), + ipfw_dyn_v = kmalloc(curr_dyn_buckets * sizeof(ipfw_dyn_rule *), M_IPFW, M_WAITOK | M_ZERO); if (ipfw_dyn_v != NULL || curr_dyn_buckets <= 2) break; diff --git a/sys/net/pf/pf_if.c b/sys/net/pf/pf_if.c index 173bb744d2..0c996a02c0 100644 --- a/sys/net/pf/pf_if.c +++ b/sys/net/pf/pf_if.c @@ -1,7 +1,7 @@ /* $FreeBSD: src/sys/contrib/pf/net/pf_if.c,v 1.6 2004/09/14 15:20:24 mlaier Exp $ */ /* $OpenBSD: pf_if.c,v 1.11 2004/03/15 11:38:23 cedric Exp $ */ /* add $OpenBSD: pf_if.c,v 1.19 2004/08/11 12:06:44 henning Exp $ */ -/* $DragonFly: src/sys/net/pf/pf_if.c,v 1.5 2006/09/05 00:55:47 dillon Exp $ */ +/* $DragonFly: src/sys/net/pf/pf_if.c,v 1.6 2006/09/05 03:48:12 dillon Exp $ */ /* * Copyright (c) 2004 The DragonFly Project. All rights reserved. @@ -132,7 +132,7 @@ pfi_initialize(void) TAILQ_INIT(&pfi_statehead); pfi_buffer_max = 64; - pfi_buffer = malloc(pfi_buffer_max * sizeof(*pfi_buffer), + pfi_buffer = kmalloc(pfi_buffer_max * sizeof(*pfi_buffer), PFI_MTYPE, M_WAITOK); pfi_self = pfi_if_create("self", NULL, PFI_IFLAG_GROUP); pfi_dynamic_drivers(); diff --git a/sys/net/pf/pf_ioctl.c b/sys/net/pf/pf_ioctl.c index 8826b7e742..00c058d79c 100644 --- a/sys/net/pf/pf_ioctl.c +++ b/sys/net/pf/pf_ioctl.c @@ -1,6 +1,6 @@ /* $FreeBSD: src/sys/contrib/pf/net/pf_ioctl.c,v 1.12 2004/08/12 14:15:42 mlaier Exp $ */ /* $OpenBSD: pf_ioctl.c,v 1.112.2.2 2004/07/24 18:28:12 brad Exp $ */ -/* $DragonFly: src/sys/net/pf/pf_ioctl.c,v 1.8 2006/09/05 00:55:47 dillon Exp $ */ +/* $DragonFly: src/sys/net/pf/pf_ioctl.c,v 1.9 2006/09/05 03:48:12 dillon Exp $ */ /* * Copyright (c) 2004 The DragonFly Project. All rights reserved. @@ -451,7 +451,7 @@ pf_find_or_create_ruleset(char anchorname[PF_ANCHOR_NAME_SIZE], if (a != NULL && !strcmp(a->name, anchorname)) anchor = a; else { - anchor = (struct pf_anchor *)malloc(sizeof(struct pf_anchor), + anchor = (struct pf_anchor *)kmalloc(sizeof(struct pf_anchor), M_TEMP, M_NOWAIT); if (anchor == NULL) return (NULL); @@ -468,7 +468,7 @@ pf_find_or_create_ruleset(char anchorname[PF_ANCHOR_NAME_SIZE], r = TAILQ_NEXT(r, entries); if (r != NULL && !strcmp(r->name, rulesetname)) return (r); - ruleset = (struct pf_ruleset *)malloc(sizeof(struct pf_ruleset), + ruleset = (struct pf_ruleset *)kmalloc(sizeof(struct pf_ruleset), M_TEMP, M_NOWAIT); if (ruleset != NULL) { pf_init_ruleset(ruleset); @@ -600,7 +600,7 @@ tagname2tag(struct pf_tags *head, char *tagname) return (0); /* allocate and fill new struct pf_tagname */ - tag = (struct pf_tagname *)malloc(sizeof(struct pf_tagname), + tag = (struct pf_tagname *)kmalloc(sizeof(struct pf_tagname), M_TEMP, M_NOWAIT); if (tag == NULL) return (0); diff --git a/sys/net/radix.h b/sys/net/radix.h index 48db7d3d84..4346799251 100644 --- a/sys/net/radix.h +++ b/sys/net/radix.h @@ -32,7 +32,7 @@ * * @(#)radix.h 8.2 (Berkeley) 10/31/94 * $FreeBSD: src/sys/net/radix.h,v 1.16.2.1 2000/05/03 19:17:11 wollman Exp $ - * $DragonFly: src/sys/net/radix.h,v 1.11 2006/05/21 03:43:45 dillon Exp $ + * $DragonFly: src/sys/net/radix.h,v 1.12 2006/09/05 03:48:12 dillon Exp $ */ #ifndef _NET_RADIX_H_ @@ -164,8 +164,8 @@ struct radix_node_head { #define R_Malloc(p, t, n) (p = (t) malloc((n))) #define Free(p) free(p); #else -#define R_Malloc(p, t, n) (p = (t) malloc((n), M_RTABLE, M_INTWAIT | M_NULLOK)) -#define Free(p) free(p, M_RTABLE); +#define R_Malloc(p, t, n) (p = (t) kmalloc((n), M_RTABLE, M_INTWAIT | M_NULLOK)) +#define Free(p) kfree(p, M_RTABLE); #endif void rn_init (void); diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 58cf4476ea..eb5818035b 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -82,7 +82,7 @@ * * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 * $FreeBSD: src/sys/netinet/tcp_subr.c,v 1.73.2.31 2003/01/24 05:11:34 sam Exp $ - * $DragonFly: src/sys/netinet/tcp_subr.c,v 1.52 2006/09/05 00:55:48 dillon Exp $ + * $DragonFly: src/sys/netinet/tcp_subr.c,v 1.53 2006/09/05 03:48:12 dillon Exp $ */ #include "opt_compat.h" @@ -958,7 +958,7 @@ no_valid_rt: struct netmsg_remwildcard *msg; cpu = (inp->inp_pcbinfo->cpu + 1) % ncpus2; - msg = malloc(sizeof(struct netmsg_remwildcard), + msg = kmalloc(sizeof(struct netmsg_remwildcard), M_LWKTMSG, M_INTWAIT); lwkt_initmsg(&msg->nm_lmsg, &netisr_afree_rport, 0, lwkt_cmd_func(in_pcbremwildcardhash_handler), @@ -1047,7 +1047,7 @@ tcp_drain(void) if (cpu == mycpu->gd_cpuid) { tcp_drain_oncpu(&tcbinfo[cpu].pcblisthead); } else { - msg = malloc(sizeof(struct netmsg_tcp_drain), + msg = kmalloc(sizeof(struct netmsg_tcp_drain), M_LWKTMSG, M_NOWAIT); if (msg == NULL) continue; diff --git a/sys/netinet6/ah_core.c b/sys/netinet6/ah_core.c index 62c4572257..9db5cc5d77 100644 --- a/sys/netinet6/ah_core.c +++ b/sys/netinet6/ah_core.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/ah_core.c,v 1.2.2.5 2002/04/28 05:40:26 suz Exp $ */ -/* $DragonFly: src/sys/netinet6/ah_core.c,v 1.7 2006/09/05 00:55:48 dillon Exp $ */ +/* $DragonFly: src/sys/netinet6/ah_core.c,v 1.8 2006/09/05 03:48:12 dillon Exp $ */ /* $KAME: ah_core.c,v 1.44 2001/03/12 11:24:39 itojun Exp $ */ /* @@ -609,7 +609,7 @@ ah_hmac_sha1_init(struct ah_algorithm_state *state, struct secasvar *sav) panic("ah_hmac_sha1_init: what?"); state->sav = sav; - state->foo = (void *)malloc(64 + 64 + sizeof(SHA1_CTX), + state->foo = (void *)kmalloc(64 + 64 + sizeof(SHA1_CTX), M_TEMP, M_NOWAIT); if (!state->foo) return ENOBUFS; @@ -729,7 +729,7 @@ ah_hmac_sha2_256_init(struct ah_algorithm_state *state, struct secasvar *sav) panic("ah_hmac_sha2_256_init: what?"); state->sav = sav; - state->foo = (void *)malloc(64 + 64 + sizeof(SHA256_CTX), + state->foo = (void *)kmalloc(64 + 64 + sizeof(SHA256_CTX), M_TEMP, M_NOWAIT); if (!state->foo) return ENOBUFS; @@ -854,7 +854,7 @@ ah_hmac_sha2_384_init(struct ah_algorithm_state *state, struct secasvar *sav) panic("ah_hmac_sha2_384_init: what?"); state->sav = sav; - state->foo = (void *)malloc(64 + 64 + sizeof(SHA384_CTX), + state->foo = (void *)kmalloc(64 + 64 + sizeof(SHA384_CTX), M_TEMP, M_NOWAIT); if (!state->foo) return ENOBUFS; @@ -980,7 +980,7 @@ ah_hmac_sha2_512_init(struct ah_algorithm_state *state, struct secasvar *sav) panic("ah_hmac_sha2_512_init: what?"); state->sav = sav; - state->foo = (void *)malloc(64 + 64 + sizeof(SHA512_CTX), + state->foo = (void *)kmalloc(64 + 64 + sizeof(SHA512_CTX), M_TEMP, M_NOWAIT); if (!state->foo) return ENOBUFS; diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index ac4c8a8aea..d253943f15 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/in6.c,v 1.7.2.9 2002/04/28 05:40:26 suz Exp $ */ -/* $DragonFly: src/sys/netinet6/in6.c,v 1.20 2006/09/05 00:55:48 dillon Exp $ */ +/* $DragonFly: src/sys/netinet6/in6.c,v 1.21 2006/09/05 03:48:12 dillon Exp $ */ /* $KAME: in6.c,v 1.259 2002/01/21 11:37:50 keiichi Exp $ */ /* @@ -2357,12 +2357,12 @@ in6_domifattach(struct ifnet *ifp) ext = (struct in6_ifextra *)kmalloc(sizeof(*ext), M_IFADDR, M_WAITOK); bzero(ext, sizeof(*ext)); - ext->in6_ifstat = (struct in6_ifstat *)malloc(sizeof(struct in6_ifstat), + ext->in6_ifstat = (struct in6_ifstat *)kmalloc(sizeof(struct in6_ifstat), M_IFADDR, M_WAITOK); bzero(ext->in6_ifstat, sizeof(*ext->in6_ifstat)); ext->icmp6_ifstat = - (struct icmp6_ifstat *)malloc(sizeof(struct icmp6_ifstat), + (struct icmp6_ifstat *)kmalloc(sizeof(struct icmp6_ifstat), M_IFADDR, M_WAITOK); bzero(ext->icmp6_ifstat, sizeof(*ext->icmp6_ifstat)); diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index fe7d03f229..5ede887fb4 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/ip6_output.c,v 1.13.2.18 2003/01/24 05:11:35 sam Exp $ */ -/* $DragonFly: src/sys/netinet6/ip6_output.c,v 1.20 2006/09/05 00:55:48 dillon Exp $ */ +/* $DragonFly: src/sys/netinet6/ip6_output.c,v 1.21 2006/09/05 03:48:12 dillon Exp $ */ /* $KAME: ip6_output.c,v 1.279 2002/01/26 06:12:30 jinmei Exp $ */ /* @@ -1847,14 +1847,14 @@ ip6_copypktopts(struct ip6_pktopts *src, int canwait) dst->ip6po_hlim = src->ip6po_hlim; if (src->ip6po_pktinfo) { - dst->ip6po_pktinfo = malloc(sizeof(*dst->ip6po_pktinfo), + dst->ip6po_pktinfo = kmalloc(sizeof(*dst->ip6po_pktinfo), M_IP6OPT, canwait); if (dst->ip6po_pktinfo == NULL && canwait == M_NOWAIT) goto bad; *dst->ip6po_pktinfo = *src->ip6po_pktinfo; } if (src->ip6po_nexthop) { - dst->ip6po_nexthop = malloc(src->ip6po_nexthop->sa_len, + dst->ip6po_nexthop = kmalloc(src->ip6po_nexthop->sa_len, M_IP6OPT, canwait); if (dst->ip6po_nexthop == NULL && canwait == M_NOWAIT) goto bad; @@ -2279,7 +2279,7 @@ ip6_setpktoptions(struct mbuf *control, struct ip6_pktopts *opt, int priv, if (needcopy) { /* XXX: Is it really WAITOK? */ opt->ip6po_pktinfo = - malloc(sizeof(struct in6_pktinfo), + kmalloc(sizeof(struct in6_pktinfo), M_IP6OPT, M_WAITOK); bcopy(CMSG_DATA(cm), opt->ip6po_pktinfo, sizeof(struct in6_pktinfo)); @@ -2338,7 +2338,7 @@ ip6_setpktoptions(struct mbuf *control, struct ip6_pktopts *opt, int priv, if (needcopy) { opt->ip6po_nexthop = - malloc(*CMSG_DATA(cm), + kmalloc(*CMSG_DATA(cm), M_IP6OPT, M_WAITOK); bcopy(CMSG_DATA(cm), opt->ip6po_nexthop, diff --git a/sys/netinet6/ipsec.c b/sys/netinet6/ipsec.c index 9deb62840c..06093ebb65 100644 --- a/sys/netinet6/ipsec.c +++ b/sys/netinet6/ipsec.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/ipsec.c,v 1.3.2.12 2003/05/06 06:46:58 suz Exp $ */ -/* $DragonFly: src/sys/netinet6/ipsec.c,v 1.15 2006/09/05 00:55:48 dillon Exp $ */ +/* $DragonFly: src/sys/netinet6/ipsec.c,v 1.16 2006/09/05 03:48:12 dillon Exp $ */ /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */ /* @@ -1149,7 +1149,7 @@ ipsec_deepcopy_policy(struct secpolicy *src) */ q = &newchain; for (p = src->req; p; p = p->next) { - *q = (struct ipsecrequest *)malloc(sizeof(struct ipsecrequest), + *q = (struct ipsecrequest *)kmalloc(sizeof(struct ipsecrequest), M_SECA, M_NOWAIT); if (*q == NULL) goto fail; diff --git a/sys/netproto/802_11/wlan/ieee80211_node.c b/sys/netproto/802_11/wlan/ieee80211_node.c index 84b81deeb1..44cf2fc4f0 100644 --- a/sys/netproto/802_11/wlan/ieee80211_node.c +++ b/sys/netproto/802_11/wlan/ieee80211_node.c @@ -30,7 +30,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/net80211/ieee80211_node.c,v 1.48.2.10 2006/03/13 03:05:47 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan/ieee80211_node.c,v 1.5 2006/09/05 00:55:48 dillon Exp $ + * $DragonFly: src/sys/netproto/802_11/wlan/ieee80211_node.c,v 1.6 2006/09/05 03:48:12 dillon Exp $ */ #include @@ -111,7 +111,7 @@ ieee80211_node_lateattach(struct ieee80211com *ic) ic->ic_max_aid = IEEE80211_AID_MAX; ic->ic_aid_bitmap = - malloc(howmany(ic->ic_max_aid, 32) * sizeof(uint32_t), + kmalloc(howmany(ic->ic_max_aid, 32) * sizeof(uint32_t), M_DEVBUF, M_WAITOK | M_ZERO); /* XXX defer until using hostap/ibss mode */ @@ -2291,7 +2291,7 @@ ieee80211_node_table_init(struct ieee80211com *ic, nt->nt_keyixmax = keyixmax; if (nt->nt_keyixmax > 0) { nt->nt_keyixmap = - malloc(keyixmax * sizeof(struct ieee80211_node *), + kmalloc(keyixmax * sizeof(struct ieee80211_node *), M_80211_NODE, M_WAITOK | M_ZERO); } else { nt->nt_keyixmap = NULL; diff --git a/sys/netproto/802_11/wlan_ratectl/amrr/ieee80211_ratectl_amrr.c b/sys/netproto/802_11/wlan_ratectl/amrr/ieee80211_ratectl_amrr.c index aad1f52190..222eadb556 100644 --- a/sys/netproto/802_11/wlan_ratectl/amrr/ieee80211_ratectl_amrr.c +++ b/sys/netproto/802_11/wlan_ratectl/amrr/ieee80211_ratectl_amrr.c @@ -35,7 +35,7 @@ * THE POSSIBILITY OF SUCH DAMAGES. * * $FreeBSD: src/sys/dev/ath/ath_rate/amrr/amrr.c,v 1.8.2.3 2006/02/24 19:51:11 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan_ratectl/amrr/ieee80211_ratectl_amrr.c,v 1.2 2006/09/05 00:55:48 dillon Exp $ + * $DragonFly: src/sys/netproto/802_11/wlan_ratectl/amrr/ieee80211_ratectl_amrr.c,v 1.3 2006/09/05 03:48:12 dillon Exp $ */ /* @@ -502,7 +502,7 @@ static void amrr_data_alloc(struct ieee80211_node *ni) { KKASSERT(ni->ni_rate_data == NULL); - ni->ni_rate_data = malloc(sizeof(struct amrr_data), + ni->ni_rate_data = kmalloc(sizeof(struct amrr_data), M_AMRR_RATECTL_DATA, M_NOWAIT | M_ZERO); } diff --git a/sys/netproto/802_11/wlan_ratectl/onoe/ieee80211_ratectl_onoe.c b/sys/netproto/802_11/wlan_ratectl/onoe/ieee80211_ratectl_onoe.c index d3f7850a7f..8e6055c176 100644 --- a/sys/netproto/802_11/wlan_ratectl/onoe/ieee80211_ratectl_onoe.c +++ b/sys/netproto/802_11/wlan_ratectl/onoe/ieee80211_ratectl_onoe.c @@ -34,7 +34,7 @@ * THE POSSIBILITY OF SUCH DAMAGES. * * $FreeBSD: src/sys/dev/ath/ath_rate/onoe/onoe.c,v 1.8.2.3 2006/02/24 19:51:11 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan_ratectl/onoe/ieee80211_ratectl_onoe.c,v 1.2 2006/09/05 00:55:49 dillon Exp $ + * $DragonFly: src/sys/netproto/802_11/wlan_ratectl/onoe/ieee80211_ratectl_onoe.c,v 1.3 2006/09/05 03:48:13 dillon Exp $ */ /* @@ -493,7 +493,7 @@ static void onoe_data_alloc(struct ieee80211_node *ni) { KKASSERT(ni->ni_rate_data == NULL); - ni->ni_rate_data = malloc(sizeof(struct onoe_data), + ni->ni_rate_data = kmalloc(sizeof(struct onoe_data), M_ONOE_RATECTL_DATA, M_NOWAIT | M_ZERO); } diff --git a/sys/netproto/atm/port.h b/sys/netproto/atm/port.h index 7a83e58dde..fcd82b4b4a 100644 --- a/sys/netproto/atm/port.h +++ b/sys/netproto/atm/port.h @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/port.h,v 1.2.2.2 2003/01/23 21:06:44 sam Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/port.h,v 1.7 2005/02/01 00:51:50 joerg Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/port.h,v 1.8 2006/09/05 03:48:13 dillon Exp $ * */ @@ -56,8 +56,8 @@ */ #ifdef ATM_KERNEL #include -#define KM_ALLOC(size, type, flags) malloc((size), (type), (flags)) -#define KM_FREE(addr, size, type) free((addr), (type)) +#define KM_ALLOC(size, type, flags) kmalloc((size), (type), (flags)) +#define KM_FREE(addr, size, type) kfree((addr), (type)) #define KM_CMP(b1, b2, len) bcmp((b1), (b2), (len)) #define KM_COPY(from, to, len) bcopy((from), (to), (len)) @@ -76,8 +76,8 @@ * UM_ZERO(addr, len) Zeros len bytes of data from addr. * */ -#define UM_ALLOC(size) malloc((size_t)(size)) -#define UM_FREE(addr) free((void *)(addr)) +#define UM_ALLOC(size) kmalloc((size_t)(size)) +#define UM_FREE(addr) kfree((void *)(addr)) #define UM_COPY(from, to, len) bcopy((void *)(from), (void *)(to),\ (size_t)(len)) #define UM_ZERO(addr, len) bzero((void *)(addr), (size_t)(len)) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index dbf6a3e3f2..66d13f5aea 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.7 2003/06/03 00:09:02 sam Exp $ */ -/* $DragonFly: src/sys/opencrypto/crypto.c,v 1.11 2006/09/05 00:55:49 dillon Exp $ */ +/* $DragonFly: src/sys/opencrypto/crypto.c,v 1.12 2006/09/05 03:48:13 dillon Exp $ */ /* $OpenBSD: crypto.c,v 1.38 2002/06/11 11:14:29 beck Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) @@ -145,7 +145,7 @@ crypto_init(void) } crypto_drivers_num = CRYPTO_DRIVERS_INITIAL; - crypto_drivers = malloc(crypto_drivers_num * + crypto_drivers = kmalloc(crypto_drivers_num * sizeof(struct cryptocap), M_CRYPTO_DATA, M_NOWAIT | M_ZERO); if (crypto_drivers == NULL) { printf("crypto_init: cannot malloc driver table\n"); @@ -358,7 +358,7 @@ crypto_get_driverid(u_int32_t flags) return -1; } - newdrv = malloc(2 * crypto_drivers_num * + newdrv = kmalloc(2 * crypto_drivers_num * sizeof(struct cryptocap), M_CRYPTO_DATA, M_NOWAIT|M_ZERO); if (newdrv == NULL) { crit_exit(); diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index 7ff49f69f8..4b56437add 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/opencrypto/cryptosoft.c,v 1.2.2.1 2002/11/21 23:34:23 sam Exp $ */ -/* $DragonFly: src/sys/opencrypto/cryptosoft.c,v 1.4 2006/09/05 00:55:49 dillon Exp $ */ +/* $DragonFly: src/sys/opencrypto/cryptosoft.c,v 1.5 2006/09/05 03:48:13 dillon Exp $ */ /* $OpenBSD: cryptosoft.c,v 1.35 2002/04/26 08:43:50 deraadt Exp $ */ /* @@ -612,7 +612,7 @@ swcr_newsession(void *arg, u_int32_t *sid, struct cryptoini *cri) } else swcr_sesnum *= 2; - swd = malloc(swcr_sesnum * sizeof(struct swcr_data *), + swd = kmalloc(swcr_sesnum * sizeof(struct swcr_data *), M_CRYPTO_DATA, M_NOWAIT|M_ZERO); if (swd == NULL) { /* Reset session number */ diff --git a/sys/platform/pc32/i386/busdma_machdep.c b/sys/platform/pc32/i386/busdma_machdep.c index c9d9724d4a..fa92c09399 100644 --- a/sys/platform/pc32/i386/busdma_machdep.c +++ b/sys/platform/pc32/i386/busdma_machdep.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.16.2.2 2003/01/23 00:55:27 scottl Exp $ - * $DragonFly: src/sys/platform/pc32/i386/busdma_machdep.c,v 1.14 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/busdma_machdep.c,v 1.15 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -255,7 +255,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) if (dmat->segments == NULL) { KKASSERT(dmat->nsegments && dmat->nsegments < 16384); - dmat->segments = malloc(sizeof(bus_dma_segment_t) * + dmat->segments = kmalloc(sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, M_INTWAIT); } @@ -342,7 +342,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, if (dmat->segments == NULL) { KKASSERT(dmat->nsegments < 16384); - dmat->segments = malloc(sizeof(bus_dma_segment_t) * + dmat->segments = kmalloc(sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, M_INTWAIT); } diff --git a/sys/platform/pc32/i386/i686_mem.c b/sys/platform/pc32/i386/i686_mem.c index b11018b742..ea0e093280 100644 --- a/sys/platform/pc32/i386/i686_mem.c +++ b/sys/platform/pc32/i386/i686_mem.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/i686_mem.c,v 1.8.2.4 2002/09/24 08:12:51 mdodd Exp $ - * $DragonFly: src/sys/platform/pc32/i386/i686_mem.c,v 1.4 2005/08/29 21:08:02 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/i686_mem.c,v 1.5 2006/09/05 03:48:11 dillon Exp $ */ #include @@ -569,7 +569,7 @@ i686_mrinit(struct mem_range_softc *sc) } sc->mr_desc = - (struct mem_range_desc *)malloc(nmdesc * sizeof(struct mem_range_desc), + (struct mem_range_desc *)kmalloc(nmdesc * sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); bzero(sc->mr_desc, nmdesc * sizeof(struct mem_range_desc)); sc->mr_ndesc = nmdesc; diff --git a/sys/platform/pc32/i386/k6_mem.c b/sys/platform/pc32/i386/k6_mem.c index 3500babc50..9598f74bbe 100644 --- a/sys/platform/pc32/i386/k6_mem.c +++ b/sys/platform/pc32/i386/k6_mem.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/k6_mem.c,v 1.4.2.2 2002/09/16 21:58:41 dwmalone Exp $ - * $DragonFly: src/sys/platform/pc32/i386/k6_mem.c,v 1.5 2005/01/06 08:33:11 asmodai Exp $ + * $DragonFly: src/sys/platform/pc32/i386/k6_mem.c,v 1.6 2006/09/05 03:48:11 dillon Exp $ * */ @@ -108,7 +108,7 @@ k6_mrinit(struct mem_range_softc *sc) { sc->mr_cap = 0; sc->mr_ndesc = 2; /* XXX (BFF) For now, we only have one msr for this */ - sc->mr_desc = malloc(sc->mr_ndesc * sizeof(struct mem_range_desc), + sc->mr_desc = kmalloc(sc->mr_ndesc * sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); if (sc->mr_desc == NULL) panic("k6_mrinit: malloc returns NULL"); diff --git a/sys/platform/pc32/i386/mem.c b/sys/platform/pc32/i386/mem.c index 06281d1cfa..aaf9eb0b59 100644 --- a/sys/platform/pc32/i386/mem.c +++ b/sys/platform/pc32/i386/mem.c @@ -39,7 +39,7 @@ * from: Utah $Hdr: mem.c 1.13 89/10/08$ * from: @(#)mem.c 7.2 (Berkeley) 5/9/91 * $FreeBSD: src/sys/i386/i386/mem.c,v 1.79.2.9 2003/01/04 22:58:01 njl Exp $ - * $DragonFly: src/sys/platform/pc32/i386/Attic/mem.c,v 1.18 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/Attic/mem.c,v 1.19 2006/09/05 03:48:11 dillon Exp $ */ /* @@ -392,7 +392,7 @@ mem_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct ucred *cred) nd = imin(mo->mo_arg[0], mem_range_softc.mr_ndesc); if (nd > 0) { md = (struct mem_range_desc *) - malloc(nd * sizeof(struct mem_range_desc), + kmalloc(nd * sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); error = mem_range_attr_get(md, &nd); if (!error) @@ -406,7 +406,7 @@ mem_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct ucred *cred) break; case MEMRANGE_SET: - md = (struct mem_range_desc *)malloc(sizeof(struct mem_range_desc), + md = (struct mem_range_desc *)kmalloc(sizeof(struct mem_range_desc), M_MEMDESC, M_WAITOK); error = copyin(mo->mo_desc, md, sizeof(struct mem_range_desc)); /* clamp description string */ diff --git a/sys/sys/posix4.h b/sys/sys/posix4.h index 6652df74d4..82fc8ee1ca 100644 --- a/sys/sys/posix4.h +++ b/sys/sys/posix4.h @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/posix4/posix4.h,v 1.6 1999/12/27 10:22:09 bde Exp $ - * $DragonFly: src/sys/sys/posix4.h,v 1.5 2003/11/27 19:11:17 dillon Exp $ + * $DragonFly: src/sys/sys/posix4.h,v 1.6 2006/09/05 03:48:11 dillon Exp $ */ #include "opt_posix.h" @@ -44,8 +44,8 @@ MALLOC_DECLARE(M_P31B); -#define p31b_malloc(SIZE) malloc((SIZE), M_P31B, M_WAITOK) -#define p31b_free(P) free((P), M_P31B) +#define p31b_malloc(SIZE) kmalloc((SIZE), M_P31B, M_WAITOK) +#define p31b_free(P) kfree((P), M_P31B) struct proc; diff --git a/sys/vfs/gnu/ext2fs/ext2_vfsops.c b/sys/vfs/gnu/ext2fs/ext2_vfsops.c index 72aa756afa..096eb02579 100644 --- a/sys/vfs/gnu/ext2fs/ext2_vfsops.c +++ b/sys/vfs/gnu/ext2fs/ext2_vfsops.c @@ -38,7 +38,7 @@ * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_vfsops.c,v 1.63.2.7 2002/07/01 00:18:51 iedowse Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.48 2006/09/03 18:52:29 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.49 2006/09/05 03:48:13 dillon Exp $ */ #include "opt_quota.h" @@ -108,8 +108,8 @@ static struct vfsops ext2fs_vfsops = { }; VFS_SET(ext2fs_vfsops, ext2fs, 0); -#define bsd_malloc malloc -#define bsd_free free +#define bsd_malloc kmalloc +#define bsd_free kfree static int ext2fs_inode_hash_lock; diff --git a/sys/vfs/isofs/cd9660/cd9660_node.c b/sys/vfs/isofs/cd9660/cd9660_node.c index d78b54431c..15c6fe5219 100644 --- a/sys/vfs/isofs/cd9660/cd9660_node.c +++ b/sys/vfs/isofs/cd9660/cd9660_node.c @@ -37,7 +37,7 @@ * * @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94 * $FreeBSD: src/sys/isofs/cd9660/cd9660_node.c,v 1.29.2.1 2000/07/08 14:35:56 bp Exp $ - * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_node.c,v 1.18 2006/09/05 00:55:50 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_node.c,v 1.19 2006/09/05 03:48:13 dillon Exp $ */ #include @@ -84,7 +84,7 @@ cd9660_init(struct vfsconf *vfsp) isohash = 16; while (isohash < hlimit) isohash <<= 1; - isohashtbl = malloc(sizeof(void *) * isohash, + isohashtbl = kmalloc(sizeof(void *) * isohash, M_ISOFSMNT, M_WAITOK|M_ZERO); --isohash; lwkt_token_init(&cd9660_ihash_token); diff --git a/sys/vfs/msdosfs/msdosfs_vfsops.c b/sys/vfs/msdosfs/msdosfs_vfsops.c index e8286575ca..7696228dbd 100644 --- a/sys/vfs/msdosfs/msdosfs_vfsops.c +++ b/sys/vfs/msdosfs/msdosfs_vfsops.c @@ -1,5 +1,5 @@ /* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/msdosfs/Attic/msdosfs_vfsops.c,v 1.60.2.8 2004/03/02 09:43:04 tjr Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.38 2006/09/05 00:55:50 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.39 2006/09/05 03:48:13 dillon Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -618,7 +618,7 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct msdosfs_args *argp) * Allocate memory for the bitmap of allocated clusters, and then * fill it in. */ - pmp->pm_inusemap = malloc(((pmp->pm_maxcluster + N_INUSEBITS - 1) + pmp->pm_inusemap = kmalloc(((pmp->pm_maxcluster + N_INUSEBITS - 1) / N_INUSEBITS) * sizeof(*pmp->pm_inusemap), M_MSDOSFSFAT, M_WAITOK); diff --git a/sys/vfs/nfs/bootp_subr.c b/sys/vfs/nfs/bootp_subr.c index 39046db4bf..7e210e45ce 100644 --- a/sys/vfs/nfs/bootp_subr.c +++ b/sys/vfs/nfs/bootp_subr.c @@ -38,7 +38,7 @@ * nfs/krpc_subr.c * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $ * $FreeBSD: src/sys/nfs/bootp_subr.c,v 1.20.2.9 2003/04/24 16:51:08 ambrisko Exp $ - * $DragonFly: src/sys/vfs/nfs/bootp_subr.c,v 1.18 2006/09/05 00:55:50 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/bootp_subr.c,v 1.19 2006/09/05 03:48:13 dillon Exp $ */ #include "opt_bootp.h" @@ -420,7 +420,7 @@ static struct bootpc_ifcontext * allocifctx(struct bootpc_globalcontext *gctx) { struct bootpc_ifcontext *ifctx; - ifctx = (struct bootpc_ifcontext *) malloc(sizeof(*ifctx), + ifctx = (struct bootpc_ifcontext *) kmalloc(sizeof(*ifctx), M_TEMP, M_WAITOK); if (ifctx == NULL) panic("Failed to allocate bootp interface context structure"); diff --git a/sys/vfs/nfs/nfs_socket.c b/sys/vfs/nfs/nfs_socket.c index c1f75d040c..9eecc0f4e3 100644 --- a/sys/vfs/nfs/nfs_socket.c +++ b/sys/vfs/nfs/nfs_socket.c @@ -35,7 +35,7 @@ * * @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95 * $FreeBSD: src/sys/nfs/nfs_socket.c,v 1.60.2.6 2003/03/26 01:44:46 alfred Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_socket.c,v 1.36 2006/09/05 00:55:50 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_socket.c,v 1.37 2006/09/05 03:48:13 dillon Exp $ */ /* @@ -2117,7 +2117,7 @@ nfsrv_rcv(struct socket *so, void *arg, int waitflag) struct nfsrv_rec *rec; int mf = (waitflag & MB_DONTWAIT) ? M_NOWAIT : M_WAITOK; - rec = malloc(sizeof(struct nfsrv_rec), + rec = kmalloc(sizeof(struct nfsrv_rec), M_NFSRVDESC, mf); if (!rec) { if (nam) diff --git a/sys/vfs/nfs/nfs_srvcache.c b/sys/vfs/nfs/nfs_srvcache.c index 0d46981cd2..f9a3680005 100644 --- a/sys/vfs/nfs/nfs_srvcache.c +++ b/sys/vfs/nfs/nfs_srvcache.c @@ -35,7 +35,7 @@ * * @(#)nfs_srvcache.c 8.3 (Berkeley) 3/30/95 * $FreeBSD: src/sys/nfs/nfs_srvcache.c,v 1.21 2000/02/13 03:32:06 peter Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_srvcache.c,v 1.11 2006/09/05 00:55:50 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_srvcache.c,v 1.12 2006/09/05 03:48:13 dillon Exp $ */ /* @@ -218,7 +218,7 @@ loop: nfsstats.srvcache_misses++; NFS_DPF(RC, ("M%03x", nd->nd_retxid & 0xfff)); if (numnfsrvcache < desirednfsrvcache) { - rp = (struct nfsrvcache *)malloc((u_long)sizeof *rp, + rp = (struct nfsrvcache *)kmalloc((u_long)sizeof *rp, M_NFSD, M_WAITOK); bzero((char *)rp, sizeof *rp); numnfsrvcache++; diff --git a/sys/vfs/nullfs/null_vfsops.c b/sys/vfs/nullfs/null_vfsops.c index 98327d53b7..d333567de7 100644 --- a/sys/vfs/nullfs/null_vfsops.c +++ b/sys/vfs/nullfs/null_vfsops.c @@ -37,7 +37,7 @@ * * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 * $FreeBSD: src/sys/miscfs/nullfs/null_vfsops.c,v 1.35.2.3 2001/07/26 20:37:11 iedowse Exp $ - * $DragonFly: src/sys/vfs/nullfs/null_vfsops.c,v 1.25 2006/09/05 00:55:50 dillon Exp $ + * $DragonFly: src/sys/vfs/nullfs/null_vfsops.c,v 1.26 2006/09/05 03:48:13 dillon Exp $ */ /* @@ -104,7 +104,7 @@ nullfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred) &rootvp); } - xmp = (struct null_mount *) malloc(sizeof(struct null_mount), + xmp = (struct null_mount *) kmalloc(sizeof(struct null_mount), M_NULLFSMNT, M_WAITOK); /* XXX */ /* -- 2.41.0