diff options
Diffstat (limited to 'sys/i386/i386')
-rw-r--r-- | sys/i386/i386/busdma_machdep.c | 16 | ||||
-rw-r--r-- | sys/i386/i386/i686_mem.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/k6_mem.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/legacy.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/nexus.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/userconfig.c | 4 | ||||
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 3 |
7 files changed, 14 insertions, 21 deletions
diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c index 63c403808d3da..9f0f7c37b9848 100644 --- a/sys/i386/i386/busdma_machdep.c +++ b/sys/i386/i386/busdma_machdep.c @@ -250,14 +250,13 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) int maxpages; *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, - M_NOWAIT); - if (*mapp == NULL) { + M_NOWAIT | M_ZERO); + if (*mapp == NULL) return (ENOMEM); - } else { - /* Initialize the new map */ - bzero(*mapp, sizeof(**mapp)); - STAILQ_INIT(&((*mapp)->bpages)); - } + + /* Initialize the new map */ + STAILQ_INIT(&((*mapp)->bpages)); + /* * Attempt to add pages to our pool on a per-instance * basis up to a sane limit. @@ -551,11 +550,10 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) int s; bpage = (struct bounce_page *)malloc(sizeof(*bpage), M_DEVBUF, - M_NOWAIT); + M_NOWAIT | M_ZERO); if (bpage == NULL) break; - bzero(bpage, sizeof(*bpage)); bpage->vaddr = (vm_offset_t)contigmalloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0ul, dmat->lowaddr, diff --git a/sys/i386/i386/i686_mem.c b/sys/i386/i386/i686_mem.c index 9d49949f392de..c3929bc0c4e40 100644 --- a/sys/i386/i386/i686_mem.c +++ b/sys/i386/i386/i686_mem.c @@ -522,8 +522,7 @@ i686_mrinit(struct mem_range_softc *sc) sc->mr_desc = (struct mem_range_desc *)malloc(nmdesc * sizeof(struct mem_range_desc), - M_MEMDESC, M_WAITOK); - bzero(sc->mr_desc, nmdesc * sizeof(struct mem_range_desc)); + M_MEMDESC, M_WAITOK | M_ZERO); sc->mr_ndesc = nmdesc; mrd = sc->mr_desc; diff --git a/sys/i386/i386/k6_mem.c b/sys/i386/i386/k6_mem.c index 48af3dd63f992..00f9b7ff07ef5 100644 --- a/sys/i386/i386/k6_mem.c +++ b/sys/i386/i386/k6_mem.c @@ -100,10 +100,9 @@ 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), - M_MEMDESC, M_NOWAIT); + M_MEMDESC, M_NOWAIT | M_ZERO); if (sc->mr_desc == NULL) panic("k6_mrinit: malloc returns NULL"); - bzero(sc->mr_desc, sc->mr_ndesc * sizeof(struct mem_range_desc)); reg = rdmsr(UWCCR); for (d = 0; d < sc->mr_ndesc; d++) { diff --git a/sys/i386/i386/legacy.c b/sys/i386/i386/legacy.c index d648848b79a48..76c41ae85097c 100644 --- a/sys/i386/i386/legacy.c +++ b/sys/i386/i386/legacy.c @@ -331,10 +331,9 @@ nexus_add_child(device_t bus, int order, const char *name, int unit) device_t child; struct nexus_device *ndev; - ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT); + ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT|M_ZERO); if (!ndev) return(0); - bzero(ndev, sizeof(struct nexus_device)); resource_list_init(&ndev->nx_resources); ndev->nx_pcibus = -1; diff --git a/sys/i386/i386/nexus.c b/sys/i386/i386/nexus.c index d648848b79a48..76c41ae85097c 100644 --- a/sys/i386/i386/nexus.c +++ b/sys/i386/i386/nexus.c @@ -331,10 +331,9 @@ nexus_add_child(device_t bus, int order, const char *name, int unit) device_t child; struct nexus_device *ndev; - ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT); + ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT|M_ZERO); if (!ndev) return(0); - bzero(ndev, sizeof(struct nexus_device)); resource_list_init(&ndev->nx_resources); ndev->nx_pcibus = -1; diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c index de19c23be8397..a8a80fa66a986 100644 --- a/sys/i386/i386/userconfig.c +++ b/sys/i386/i386/userconfig.c @@ -3228,8 +3228,8 @@ load_devtab(void) char *name; int unit; - uc_devtab = malloc(sizeof(struct uc_device)*(count + 1),M_DEVL,M_WAITOK); - bzero(uc_devtab, sizeof(struct uc_device) * (count + 1)); + uc_devtab = malloc(sizeof(struct uc_device) * (count + 1), M_DEVL, + M_WAITOK | M_ZERO); dt = 0; for (i = 0; i < count; i++) { name = resource_query_name(i); diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 294a5838def05..dcf4986da814f 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -287,11 +287,10 @@ cpu_coredump(p, vp, cred) int error; caddr_t tempuser; - tempuser = malloc(ctob(UPAGES), M_TEMP, M_WAITOK); + tempuser = malloc(ctob(UPAGES), M_TEMP, M_WAITOK | M_ZERO); if (!tempuser) return EINVAL; - bzero(tempuser, ctob(UPAGES)); bcopy(p->p_addr, tempuser, sizeof(struct user)); bcopy(p->p_md.md_regs, tempuser + ((caddr_t) p->p_md.md_regs - (caddr_t) p->p_addr), |