in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
This commit is contained in:
parent
cfe5ae87ad
commit
d47bcd296c
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fd.c,v 1.60 2019/02/08 08:47:35 mrg Exp $ */
|
||||
/* $NetBSD: fd.c,v 1.61 2019/11/10 21:16:21 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -82,7 +82,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.60 2019/02/08 08:47:35 mrg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.61 2019/11/10 21:16:21 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
|
||||
@ -1398,11 +1398,7 @@ fdioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l)
|
||||
}
|
||||
|
||||
fd_formb = malloc(sizeof(struct ne7_fd_formb),
|
||||
M_TEMP, M_NOWAIT);
|
||||
if(fd_formb == 0)
|
||||
return ENOMEM;
|
||||
|
||||
|
||||
M_TEMP, M_WAITOK);
|
||||
fd_formb->head = form_cmd->head;
|
||||
fd_formb->cyl = form_cmd->cylinder;
|
||||
fd_formb->transfer_rate = fd->sc_type->rate;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: algor_p4032_intr.c,v 1.25 2014/03/29 19:28:25 christos Exp $ */
|
||||
/* $NetBSD: algor_p4032_intr.c,v 1.26 2019/11/10 21:16:21 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: algor_p4032_intr.c,v 1.25 2014/03/29 19:28:25 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: algor_p4032_intr.c,v 1.26 2019/11/10 21:16:21 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#define __INTR_PRIVATE
|
||||
@ -352,10 +352,7 @@ algor_p4032_intr_establish(int irq, int (*func)(void *), void *arg)
|
||||
|
||||
KASSERT(irq == irqmap->irqidx);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_irq = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: algor_p5064_intr.c,v 1.28 2014/03/29 19:28:25 christos Exp $ */
|
||||
/* $NetBSD: algor_p5064_intr.c,v 1.29 2019/11/10 21:16:21 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: algor_p5064_intr.c,v 1.28 2014/03/29 19:28:25 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: algor_p5064_intr.c,v 1.29 2019/11/10 21:16:21 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#define __INTR_PRIVATE
|
||||
@ -445,10 +445,7 @@ algor_p5064_intr_establish(int irq, int (*func)(void *), void *arg)
|
||||
|
||||
KASSERT(irq == irqmap->irqidx);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_irq = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: algor_p6032_intr.c,v 1.22 2014/03/29 19:28:25 christos Exp $ */
|
||||
/* $NetBSD: algor_p6032_intr.c,v 1.23 2019/11/10 21:16:21 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: algor_p6032_intr.c,v 1.22 2014/03/29 19:28:25 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: algor_p6032_intr.c,v 1.23 2019/11/10 21:16:21 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#define __INTR_PRIVATE
|
||||
@ -313,10 +313,7 @@ algor_p6032_intr_establish(int irq, int (*func)(void *), void *arg)
|
||||
|
||||
KASSERT(irq == irqmap->irqidx);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_irq = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pcib.c,v 1.24 2011/07/09 16:03:01 matt Exp $ */
|
||||
/* $NetBSD: pcib.c,v 1.25 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.24 2011/07/09 16:03:01 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.25 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include "opt_algor_p5064.h"
|
||||
#include "opt_algor_p6032.h"
|
||||
@ -449,10 +449,7 @@ pcib_isa_intr_establish(void *v, int irq, int type, int level,
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_irq = irq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: shared_intr.c,v 1.21 2012/02/06 02:14:12 matt Exp $ */
|
||||
/* $NetBSD: shared_intr.c,v 1.22 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Carnegie-Mellon University.
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: shared_intr.c,v 1.21 2012/02/06 02:14:12 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: shared_intr.c,v 1.22 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
@ -72,10 +72,7 @@ alpha_shared_intr_alloc(unsigned int n, unsigned int namesize)
|
||||
unsigned int i;
|
||||
|
||||
intr = malloc(n * sizeof (struct alpha_shared_intr), M_DEVBUF,
|
||||
cold ? M_NOWAIT : M_WAITOK);
|
||||
if (intr == NULL)
|
||||
panic("alpha_shared_intr_alloc: couldn't malloc intr");
|
||||
|
||||
M_WAITOK);
|
||||
for (i = 0; i < n; i++) {
|
||||
TAILQ_INIT(&intr[i].intr_q);
|
||||
intr[i].intr_sharetype = IST_NONE;
|
||||
@ -85,10 +82,7 @@ alpha_shared_intr_alloc(unsigned int n, unsigned int namesize)
|
||||
intr[i].intr_private = NULL;
|
||||
if (namesize != 0) {
|
||||
intr[i].intr_string = malloc(namesize, M_DEVBUF,
|
||||
cold ? M_NOWAIT : M_WAITOK);
|
||||
if (intr[i].intr_string == NULL)
|
||||
panic("alpha_shared_intr_alloc: couldn't "
|
||||
"malloc intr string");
|
||||
M_WAITOK);
|
||||
} else
|
||||
intr[i].intr_string = NULL;
|
||||
}
|
||||
@ -136,11 +130,7 @@ alpha_shared_intr_establish(struct alpha_shared_intr *intr, unsigned int num,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* no point in sleeping unless someone can free memory. */
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
|
||||
if (ih == NULL)
|
||||
panic("alpha_shared_intr_establish: can't malloc intrhand");
|
||||
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
|
||||
#ifdef DIAGNOSTIC
|
||||
if (type == IST_NONE)
|
||||
panic("alpha_shared_intr_establish: bogus type");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dwlpx_dma.c,v 1.24 2014/03/21 16:39:29 christos Exp $ */
|
||||
/* $NetBSD: dwlpx_dma.c,v 1.25 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: dwlpx_dma.c,v 1.24 2014/03/21 16:39:29 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: dwlpx_dma.c,v 1.25 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -210,9 +210,7 @@ dwlpx_dma_init(struct dwlpx_config *ccp)
|
||||
* SGVA base: 0
|
||||
*/
|
||||
#define EXNAMELEN 16
|
||||
exname = malloc(EXNAMELEN, M_DEVBUF, M_NOWAIT);
|
||||
if (exname == NULL)
|
||||
panic("dwlpx_dma_init");
|
||||
exname = malloc(EXNAMELEN, M_DEVBUF, M_WAITOK);
|
||||
snprintf(exname, EXNAMELEN, "%s_sgmap_a",
|
||||
device_xname(ccp->cc_sc->dwlpx_dev));
|
||||
alpha_sgmap_init(t, &ccp->cc_sgmap, exname, DWLPx_SG_MAPPED_BASE,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ioasic.c,v 1.46 2014/03/26 08:09:06 christos Exp $ */
|
||||
/* $NetBSD: ioasic.c,v 1.47 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -61,7 +61,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.46 2014/03/26 08:09:06 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ioasic.c,v 1.47 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
@ -196,9 +196,7 @@ ioasicattach(device_t parent, device_t self, void *aux)
|
||||
ioasicintrs[i].iai_func = ioasic_intrnull;
|
||||
ioasicintrs[i].iai_arg = (void *)i;
|
||||
|
||||
cp = malloc(len, M_DEVBUF, M_NOWAIT);
|
||||
if (cp == NULL)
|
||||
panic("ioasicattach");
|
||||
cp = malloc(len, M_DEVBUF, M_WAITOK);
|
||||
snprintf(cp, len, "slot %lu", i);
|
||||
evcnt_attach_dynamic(&ioasicintrs[i].iai_evcnt,
|
||||
EVCNT_TYPE_INTR, pevcnt, device_xname(self), cp);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tc_3000_300.c,v 1.33 2014/03/26 08:09:06 christos Exp $ */
|
||||
/* $NetBSD: tc_3000_300.c,v 1.34 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: tc_3000_300.c,v 1.33 2014/03/26 08:09:06 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tc_3000_300.c,v 1.34 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -111,9 +111,7 @@ tc_3000_300_intr_setup(void)
|
||||
tc_3000_300_intr[i].tci_func = tc_3000_300_intrnull;
|
||||
tc_3000_300_intr[i].tci_arg = (void *)i;
|
||||
|
||||
cp = malloc(len, M_DEVBUF, M_NOWAIT);
|
||||
if (cp == NULL)
|
||||
panic("tc_3000_300_intr_setup");
|
||||
cp = malloc(len, M_DEVBUF, M_WAITOK);
|
||||
snprintf(cp, len, "slot %lu", i);
|
||||
evcnt_attach_dynamic(&tc_3000_300_intr[i].tci_evcnt,
|
||||
EVCNT_TYPE_INTR, NULL, "tc", cp);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tc_3000_500.c,v 1.32 2014/03/26 08:09:06 christos Exp $ */
|
||||
/* $NetBSD: tc_3000_500.c,v 1.33 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: tc_3000_500.c,v 1.32 2014/03/26 08:09:06 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tc_3000_500.c,v 1.33 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -135,9 +135,7 @@ tc_3000_500_intr_setup(void)
|
||||
tc_3000_500_intr[i].tci_func = tc_3000_500_intrnull;
|
||||
tc_3000_500_intr[i].tci_arg = (void *)i;
|
||||
|
||||
cp = malloc(len, M_DEVBUF, M_NOWAIT);
|
||||
if (cp == NULL)
|
||||
panic("tc_3000_500_intr_setup");
|
||||
cp = malloc(len, M_DEVBUF, M_WAITOK);
|
||||
snprintf(cp, len, "slot %lu", i);
|
||||
evcnt_attach_dynamic(&tc_3000_500_intr[i].tci_evcnt,
|
||||
EVCNT_TYPE_INTR, NULL, "tc", cp);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tc_dma_3000_500.c,v 1.20 2017/06/22 16:46:52 flxd Exp $ */
|
||||
/* $NetBSD: tc_dma_3000_500.c,v 1.21 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: tc_dma_3000_500.c,v 1.20 2017/06/22 16:46:52 flxd Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tc_dma_3000_500.c,v 1.21 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -86,10 +86,7 @@ tc_dma_init_3000_500(int nslots)
|
||||
|
||||
/* Allocate per-slot DMA info. */
|
||||
sisize = nslots * sizeof(struct tc_dma_slot_info);
|
||||
tc_dma_slot_info = malloc(sisize, M_DEVBUF, M_NOWAIT);
|
||||
if (tc_dma_slot_info == NULL)
|
||||
panic("tc_dma_init: can't allocate per-slot DMA info");
|
||||
memset(tc_dma_slot_info, 0, sisize);
|
||||
tc_dma_slot_info = malloc(sisize, M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
|
||||
/* Default all slots to direct-mapped. */
|
||||
for (i = 0; i < nslots; i++)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: netbsd32_machdep.c,v 1.128 2019/09/26 01:39:22 christos Exp $ */
|
||||
/* $NetBSD: netbsd32_machdep.c,v 1.129 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Wasabi Systems, Inc.
|
||||
@ -36,7 +36,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.128 2019/09/26 01:39:22 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.129 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -554,10 +554,7 @@ x86_64_set_ldt32(struct lwp *l, void *args, register_t *retval)
|
||||
if (ua.num < 0 || ua.num > 8192)
|
||||
return EINVAL;
|
||||
|
||||
descv = malloc(sizeof(*descv) * ua.num, M_TEMP, M_NOWAIT);
|
||||
if (descv == NULL)
|
||||
return ENOMEM;
|
||||
|
||||
descv = malloc(sizeof(*descv) * ua.num, M_TEMP, M_WAITOK);
|
||||
error = copyin((void *)(uintptr_t)ua32.desc, descv,
|
||||
sizeof(*descv) * ua.num);
|
||||
if (error == 0)
|
||||
@ -586,9 +583,6 @@ x86_64_get_ldt32(struct lwp *l, void *args, register_t *retval)
|
||||
return EINVAL;
|
||||
|
||||
cp = malloc(ua.num * sizeof(union descriptor), M_TEMP, M_WAITOK);
|
||||
if (cp == NULL)
|
||||
return ENOMEM;
|
||||
|
||||
error = x86_get_ldt1(l, &ua, cp);
|
||||
*retval = ua.num;
|
||||
if (error == 0)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: siop.c,v 1.69 2014/09/21 15:44:17 christos Exp $ */
|
||||
/* $NetBSD: siop.c,v 1.70 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -70,7 +70,7 @@
|
||||
#include "opt_ddb.h"
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.69 2014/09/21 15:44:17 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.70 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -567,9 +567,7 @@ siopinitialize(struct siop_softc *sc)
|
||||
*/
|
||||
|
||||
sc->sc_acb = malloc(sizeof(struct siop_acb) * SIOP_NACB,
|
||||
M_DEVBUF, M_NOWAIT);
|
||||
if (sc->sc_acb == NULL)
|
||||
panic("siopinitialize: ACB malloc failed!");
|
||||
M_DEVBUF, M_WAITOK);
|
||||
|
||||
sc->sc_tcp[1] = 1000 / sc->sc_clock_freq;
|
||||
sc->sc_tcp[2] = 1500 / sc->sc_clock_freq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: siop2.c,v 1.43 2014/09/21 15:44:47 christos Exp $ */
|
||||
/* $NetBSD: siop2.c,v 1.44 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
@ -70,7 +70,7 @@
|
||||
#include "opt_ddb.h"
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: siop2.c,v 1.43 2014/09/21 15:44:47 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: siop2.c,v 1.44 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -554,9 +554,7 @@ siopnginitialize(struct siop_softc *sc)
|
||||
*/
|
||||
|
||||
sc->sc_acb = malloc(sizeof(struct siop_acb) * SIOP_NACB,
|
||||
M_DEVBUF, M_NOWAIT);
|
||||
if (sc->sc_acb == NULL)
|
||||
panic("siopnginitialize: ACB malloc failed!");
|
||||
M_DEVBUF, M_WAITOK);
|
||||
|
||||
sc->sc_tcp[1] = 1000 / sc->sc_clock_freq;
|
||||
sc->sc_tcp[2] = 1500 / sc->sc_clock_freq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pic_amiga.c,v 1.3 2011/06/19 07:59:47 matt Exp $ */
|
||||
/* $NetBSD: pic_amiga.c,v 1.4 2019/11/10 21:16:22 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008,2009,2010 Frank Wille.
|
||||
@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pic_amiga.c,v 1.3 2011/06/19 07:59:47 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pic_amiga.c,v 1.4 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/malloc.h>
|
||||
@ -65,8 +65,7 @@ setup_amiga_intr(void)
|
||||
struct amiga_ops *amipic;
|
||||
struct pic_ops *pic;
|
||||
|
||||
amipic = malloc(sizeof(struct amiga_ops), M_DEVBUF, M_NOWAIT);
|
||||
KASSERT(amipic != NULL);
|
||||
amipic = malloc(sizeof(struct amiga_ops), M_DEVBUF, M_WAITOK);
|
||||
pic = &amipic->pic;
|
||||
|
||||
pic->pic_numintrs = MAXIPL;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: p_dti_arcstation.c,v 1.17 2011/07/01 19:28:00 dyoung Exp $ */
|
||||
/* $NetBSD: p_dti_arcstation.c,v 1.18 2019/11/10 21:16:22 chs Exp $ */
|
||||
/* $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $ */
|
||||
|
||||
/*
|
||||
@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: p_dti_arcstation.c,v 1.17 2011/07/01 19:28:00 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: p_dti_arcstation.c,v 1.18 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#define __INTR_PRIVATE
|
||||
#include <sys/param.h>
|
||||
@ -165,7 +165,7 @@ btl_dti_arcstation_bouncemem(u_int *basep, u_int *sizep)
|
||||
|
||||
*sizep = TYNE_S_BOUNCE; /* Good enough? XXX */
|
||||
#if 0
|
||||
*basep = (u_int) malloc(*sizep, M_DEVBUF, M_NOWAIT);
|
||||
*basep = (u_int) malloc(*sizep, M_DEVBUF, M_WAITOK);
|
||||
#else
|
||||
*basep = (u_int) rpc44_buffer | 0xa0000000;
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: isabus.c,v 1.49 2012/10/27 17:17:35 chs Exp $ */
|
||||
/* $NetBSD: isabus.c,v 1.50 2019/11/10 21:16:22 chs Exp $ */
|
||||
/* $OpenBSD: isabus.c,v 1.15 1998/03/16 09:38:46 pefo Exp $ */
|
||||
/* NetBSD: isa.c,v 1.33 1995/06/28 04:30:51 cgd Exp */
|
||||
|
||||
@ -120,7 +120,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: isabus.c,v 1.49 2012/10/27 17:17:35 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: isabus.c,v 1.50 2019/11/10 21:16:22 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/proc.h>
|
||||
@ -340,10 +340,7 @@ isabr_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level,
|
||||
struct isa_intrhand **p, *q, *ih;
|
||||
static struct isa_intrhand fakehand = {NULL, fakeintr};
|
||||
|
||||
/* no point in sleeping unless someone can free memory. */
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
|
||||
if (ih == NULL)
|
||||
panic("isa_intr_establish: can't malloc handler info");
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
|
||||
|
||||
if (!LEGAL_IRQ(irq) || type == IST_NONE)
|
||||
panic("intr_establish: bogus irq or type");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: necpb.c,v 1.42 2015/10/02 05:22:49 msaitoh Exp $ */
|
||||
/* $NetBSD: necpb.c,v 1.43 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -61,7 +61,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: necpb.c,v 1.42 2015/10/02 05:22:49 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: necpb.c,v 1.43 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include "opt_pci.h"
|
||||
|
||||
@ -407,10 +407,7 @@ necpb_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level,
|
||||
if (ih >= 4)
|
||||
panic("%s: bogus handle", __func__);
|
||||
|
||||
n = malloc(sizeof(struct necpb_intrhand), M_DEVBUF, M_NOWAIT);
|
||||
if (n == NULL)
|
||||
panic("%s: can't malloc interrupt handle", __func__);
|
||||
|
||||
n = malloc(sizeof(struct necpb_intrhand), M_DEVBUF, M_WAITOK);
|
||||
n->ih_func = func;
|
||||
n->ih_arg = arg;
|
||||
n->ih_next = NULL;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $Id: at91cf.c,v 1.4 2011/07/26 22:52:47 dyoung Exp $ */
|
||||
/* $NetBSD: at91cf.c,v 1.4 2011/07/26 22:52:47 dyoung Exp $ */
|
||||
/* $Id: at91cf.c,v 1.5 2019/11/10 21:16:23 chs Exp $ */
|
||||
/* $NetBSD: at91cf.c,v 1.5 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Embedtronics Oy. All rights reserved.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: at91cf.c,v 1.4 2011/07/26 22:52:47 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: at91cf.c,v 1.5 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -174,12 +174,7 @@ at91cf_attach_common(device_t parent, device_t self, void *aux,
|
||||
printf("\n");
|
||||
|
||||
/* socket 0 */
|
||||
ph = malloc(sizeof(struct at91cf_handle), M_DEVBUF, M_NOWAIT|M_ZERO);
|
||||
if (ph == NULL) {
|
||||
printf("%s: Cannot allocate memory\n", device_xname(self));
|
||||
// @@@@ unmap? @@@@
|
||||
return; /* ENOMEM */
|
||||
}
|
||||
ph = malloc(sizeof(struct at91cf_handle), M_DEVBUF, M_WAITOK|M_ZERO);
|
||||
sc->sc_ph = ph;
|
||||
ph->ph_sc = sc;
|
||||
ph->ph_space[IO].base = sa->sa_addr + IO_BASE;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* $Id: at91dbgu.c,v 1.15 2015/09/21 13:31:30 skrll Exp $ */
|
||||
/* $NetBSD: at91dbgu.c,v 1.15 2015/09/21 13:31:30 skrll Exp $ */
|
||||
/* $Id: at91dbgu.c,v 1.16 2019/11/10 21:16:23 chs Exp $ */
|
||||
/* $NetBSD: at91dbgu.c,v 1.16 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -83,7 +83,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.15 2015/09/21 13:31:30 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.16 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
@ -256,14 +256,9 @@ at91dbgu_attach(device_t parent, device_t self, void *aux)
|
||||
tp->t_hwiflow = at91dbgu_hwiflow;
|
||||
|
||||
sc->sc_tty = tp;
|
||||
sc->sc_rbuf = malloc(AT91DBGU_RING_SIZE << 1, M_DEVBUF, M_NOWAIT);
|
||||
sc->sc_rbuf = malloc(AT91DBGU_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
|
||||
sc->sc_rbavail = AT91DBGU_RING_SIZE;
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
printf("%s: unable to allocate ring buffer\n",
|
||||
device_xname(sc->sc_dev));
|
||||
return;
|
||||
}
|
||||
sc->sc_ebuf = sc->sc_rbuf + (AT91DBGU_RING_SIZE << 1);
|
||||
sc->sc_tbc = 0;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: clpscom.c,v 1.7 2018/09/03 16:29:23 riastradh Exp $ */
|
||||
/* $NetBSD: clpscom.c,v 1.8 2019/11/10 21:16:23 chs Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2013 KIYOHARA Takashi
|
||||
* All rights reserved.
|
||||
@ -25,7 +25,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: clpscom.c,v 1.7 2018/09/03 16:29:23 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: clpscom.c,v 1.8 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include "rnd.h"
|
||||
|
||||
@ -222,11 +222,7 @@ clpscom_attach(device_t parent, device_t self, void *aux)
|
||||
sc->sc_tty->t_hwiflow = clpscom_hwiflow;
|
||||
|
||||
sc->sc_tbc = 0;
|
||||
sc->sc_rbuf = malloc(CLPSCOM_RING_SIZE << 1, M_DEVBUF, M_NOWAIT);
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
aprint_error_dev(self, "unable to allocate ring buffer\n");
|
||||
return;
|
||||
}
|
||||
sc->sc_rbuf = malloc(CLPSCOM_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
|
||||
sc->sc_rbavail = CLPSCOM_RING_SIZE;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ep93xx_intr.c,v 1.24 2015/04/08 08:35:54 ozaki-r Exp $ */
|
||||
/* $NetBSD: ep93xx_intr.c,v 1.25 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
@ -33,7 +33,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.24 2015/04/08 08:35:54 ozaki-r Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ep93xx_intr.c,v 1.25 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
/*
|
||||
* Interrupt support for the Cirrus Logic EP93XX
|
||||
@ -287,10 +287,7 @@ ep93xx_intr_establish(int irq, int ipl, int (*ih_func)(void *), void *arg)
|
||||
if (ipl < 0 || ipl > NIPL)
|
||||
panic("ep93xx_intr_establish: IPL %d out of range", ipl);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = ih_func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_irq = irq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: epcom.c,v 1.30 2015/04/13 21:18:41 riastradh Exp $ */
|
||||
/* $NetBSD: epcom.c,v 1.31 2019/11/10 21:16:23 chs Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1998, 1999, 2001, 2002, 2004 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -73,7 +73,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.30 2015/04/13 21:18:41 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.31 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
@ -213,14 +213,9 @@ epcom_attach_subr(struct epcom_softc *sc)
|
||||
tp->t_hwiflow = epcomhwiflow;
|
||||
|
||||
sc->sc_tty = tp;
|
||||
sc->sc_rbuf = malloc(EPCOM_RING_SIZE << 1, M_DEVBUF, M_NOWAIT);
|
||||
sc->sc_rbuf = malloc(EPCOM_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
|
||||
sc->sc_rbavail = EPCOM_RING_SIZE;
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
printf("%s: unable to allocate ring buffer\n",
|
||||
device_xname(sc->sc_dev));
|
||||
return;
|
||||
}
|
||||
sc->sc_ebuf = sc->sc_rbuf + (EPCOM_RING_SIZE << 1);
|
||||
sc->sc_tbc = 0;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: eppcic.c,v 1.7 2012/10/27 17:17:37 chs Exp $ */
|
||||
/* $NetBSD: eppcic.c,v 1.8 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 HAMAJIMA Katsuomi. All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: eppcic.c,v 1.7 2012/10/27 17:17:37 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: eppcic.c,v 1.8 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -175,10 +175,7 @@ eppcic_attach_common(device_t parent, device_t self, void *aux,
|
||||
epled_red_off();
|
||||
#endif
|
||||
/* socket 0 */
|
||||
if (!(ph = malloc(sizeof(struct eppcic_handle), M_DEVBUF, M_NOWAIT))) {
|
||||
printf("%s: Cannot allocate memory\n", device_xname(self));
|
||||
return; /* ENOMEM */
|
||||
}
|
||||
ph = malloc(sizeof(struct eppcic_handle), M_DEVBUF, M_WAITOK);
|
||||
sc->sc_ph[0] = ph;
|
||||
ph->ph_sc = sc;
|
||||
ph->ph_socket = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: footbridge_irqhandler.c,v 1.25 2014/04/02 11:35:36 matt Exp $ */
|
||||
/* $NetBSD: footbridge_irqhandler.c,v 1.26 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
|
||||
@ -40,7 +40,7 @@
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0,"$NetBSD: footbridge_irqhandler.c,v 1.25 2014/04/02 11:35:36 matt Exp $");
|
||||
__KERNEL_RCSID(0,"$NetBSD: footbridge_irqhandler.c,v 1.26 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include "opt_irqstats.h"
|
||||
|
||||
@ -227,13 +227,7 @@ footbridge_intr_claim(int irq, int ipl, const char *name, int (*func)(void *), v
|
||||
if (irq < 0 || irq > NIRQ)
|
||||
panic("footbridge_intr_establish: IRQ %d out of range", irq);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
{
|
||||
printf("No memory");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_ipl = ipl;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: isa_machdep.c,v 1.21 2014/03/26 08:52:00 christos Exp $ */
|
||||
/* $NetBSD: isa_machdep.c,v 1.22 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996-1998 The NetBSD Foundation, Inc.
|
||||
@ -65,7 +65,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.21 2014/03/26 08:52:00 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.22 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include "opt_irqstats.h"
|
||||
|
||||
@ -338,10 +338,7 @@ isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, int (*ih_
|
||||
#if 0
|
||||
printf("isa_intr_establish(%d, %d, %d)\n", irq, type, level);
|
||||
#endif
|
||||
/* no point in sleeping unless someone can free memory. */
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
|
||||
|
||||
if (!LEGAL_IRQ(irq) || type == IST_NONE)
|
||||
panic("intr_establish: bogus irq or type");
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: gemini_ipi.c,v 1.7 2019/08/30 00:33:55 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gemini_ipi.c,v 1.8 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -103,12 +103,7 @@ gemini_ipi_intrq_insert(gemini_ipi_softc_t *sc, int (*func)(void *), void *arg)
|
||||
{
|
||||
gemini_ipi_intrq_t *iqp;
|
||||
|
||||
iqp = malloc(sizeof(*iqp), M_DEVBUF, M_NOWAIT|M_ZERO);
|
||||
if (iqp == NULL) {
|
||||
printf("gemini_ipi_intrq_insert: malloc failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
iqp = malloc(sizeof(*iqp), M_DEVBUF, M_WAITOK|M_ZERO);
|
||||
iqp->iq_func = func;
|
||||
iqp->iq_arg = arg;
|
||||
SIMPLEQ_INSERT_TAIL(&sc->sc_intrq, iqp, iq_q);
|
||||
@ -154,12 +149,6 @@ ipi_intr_establish(int (*func)(void *), void *arg)
|
||||
return NULL;
|
||||
|
||||
ih = gemini_ipi_intrq_insert(sc, func, arg);
|
||||
#ifdef DEBUG
|
||||
if (ih == NULL)
|
||||
panic("%s: gemini_ipi_intrq_insert failed",
|
||||
device_xname(sc->sc_dev));
|
||||
#endif
|
||||
|
||||
return ih;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gemini_lpchc.c,v 1.3 2019/01/08 19:41:10 jdolecek Exp $ */
|
||||
/* $NetBSD: gemini_lpchc.c,v 1.4 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*
|
||||
* GEMINI LPC Host Controller
|
||||
@ -7,7 +7,7 @@
|
||||
#include "locators.h"
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: gemini_lpchc.c,v 1.3 2019/01/08 19:41:10 jdolecek Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gemini_lpchc.c,v 1.4 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/callout.h>
|
||||
@ -94,12 +94,7 @@ gemini_lpchc_intrq_insert(gemini_lpchc_softc_t *sc, int (*func)(void *),
|
||||
{
|
||||
gemini_lpchc_intrq_t *iqp;
|
||||
|
||||
iqp = malloc(sizeof(*iqp), M_DEVBUF, M_NOWAIT|M_ZERO);
|
||||
if (iqp == NULL) {
|
||||
printf("gemini_lpchc_intrq_insert: malloc failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
iqp = malloc(sizeof(*iqp), M_DEVBUF, M_WAITOK|M_ZERO);
|
||||
iqp->iq_func = func;
|
||||
iqp->iq_arg = arg;
|
||||
iqp->iq_bit = bit;
|
||||
@ -199,10 +194,6 @@ gemini_lpchc_intr_establish(lpcintrtag_t tag, uint irq,
|
||||
gemini_lpchc_sirq_enable(iot, ioh);
|
||||
|
||||
ih = gemini_lpchc_intrq_insert(sc, func, arg, bit, isedge);
|
||||
if (ih == NULL)
|
||||
if (gemini_lpchc_intrq_empty(sc))
|
||||
gemini_lpchc_sirq_disable(iot, ioh);
|
||||
|
||||
return ih;
|
||||
}
|
||||
|
||||
@ -228,4 +219,3 @@ printf("%s: exit\n", __FUNCTION__);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gemini_pci.c,v 1.19 2018/11/16 15:06:22 jmcneill Exp $ */
|
||||
/* $NetBSD: gemini_pci.c,v 1.20 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/* adapted from:
|
||||
* NetBSD: i80312_pci.c,v 1.9 2005/12/11 12:16:51 christos Exp
|
||||
@ -44,7 +44,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: gemini_pci.c,v 1.19 2018/11/16 15:06:22 jmcneill Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gemini_pci.c,v 1.20 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include "opt_gemini.h"
|
||||
#include "opt_pci.h"
|
||||
@ -117,12 +117,7 @@ gemini_pci_intrq_insert(void *ih, int (*func)(void *), void *arg)
|
||||
{
|
||||
struct gemini_pci_intrq *iqp;
|
||||
|
||||
iqp = malloc(sizeof(*iqp), M_DEVBUF, M_NOWAIT|M_ZERO);
|
||||
if (iqp == NULL) {
|
||||
printf("gemini_pci_intrq_insert: malloc failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
iqp = malloc(sizeof(*iqp), M_DEVBUF, M_WAITOK|M_ZERO);
|
||||
iqp->iq_func = func;
|
||||
iqp->iq_arg = arg;
|
||||
iqp->iq_ih = ih;
|
||||
@ -406,11 +401,6 @@ gemini_pci_intr_establish(void *v, pci_intr_handle_t pci_ih, int ipl,
|
||||
gemini_pci_intr_handler, v, xname);
|
||||
|
||||
cookie = gemini_pci_intrq_insert(ih, func, arg);
|
||||
if (cookie == NULL) {
|
||||
if (gemini_pci_intrq_empty())
|
||||
intr_disestablish(ih);
|
||||
}
|
||||
|
||||
return cookie;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: imx51_ipuv3.c,v 1.7 2018/03/17 18:34:09 ryo Exp $ */
|
||||
/* $NetBSD: imx51_ipuv3.c,v 1.8 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, 2012 Genetec Corporation. All rights reserved.
|
||||
@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: imx51_ipuv3.c,v 1.7 2018/03/17 18:34:09 ryo Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: imx51_ipuv3.c,v 1.8 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include "opt_imx51_ipuv3.h"
|
||||
|
||||
@ -932,12 +932,7 @@ imx51_ipuv3_new_screen(struct imx51_ipuv3_softc *sc,
|
||||
width = geometry->panel_width;
|
||||
height = geometry->panel_height;
|
||||
|
||||
scr = malloc(sizeof(*scr), M_DEVBUF, M_NOWAIT);
|
||||
if (scr == NULL)
|
||||
return ENOMEM;
|
||||
|
||||
memset(scr, 0, sizeof(*scr));
|
||||
|
||||
scr = malloc(sizeof(*scr), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
scr->nsegs = 0;
|
||||
scr->depth = depth;
|
||||
scr->stride = width * depth / 8;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: imxuart.c,v 1.21 2018/06/20 07:08:35 hkenken Exp $ */
|
||||
/* $NetBSD: imxuart.c,v 1.22 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009, 2010 Genetec Corporation. All rights reserved.
|
||||
@ -96,7 +96,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.21 2018/06/20 07:08:35 hkenken Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.22 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include "opt_imxuart.h"
|
||||
#include "opt_ddb.h"
|
||||
@ -355,15 +355,9 @@ imxuart_attach_subr(struct imxuart_softc *sc)
|
||||
|
||||
sc->sc_tty = tp;
|
||||
sc->sc_rbuf = malloc(sizeof (*sc->sc_rbuf) * imxuart_rbuf_size,
|
||||
M_DEVBUF, M_NOWAIT);
|
||||
M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbuf_size = imxuart_rbuf_size;
|
||||
sc->sc_rbuf_in = sc->sc_rbuf_out = 0;
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
aprint_error_dev(sc->sc_dev,
|
||||
"unable to allocate ring buffer\n");
|
||||
return;
|
||||
}
|
||||
|
||||
sc->sc_txfifo_len = 32;
|
||||
sc->sc_txfifo_thresh = 16; /* when USR1.TRDY, fifo has space
|
||||
* for this many characters */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: iomd_irqhandler.c,v 1.22 2014/10/25 10:58:12 skrll Exp $ */
|
||||
/* $NetBSD: iomd_irqhandler.c,v 1.23 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-1998 Mark Brinicombe.
|
||||
@ -40,7 +40,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.22 2014/10/25 10:58:12 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: iomd_irqhandler.c,v 1.23 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include "opt_irqstats.h"
|
||||
|
||||
@ -346,10 +346,7 @@ intr_claim(int irq, int level, const char *name, int (*ih_func)(void *),
|
||||
{
|
||||
irqhandler_t *ih;
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (!ih)
|
||||
panic("intr_claim(): Cannot malloc handler memory");
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_level = level;
|
||||
ih->ih_name = name;
|
||||
ih->ih_func = ih_func;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: iomdkbc.c,v 1.5 2012/05/14 10:38:08 skrll Exp $ */
|
||||
/* $NetBSD: iomdkbc.c,v 1.6 2019/11/10 21:16:23 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2004 Ben Harris
|
||||
@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: iomdkbc.c,v 1.5 2012/05/14 10:38:08 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: iomdkbc.c,v 1.6 2019/11/10 21:16:23 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
@ -134,11 +134,7 @@ iomdkbc_attach(device_t parent, device_t self, void *aux)
|
||||
t = &iomdkbc_cntag;
|
||||
} else {
|
||||
t = malloc(sizeof(struct iomdkbc_internal), M_DEVBUF,
|
||||
M_NOWAIT | M_ZERO);
|
||||
if (t == NULL) {
|
||||
aprint_error(": no memory");
|
||||
return;
|
||||
}
|
||||
M_WAITOK | M_ZERO);
|
||||
t->t_haveport[PCKBPORT_KBD_SLOT] = 1;
|
||||
t->t_iot = ka->ka_iot;
|
||||
t->t_ioh[PCKBPORT_KBD_SLOT] = ka->ka_ioh;
|
||||
@ -156,11 +152,7 @@ iomdkbc_attach(device_t parent, device_t self, void *aux)
|
||||
if (strcmp(pa->pa_name, "opms") == 0) {
|
||||
if (t == NULL) {
|
||||
t = malloc(sizeof(struct iomdkbc_internal), M_DEVBUF,
|
||||
M_NOWAIT | M_ZERO);
|
||||
if (t == NULL) {
|
||||
aprint_error(": no memory");
|
||||
return;
|
||||
}
|
||||
M_WAITOK | M_ZERO);
|
||||
}
|
||||
t->t_haveport[PCKBPORT_AUX_SLOT] = 1;
|
||||
t->t_iot = pa->pa_iot;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ixp12x0_com.c,v 1.47 2015/04/13 21:18:41 riastradh Exp $ */
|
||||
/* $NetBSD: ixp12x0_com.c,v 1.48 2019/11/10 21:16:24 chs Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -66,7 +66,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.47 2015/04/13 21:18:41 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.48 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
@ -212,14 +212,9 @@ ixpcom_attach_subr(struct ixpcom_softc *sc)
|
||||
tp->t_hwiflow = ixpcomhwiflow;
|
||||
|
||||
sc->sc_tty = tp;
|
||||
sc->sc_rbuf = malloc(IXPCOM_RING_SIZE << 1, M_DEVBUF, M_NOWAIT);
|
||||
sc->sc_rbuf = malloc(IXPCOM_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
|
||||
sc->sc_rbavail = IXPCOM_RING_SIZE;
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
printf("%s: unable to allocate ring buffer\n",
|
||||
device_xname(sc->sc_dev));
|
||||
return;
|
||||
}
|
||||
sc->sc_ebuf = sc->sc_rbuf + (IXPCOM_RING_SIZE << 1);
|
||||
sc->sc_tbc = 0;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ixp12x0_intr.c,v 1.31 2015/04/08 08:35:54 ozaki-r Exp $ */
|
||||
/* $NetBSD: ixp12x0_intr.c,v 1.32 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_intr.c,v 1.31 2015/04/08 08:35:54 ozaki-r Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ixp12x0_intr.c,v 1.32 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
/*
|
||||
* Interrupt support for the Intel ixp12x0
|
||||
@ -342,10 +342,7 @@ ixp12x0_intr_establish(int irq, int ipl, int (*ih_func)(void *), void *arg)
|
||||
if (ipl < 0 || ipl > NIPL)
|
||||
panic("ixp12x0_intr_establish: IPL %d out of range", ipl);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = ih_func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_irq = irq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ofw_irqhandler.c,v 1.21 2014/09/21 15:47:29 christos Exp $ */
|
||||
/* $NetBSD: ofw_irqhandler.c,v 1.22 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-1998 Mark Brinicombe.
|
||||
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ofw_irqhandler.c,v 1.21 2014/09/21 15:47:29 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ofw_irqhandler.c,v 1.22 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -292,10 +292,7 @@ intr_claim(int irq, int level, int (*ih_func)(void *), void *ih_arg, const char
|
||||
{
|
||||
irqhandler_t *ih;
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT|M_ZERO);
|
||||
if (!ih)
|
||||
panic("intr_claim(): Cannot malloc handler memory");
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK|M_ZERO);
|
||||
ih->ih_level = level;
|
||||
ih->ih_func = ih_func;
|
||||
ih->ih_arg = ih_arg;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: omap_gpio.c,v 1.8 2018/03/13 06:41:53 ryo Exp $ */
|
||||
/* $NetBSD: omap_gpio.c,v 1.9 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* The OMAP GPIO Controller interface is inspired by pxa2x0_gpio.c
|
||||
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: omap_gpio.c,v 1.8 2018/03/13 06:41:53 ryo Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: omap_gpio.c,v 1.9 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -275,10 +275,7 @@ omap_gpio_intr_establish(u_int gpio, int level, int spl,
|
||||
panic("omapgpio: Illegal shared interrupt on pin %d", gpio);
|
||||
}
|
||||
|
||||
gh = malloc(sizeof(struct gpio_irq_handler), M_DEVBUF, M_NOWAIT);
|
||||
if (gh == NULL)
|
||||
return gh;
|
||||
|
||||
gh = malloc(sizeof(struct gpio_irq_handler), M_DEVBUF, M_WAITOK);
|
||||
gh->gh_func = func;
|
||||
gh->gh_arg = arg;
|
||||
gh->gh_spl = spl;
|
||||
@ -510,4 +507,3 @@ omapgpio_intr(void *arg)
|
||||
|
||||
return (handled);
|
||||
}
|
||||
|
||||
|
@ -273,10 +273,10 @@ s3c2440_dma_intr(void *arg)
|
||||
}
|
||||
|
||||
dmac_xfer_t
|
||||
s3c2440_dmac_allocate_xfer(int flags) {
|
||||
s3c2440_dmac_allocate_xfer(void) {
|
||||
struct dmac_xfer_state *dxs;
|
||||
|
||||
dxs = malloc(sizeof(struct dmac_xfer_state), M_DEVBUF, flags);
|
||||
dxs = malloc(sizeof(struct dmac_xfer_state), M_DEVBUF, M_WAITOK);
|
||||
|
||||
dxs->dxs_xfer.dx_done = NULL;
|
||||
dxs->dxs_xfer.dx_sync_bus = DMAC_SYNC_BUS_AUTO;
|
||||
|
@ -115,7 +115,7 @@ struct dmac_xfer {
|
||||
};
|
||||
|
||||
/* DMA API, inspired by pxa2x0_dmac.h */
|
||||
dmac_xfer_t s3c2440_dmac_allocate_xfer(int);
|
||||
dmac_xfer_t s3c2440_dmac_allocate_xfer(void);
|
||||
void s3c2440_dmac_free_xfer(dmac_xfer_t);
|
||||
int s3c2440_dmac_start_xfer(dmac_xfer_t);
|
||||
void s3c2440_dmac_abort_xfer(dmac_xfer_t);
|
||||
|
@ -316,25 +316,13 @@ s3c2440_i2s_alloc(void *handle,
|
||||
int direction, size_t size, int flags,
|
||||
s3c2440_i2s_buf_t *out)
|
||||
{
|
||||
int kalloc_flags = KM_SLEEP;
|
||||
int dma_flags = BUS_DMA_WAITOK;
|
||||
int retval = 0;
|
||||
struct s3c2xx0_softc *sc = s3c2xx0_softc; /* Shortcut */
|
||||
s3c2440_i2s_buf_t buf;
|
||||
|
||||
DPRINTF(("%s\n", __func__));
|
||||
|
||||
if (flags & M_NOWAIT) {
|
||||
kalloc_flags = KM_NOSLEEP;
|
||||
dma_flags = BUS_DMA_NOWAIT;
|
||||
}
|
||||
|
||||
*out = kmem_alloc(sizeof(struct s3c2440_i2s_buf), kalloc_flags);
|
||||
if (*out == NULL) {
|
||||
DPRINTF(("Failed to allocate memory\n"));
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
*out = kmem_alloc(sizeof(struct s3c2440_i2s_buf), KM_SLEEP);
|
||||
buf = *out;
|
||||
buf->i2b_parent = handle;
|
||||
buf->i2b_size = size;
|
||||
@ -346,7 +334,7 @@ s3c2440_i2s_alloc(void *handle,
|
||||
/* We first allocate some DMA-friendly memory for the buffer... */
|
||||
retval = bus_dmamem_alloc(sc->sc_dmat, buf->i2b_size, NBPG, 0,
|
||||
buf->i2b_segs, buf->i2b_nsegs, &buf->i2b_nsegs,
|
||||
dma_flags);
|
||||
BUS_DMA_WAITOK);
|
||||
if (retval != 0) {
|
||||
printf("%s: Failed to allocate DMA memory\n", __func__);
|
||||
goto cleanup_dealloc;
|
||||
@ -355,7 +343,7 @@ s3c2440_i2s_alloc(void *handle,
|
||||
DPRINTF(("%s: Using %d DMA segments\n", __func__, buf->i2b_nsegs));
|
||||
|
||||
retval = bus_dmamem_map(sc->sc_dmat, buf->i2b_segs, buf->i2b_nsegs,
|
||||
buf->i2b_size, &buf->i2b_addr, dma_flags);
|
||||
buf->i2b_size, &buf->i2b_addr, BUS_DMA_WAITOK);
|
||||
|
||||
if (retval != 0) {
|
||||
printf("%s: Failed to map DMA memory\n", __func__);
|
||||
@ -367,7 +355,7 @@ s3c2440_i2s_alloc(void *handle,
|
||||
|
||||
/* XXX: Not sure if nsegments is really 1...*/
|
||||
retval = bus_dmamap_create(sc->sc_dmat, buf->i2b_size, 1,
|
||||
buf->i2b_size, 0, dma_flags,
|
||||
buf->i2b_size, 0, BUS_DMA_WAITOK,
|
||||
&buf->i2b_dmamap);
|
||||
if (retval != 0) {
|
||||
printf("%s: Failed to create DMA map\n", __func__);
|
||||
@ -376,15 +364,9 @@ s3c2440_i2s_alloc(void *handle,
|
||||
|
||||
DPRINTF(("%s: DMA map created successfully\n", __func__));
|
||||
|
||||
buf->i2b_xfer = s3c2440_dmac_allocate_xfer(M_NOWAIT);
|
||||
if (buf->i2b_xfer == NULL) {
|
||||
retval = ENOMEM;
|
||||
goto cleanup_destroy_dmamap;
|
||||
}
|
||||
buf->i2b_xfer = s3c2440_dmac_allocate_xfer();
|
||||
|
||||
return 0;
|
||||
cleanup_destroy_dmamap:
|
||||
bus_dmamap_destroy(sc->sc_dmat, buf->i2b_dmamap);
|
||||
cleanup_unmap_dma:
|
||||
bus_dmamem_unmap(sc->sc_dmat, &buf->i2b_addr, buf->i2b_size);
|
||||
cleanup_dealloc_dma:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: s3c2440_sdi.c,v 1.4 2015/05/25 15:04:01 christos Exp $ */
|
||||
/* $NetBSD: s3c2440_sdi.c,v 1.5 2019/11/10 21:16:24 chs Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2012 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -28,7 +28,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: s3c2440_sdi.c,v 1.4 2015/05/25 15:04:01 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: s3c2440_sdi.c,v 1.5 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
@ -236,7 +236,7 @@ sssdi_attach(device_t parent, device_t self, void *aux)
|
||||
/* Is it a good idea to get the private parts of sdmmc ? */
|
||||
sc->sdmmc = config_found(sc->dev, &saa, NULL);
|
||||
|
||||
sc->sc_xfer = s3c2440_dmac_allocate_xfer(M_NOWAIT);
|
||||
sc->sc_xfer = s3c2440_dmac_allocate_xfer();
|
||||
sc->sc_dr.ds_addr = S3C2440_SDI_BASE+SDI_DAT_LI_W;
|
||||
sc->sc_dr.ds_len = 4;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: s3c24x0_lcd.c,v 1.13 2018/09/03 16:29:23 riastradh Exp $ */
|
||||
/* $NetBSD: s3c24x0_lcd.c,v 1.14 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004 Genetec Corporation. All rights reserved.
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: s3c24x0_lcd.c,v 1.13 2018/09/03 16:29:23 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: s3c24x0_lcd.c,v 1.14 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -338,12 +338,7 @@ s3c24x0_lcd_new_screen(struct s3c24x0_lcd_softc *sc,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
scr = malloc(sizeof *scr, M_DEVBUF,
|
||||
M_ZERO | (cold ? M_NOWAIT : M_WAITOK));
|
||||
|
||||
if (scr == NULL)
|
||||
return NULL;
|
||||
|
||||
scr = malloc(sizeof *scr, M_DEVBUF, M_ZERO | M_WAITOK);
|
||||
scr->nsegs = 0;
|
||||
scr->depth = depth;
|
||||
scr->stride = virtual_width * depth / 8;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: s3c2800_pci.c,v 1.26 2018/11/26 12:21:51 jmcneill Exp $ */
|
||||
/* $NetBSD: s3c2800_pci.c,v 1.27 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Fujitsu Component Limited
|
||||
@ -100,7 +100,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: s3c2800_pci.c,v 1.26 2018/11/26 12:21:51 jmcneill Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: s3c2800_pci.c,v 1.27 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include "opt_pci.h"
|
||||
#include "pci.h"
|
||||
@ -519,10 +519,7 @@ s3c2800_pci_intr_establish(void *pcv, pci_intr_handle_t ih, int level,
|
||||
"func=%p, arg=%p, xname=%s)\n", pcv, ih, level, func, arg, xname);
|
||||
#endif
|
||||
|
||||
handler = malloc(sizeof *handler, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
|
||||
if (handler == NULL)
|
||||
panic("sspci_intr_establish: can't malloc handler info");
|
||||
|
||||
handler = malloc(sizeof *handler, M_DEVBUF, M_WAITOK);
|
||||
handler->func = func;
|
||||
handler->arg = arg;
|
||||
handler->level = level;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sscom.c,v 1.47 2015/04/13 21:18:41 riastradh Exp $ */
|
||||
/* $NetBSD: sscom.c,v 1.48 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002, 2003 Fujitsu Component Limited
|
||||
@ -98,7 +98,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.47 2015/04/13 21:18:41 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sscom.c,v 1.48 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include "opt_sscom.h"
|
||||
#include "opt_ddb.h"
|
||||
@ -481,14 +481,9 @@ sscom_attach_subr(struct sscom_softc *sc)
|
||||
tp->t_hwiflow = sscomhwiflow;
|
||||
|
||||
sc->sc_tty = tp;
|
||||
sc->sc_rbuf = malloc(sscom_rbuf_size << 1, M_DEVBUF, M_NOWAIT);
|
||||
sc->sc_rbuf = malloc(sscom_rbuf_size << 1, M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
|
||||
sc->sc_rbavail = sscom_rbuf_size;
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
printf("%s: unable to allocate ring buffer\n",
|
||||
device_xname(sc->sc_dev));
|
||||
return;
|
||||
}
|
||||
sc->sc_ebuf = sc->sc_rbuf + (sscom_rbuf_size << 1);
|
||||
|
||||
tty_attach(tp);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sa1111.c,v 1.24 2011/07/01 20:31:39 dyoung Exp $ */
|
||||
/* $NetBSD: sa1111.c,v 1.25 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -35,7 +35,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sa1111.c,v 1.24 2011/07/01 20:31:39 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sa1111.c,v 1.25 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -124,10 +124,7 @@ sacc_intr_establish(sacc_chipset_tag_t *ic, int irq, int type, int level,
|
||||
struct sacc_softc *sc = (struct sacc_softc *)ic;
|
||||
struct sacc_intrhand **p, *ih;
|
||||
|
||||
/* no point in sleeping unless someone can free memory. */
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
|
||||
if (ih == NULL)
|
||||
panic("sacc_intr_establish: can't malloc handler info");
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
|
||||
|
||||
if (irq < 0 || irq > SACCIC_LEN ||
|
||||
!(type == IST_EDGE_RAISE || type == IST_EDGE_FALL))
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sa11x0_com.c,v 1.56 2018/09/21 12:04:07 skrll Exp $ */
|
||||
/* $NetBSD: sa11x0_com.c,v 1.57 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc.
|
||||
@ -64,7 +64,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.56 2018/09/21 12:04:07 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.57 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include "opt_com.h"
|
||||
#include "opt_console.h"
|
||||
@ -311,13 +311,9 @@ sacom_attach_subr(struct sacom_softc *sc)
|
||||
tp->t_hwiflow = sacomhwiflow;
|
||||
|
||||
sc->sc_tty = tp;
|
||||
sc->sc_rbuf = malloc(SACOM_RING_SIZE << 1, M_DEVBUF, M_NOWAIT);
|
||||
sc->sc_rbuf = malloc(SACOM_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
|
||||
sc->sc_rbavail = SACOM_RING_SIZE;
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
aprint_normal_dev(sc->sc_dev, "unable to allocate ring buffer\n");
|
||||
return;
|
||||
}
|
||||
sc->sc_ebuf = sc->sc_rbuf + (SACOM_RING_SIZE << 1);
|
||||
sc->sc_tbc = 0;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sa11x0_irqhandler.c,v 1.18 2012/09/01 14:48:05 matt Exp $ */
|
||||
/* $NetBSD: sa11x0_irqhandler.c,v 1.19 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
|
||||
@ -69,7 +69,7 @@
|
||||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sa11x0_irqhandler.c,v 1.18 2012/09/01 14:48:05 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sa11x0_irqhandler.c,v 1.19 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include "opt_irqstats.h"
|
||||
|
||||
@ -167,10 +167,7 @@ sa11x0_intr_establish(sa11x0_chipset_tag_t ic, int irq, int type, int level,
|
||||
struct irqhandler **p, *q, *ih;
|
||||
static struct irqhandler fakehand = {fakeintr};
|
||||
|
||||
/* no point in sleeping unless someone can free memory. */
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
|
||||
if (ih == NULL)
|
||||
panic("sa11x0_intr_establish: can't malloc handler info");
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
|
||||
|
||||
if (irq < 0 || irq >= ICU_LEN || type == IST_NONE)
|
||||
panic("intr_establish: bogus irq or type");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: zynq_uart.c,v 1.1 2019/06/11 13:01:48 skrll Exp $ */
|
||||
/* $NetBSD: zynq_uart.c,v 1.2 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 Genetec Corporation. All rights reserved.
|
||||
@ -96,7 +96,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: zynq_uart.c,v 1.1 2019/06/11 13:01:48 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: zynq_uart.c,v 1.2 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include "opt_soc.h"
|
||||
#include "opt_console.h"
|
||||
@ -413,15 +413,9 @@ zynquart_attach_common(device_t parent, device_t self,
|
||||
|
||||
sc->sc_tty = tp;
|
||||
sc->sc_rbuf = malloc(sizeof (*sc->sc_rbuf) * zynquart_rbuf_size,
|
||||
M_DEVBUF, M_NOWAIT);
|
||||
M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbuf_size = zynquart_rbuf_size;
|
||||
sc->sc_rbuf_in = sc->sc_rbuf_out = 0;
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
aprint_error_dev(sc->sc_dev,
|
||||
"unable to allocate ring buffer\n");
|
||||
return;
|
||||
}
|
||||
|
||||
sc->sc_txfifo_len = 64;
|
||||
sc->sc_txfifo_thresh = 32;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: becc_icu.c,v 1.13 2012/08/02 15:56:07 skrll Exp $ */
|
||||
/* $NetBSD: becc_icu.c,v 1.14 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Wasabi Systems, Inc.
|
||||
@ -40,7 +40,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: becc_icu.c,v 1.13 2012/08/02 15:56:07 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: becc_icu.c,v 1.14 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#ifndef EVBARM_SPL_NOINLINE
|
||||
#define EVBARM_SPL_NOINLINE
|
||||
@ -293,10 +293,7 @@ becc_intr_establish(int irq, int ipl, int (*func)(void *), void *arg)
|
||||
if (irq < 0 || irq > NIRQ)
|
||||
panic("becc_intr_establish: IRQ %d out of range", irq);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_ipl = ipl;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: i80321_icu.c,v 1.24 2012/08/02 15:56:07 skrll Exp $ */
|
||||
/* $NetBSD: i80321_icu.c,v 1.25 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2002, 2006 Wasabi Systems, Inc.
|
||||
@ -36,7 +36,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.24 2012/08/02 15:56:07 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.25 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#ifndef EVBARM_SPL_NOINLINE
|
||||
#define EVBARM_SPL_NOINLINE
|
||||
@ -309,10 +309,7 @@ i80321_intr_establish(int irq, int ipl, int (*func)(void *), void *arg)
|
||||
if (irq < 0 || irq > NIRQ)
|
||||
panic("i80321_intr_establish: IRQ %d out of range", irq);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_ipl = ipl;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ixp425_if_npe.c,v 1.42 2019/09/13 07:55:06 msaitoh Exp $ */
|
||||
/* $NetBSD: ixp425_if_npe.c,v 1.43 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Sam Leffler. All rights reserved.
|
||||
@ -28,7 +28,7 @@
|
||||
#if 0
|
||||
__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/if_npe.c,v 1.1 2006/11/19 23:55:23 sam Exp $");
|
||||
#endif
|
||||
__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.42 2019/09/13 07:55:06 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ixp425_if_npe.c,v 1.43 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
/*
|
||||
* Intel XScale NPE Ethernet driver.
|
||||
@ -465,23 +465,13 @@ npe_dma_setup(struct npe_softc *sc, struct npedma *dma,
|
||||
aprint_error_dev(sc->sc_dev,
|
||||
"unable to %s for %s %s buffers, error %u\n",
|
||||
"load map", dma->name, "h/w", error);
|
||||
destroy_dmamap:
|
||||
bus_dmamap_destroy(sc->sc_dt, dma->buf_map);
|
||||
goto unmap_dmamem;
|
||||
}
|
||||
|
||||
/* XXX M_TEMP */
|
||||
dma->buf = malloc(nbuf * sizeof(struct npebuf), M_TEMP,
|
||||
M_NOWAIT | M_ZERO);
|
||||
if (dma->buf == NULL) {
|
||||
aprint_error_dev(sc->sc_dev,
|
||||
"unable to %s for %s %s buffers, error %u\n",
|
||||
"allocate memory", dma->name, "h/w", error);
|
||||
bus_dmamap_unload(sc->sc_dt, dma->buf_map);
|
||||
error = ENOMEM;
|
||||
goto destroy_dmamap;
|
||||
}
|
||||
|
||||
M_WAITOK | M_ZERO);
|
||||
dma->buf_phys = dma->buf_map->dm_segs[0].ds_addr;
|
||||
for (i = 0; i < dma->nbuf; i++) {
|
||||
struct npebuf *npe = &dma->buf[i];
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ixp425_intr.c,v 1.26 2014/03/26 08:52:00 christos Exp $ */
|
||||
/* $NetBSD: ixp425_intr.c,v 1.27 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003
|
||||
@ -62,7 +62,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ixp425_intr.c,v 1.26 2014/03/26 08:52:00 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ixp425_intr.c,v 1.27 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#ifndef EVBARM_SPL_NOINLINE
|
||||
#define EVBARM_SPL_NOINLINE
|
||||
@ -343,10 +343,7 @@ ixp425_intr_establish(int irq, int ipl, int (*func)(void *), void *arg)
|
||||
irq, ipl, (uint32_t) func, (uint32_t) arg);
|
||||
#endif
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_ipl = ipl;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ixp425_qmgr.c,v 1.8 2019/06/03 06:04:20 msaitoh Exp $ */
|
||||
/* $NetBSD: ixp425_qmgr.c,v 1.9 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Sam Leffler, Errno Consulting
|
||||
@ -60,7 +60,7 @@
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
/*__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425_qmgr.c,v 1.1 2006/11/19 23:55:23 sam Exp $");*/
|
||||
__KERNEL_RCSID(0, "$NetBSD: ixp425_qmgr.c,v 1.8 2019/06/03 06:04:20 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ixp425_qmgr.c,v 1.9 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
/*
|
||||
* Intel XScale Queue Manager support.
|
||||
@ -229,10 +229,7 @@ ixpqmgr_init(bus_space_tag_t iot)
|
||||
sc->sc_dev = dev;
|
||||
sc->sc_iot = sa->sc_iot;
|
||||
#else
|
||||
sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (sc == NULL)
|
||||
return (NULL);
|
||||
|
||||
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
sc->sc_iot = iot;
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pxa2x0_gpio.c,v 1.17 2017/06/16 22:39:34 pgoyette Exp $ */
|
||||
/* $NetBSD: pxa2x0_gpio.c,v 1.18 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2003 Wasabi Systems, Inc.
|
||||
@ -36,7 +36,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pxa2x0_gpio.c,v 1.17 2017/06/16 22:39:34 pgoyette Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pxa2x0_gpio.c,v 1.18 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include "gpio.h"
|
||||
#include "opt_pxa2x0_gpio.h"
|
||||
@ -280,8 +280,7 @@ pxa2x0_gpio_intr_establish(u_int gpio, int level, int spl, int (*func)(void *),
|
||||
if (sc->sc_handlers[gpio] != NULL)
|
||||
panic("pxa2x0_gpio_intr_establish: illegal shared interrupt");
|
||||
|
||||
gh = malloc(sizeof(struct gpio_irq_handler), M_DEVBUF, M_NOWAIT);
|
||||
|
||||
gh = malloc(sizeof(struct gpio_irq_handler), M_DEVBUF, M_WAITOK);
|
||||
gh->gh_func = func;
|
||||
gh->gh_arg = arg;
|
||||
gh->gh_spl = spl;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pxa2x0_lcd.c,v 1.36 2015/10/17 16:34:43 jmcneill Exp $ */
|
||||
/* $NetBSD: pxa2x0_lcd.c,v 1.37 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Genetec Corporation. All rights reserved.
|
||||
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.36 2015/10/17 16:34:43 jmcneill Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pxa2x0_lcd.c,v 1.37 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include "opt_pxa2x0_lcd.h"
|
||||
|
||||
@ -515,12 +515,7 @@ pxa2x0_lcd_new_screen(struct pxa2x0_lcd_softc *sc, int depth,
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
scr = malloc(sizeof(*scr), M_DEVBUF, M_NOWAIT);
|
||||
if (scr == NULL)
|
||||
return ENOMEM;
|
||||
|
||||
memset(scr, 0, sizeof(*scr));
|
||||
|
||||
scr = malloc(sizeof(*scr), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
scr->nsegs = 0;
|
||||
scr->depth = depth;
|
||||
scr->buf_size = size;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: zynq_uart.c,v 1.2 2015/04/13 21:18:41 riastradh Exp $ */
|
||||
/* $NetBSD: zynq_uart.c,v 1.3 2019/11/10 21:16:24 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 Genetec Corporation. All rights reserved.
|
||||
@ -96,7 +96,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: zynq_uart.c,v 1.2 2015/04/13 21:18:41 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: zynq_uart.c,v 1.3 2019/11/10 21:16:24 chs Exp $");
|
||||
|
||||
#include "opt_zynq.h"
|
||||
#include "opt_zynquart.h"
|
||||
@ -423,15 +423,9 @@ zynquart_attach_common(device_t parent, device_t self,
|
||||
|
||||
sc->sc_tty = tp;
|
||||
sc->sc_rbuf = malloc(sizeof (*sc->sc_rbuf) * zynquart_rbuf_size,
|
||||
M_DEVBUF, M_NOWAIT);
|
||||
M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbuf_size = zynquart_rbuf_size;
|
||||
sc->sc_rbuf_in = sc->sc_rbuf_out = 0;
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
aprint_error_dev(sc->sc_dev,
|
||||
"unable to allocate ring buffer\n");
|
||||
return;
|
||||
}
|
||||
|
||||
sc->sc_txfifo_len = 64;
|
||||
sc->sc_txfifo_thresh = 32;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: be_bus.c,v 1.15 2011/07/01 20:34:05 dyoung Exp $ */
|
||||
/* $NetBSD: be_bus.c,v 1.16 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: be_bus.c,v 1.15 2011/07/01 20:34:05 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: be_bus.c,v 1.16 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
@ -183,8 +183,7 @@ beb_alloc_bus_space_tag(bus_space_tag_t storage)
|
||||
if (storage != NULL)
|
||||
beb_t = storage;
|
||||
else {
|
||||
if ((beb_t = malloc(sizeof(*beb_t), M_TEMP, M_NOWAIT)) == NULL)
|
||||
return NULL;
|
||||
beb_t = malloc(sizeof(*beb_t), M_TEMP, M_WAITOK);
|
||||
}
|
||||
memset(beb_t, 0, sizeof(*beb_t));
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: intr.c,v 1.26 2014/10/18 08:33:24 snj Exp $ */
|
||||
/* $NetBSD: intr.c,v 1.27 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.26 2014/10/18 08:33:24 snj Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.27 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -113,13 +113,7 @@ intr_establish(int vector, int type, int pri, hw_ifun_t ih_fun, void *ih_arg)
|
||||
int s;
|
||||
|
||||
/* no point in sleeping unless someone can free memory. */
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
|
||||
if (ih == NULL)
|
||||
panic("intr_establish: can't malloc handler info");
|
||||
|
||||
/*
|
||||
* Initialize vector info
|
||||
*/
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
|
||||
ih->ih_fun = ih_fun;
|
||||
ih->ih_arg = ih_arg;
|
||||
ih->ih_type = type;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: le_bus.c,v 1.19 2016/10/13 06:48:07 maya Exp $ */
|
||||
/* $NetBSD: le_bus.c,v 1.20 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: le_bus.c,v 1.19 2016/10/13 06:48:07 maya Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: le_bus.c,v 1.20 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
@ -267,8 +267,7 @@ leb_alloc_bus_space_tag(bus_space_tag_t storage)
|
||||
if (storage != NULL)
|
||||
leb_t = storage;
|
||||
else {
|
||||
if ((leb_t = malloc(sizeof(*leb_t), M_TEMP, M_NOWAIT)) == NULL)
|
||||
return NULL;
|
||||
leb_t = malloc(sizeof(*leb_t), M_TEMP, M_WAITOK);
|
||||
}
|
||||
memset(leb_t, 0, sizeof(*leb_t));
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mainbus.c,v 1.11 2011/07/01 20:34:05 dyoung Exp $ */
|
||||
/* $NetBSD: mainbus.c,v 1.12 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.11 2011/07/01 20:34:05 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.12 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
@ -168,10 +168,7 @@ mb_alloc_bus_space_tag(void)
|
||||
bus_space_tag_t mb_t;
|
||||
|
||||
/* Not really M_TEMP, is it.. */
|
||||
mb_t = malloc(sizeof(*mb_t), M_TEMP, M_NOWAIT|M_ZERO);
|
||||
if (mb_t == NULL)
|
||||
return NULL;
|
||||
|
||||
mb_t = malloc(sizeof(*mb_t), M_TEMP, M_WAITOK|M_ZERO);
|
||||
mb_t->abs_p_1 = mb_bus_space_peek_1;
|
||||
mb_t->abs_p_2 = mb_bus_space_peek_2;
|
||||
mb_t->abs_p_4 = mb_bus_space_peek_4;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hdfd.c,v 1.85 2019/06/29 16:41:18 tsutsui Exp $ */
|
||||
/* $NetBSD: hdfd.c,v 1.86 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 Leo Weppelman
|
||||
@ -91,7 +91,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.85 2019/06/29 16:41:18 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.86 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
|
||||
@ -1427,10 +1427,7 @@ fdioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l)
|
||||
}
|
||||
|
||||
fd_formb = malloc(sizeof(struct ne7_fd_formb),
|
||||
M_TEMP, M_NOWAIT);
|
||||
if (fd_formb == 0)
|
||||
return ENOMEM;
|
||||
|
||||
M_TEMP, M_WAITOK);
|
||||
fd_formb->head = form_cmd->head;
|
||||
fd_formb->cyl = form_cmd->cylinder;
|
||||
fd_formb->transfer_rate = fd->sc_type->rate;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mainbus.c,v 1.29 2012/01/27 18:52:52 para Exp $ */
|
||||
/* $NetBSD: mainbus.c,v 1.30 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.29 2012/01/27 18:52:52 para Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.30 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/extent.h>
|
||||
@ -121,13 +121,11 @@ mainbus_attach(device_t parent, device_t self, void *aux)
|
||||
|
||||
#if NPCI > 0
|
||||
genppc_pct = malloc(sizeof(struct genppc_pci_chipset), M_DEVBUF,
|
||||
M_NOWAIT);
|
||||
KASSERT(genppc_pct != NULL);
|
||||
M_WAITOK);
|
||||
bebox_pci_get_chipset_tag(genppc_pct);
|
||||
|
||||
pbi = malloc(sizeof(struct genppc_pci_chipset_businfo),
|
||||
M_DEVBUF, M_NOWAIT);
|
||||
KASSERT(pbi != NULL);
|
||||
M_DEVBUF, M_WAITOK);
|
||||
pbi->pbi_properties = prop_dictionary_create();
|
||||
KASSERT(pbi->pbi_properties != NULL);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pic_bebox.c,v 1.10 2012/10/20 14:56:31 kiyohara Exp $ */
|
||||
/* $NetBSD: pic_bebox.c,v 1.11 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pic_bebox.c,v 1.10 2012/10/20 14:56:31 kiyohara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pic_bebox.c,v 1.11 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include "opt_multiprocessor.h"
|
||||
|
||||
@ -57,9 +57,7 @@ setup_bebox_intr(void)
|
||||
{
|
||||
struct pic_ops *pic;
|
||||
|
||||
pic = malloc(sizeof(struct pic_ops), M_DEVBUF, M_NOWAIT);
|
||||
KASSERT(pic != NULL);
|
||||
|
||||
pic = malloc(sizeof(struct pic_ops), M_DEVBUF, M_WAITOK);
|
||||
pic->pic_numintrs = 32;
|
||||
pic->pic_cookie = (void *)BEBOX_REG;
|
||||
pic->pic_enable_irq = bebox_enable_irq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: isr.c,v 1.16 2010/12/20 00:25:30 matt Exp $ */
|
||||
/* $NetBSD: isr.c,v 1.17 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.16 2010/12/20 00:25:30 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.17 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -76,11 +76,7 @@ isrlink(int (*func)(void *), void *arg, int ipl, int priority)
|
||||
if ((ipl < 0) || (ipl >= NISR))
|
||||
panic("isrlink: bad ipl %d", ipl);
|
||||
|
||||
newisr = (struct isr *)malloc(sizeof(struct isr), M_DEVBUF, M_NOWAIT);
|
||||
if (newisr == NULL)
|
||||
panic("isrlink: can't allocate space for isr");
|
||||
|
||||
/* Fill in the new entry. */
|
||||
newisr = malloc(sizeof(struct isr), M_DEVBUF, M_WAITOK);
|
||||
newisr->isr_func = func;
|
||||
newisr->isr_arg = arg;
|
||||
newisr->isr_ipl = ipl;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: zs.c,v 1.19 2014/03/24 18:56:43 christos Exp $ */
|
||||
/* $NetBSD: zs.c,v 1.20 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.19 2014/03/24 18:56:43 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.20 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
|
||||
@ -124,7 +124,7 @@ zs_config(struct zsc_softc *zsc, char *base)
|
||||
cs = &zs_conschan_store;
|
||||
} else {
|
||||
cs = malloc(sizeof(struct zs_chanstate),
|
||||
M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
if(channel==0){
|
||||
cs->cs_reg_csr = base + 7;
|
||||
cs->cs_reg_data = base + 15;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: interrupt.c,v 1.9 2018/06/06 01:49:07 maya Exp $ */
|
||||
/* $NetBSD: interrupt.c,v 1.10 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Izumi Tsutsui. All rights reserved.
|
||||
@ -79,7 +79,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.9 2018/06/06 01:49:07 maya Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.10 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#define __INTR_PRIVATE
|
||||
|
||||
@ -265,10 +265,7 @@ icu_intr_establish(int irq, int type, int ipl, int (*func)(void *), void *arg)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return NULL;
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_irq = irq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: wmcom.c,v 1.7 2018/09/03 16:29:24 riastradh Exp $ */
|
||||
/* $NetBSD: wmcom.c,v 1.8 2019/11/10 21:16:25 chs Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2012 KIYOHARA Takashi
|
||||
* All rights reserved.
|
||||
@ -25,7 +25,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: wmcom.c,v 1.7 2018/09/03 16:29:24 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: wmcom.c,v 1.8 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include "rnd.h"
|
||||
|
||||
@ -199,11 +199,7 @@ wmcom_attach(device_t parent, device_t self, void *aux)
|
||||
sc->sc_tty->t_hwiflow = wmcom_hwiflow;
|
||||
|
||||
sc->sc_tbc = 0;
|
||||
sc->sc_rbuf = malloc(WMCOM_RING_SIZE << 1, M_DEVBUF, M_NOWAIT);
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
aprint_error_dev(self, "unable to allocate ring buffer\n");
|
||||
return;
|
||||
}
|
||||
sc->sc_rbuf = malloc(WMCOM_RING_SIZE << 1, M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
|
||||
sc->sc_rbavail = WMCOM_RING_SIZE;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: plcom.c,v 1.59 2019/07/23 15:56:14 jmcneill Exp $ */
|
||||
/* $NetBSD: plcom.c,v 1.60 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 ARM Ltd
|
||||
@ -94,7 +94,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.59 2019/07/23 15:56:14 jmcneill Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.60 2019/11/10 21:16:25 chs Exp $");
|
||||
|
||||
#include "opt_plcom.h"
|
||||
#include "opt_ddb.h"
|
||||
@ -514,14 +514,9 @@ plcom_attach_subr(struct plcom_softc *sc)
|
||||
tp->t_hwiflow = plcomhwiflow;
|
||||
|
||||
sc->sc_tty = tp;
|
||||
sc->sc_rbuf = malloc(plcom_rbuf_size << 1, M_DEVBUF, M_NOWAIT);
|
||||
sc->sc_rbuf = malloc(plcom_rbuf_size << 1, M_DEVBUF, M_WAITOK);
|
||||
sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
|
||||
sc->sc_rbavail = plcom_rbuf_size;
|
||||
if (sc->sc_rbuf == NULL) {
|
||||
aprint_error_dev(sc->sc_dev,
|
||||
"unable to allocate ring buffer\n");
|
||||
return;
|
||||
}
|
||||
sc->sc_ebuf = sc->sc_rbuf + (plcom_rbuf_size << 1);
|
||||
|
||||
tty_attach(tp);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ifpga_intr.c,v 1.10 2015/02/09 21:56:20 skrll Exp $ */
|
||||
/* $NetBSD: ifpga_intr.c,v 1.11 2019/11/10 21:16:25 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
|
||||
@ -255,10 +255,7 @@ ifpga_intr_establish(int irq, int ipl, int (*func)(void *), void *arg)
|
||||
if (irq < 0 || irq > NIRQ)
|
||||
panic("ifpga_intr_establish: IRQ %d out of range", irq);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_ipl = ipl;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: iq80310_intr.c,v 1.34 2014/03/26 17:40:03 christos Exp $ */
|
||||
/* $NetBSD: iq80310_intr.c,v 1.35 2019/11/10 21:16:26 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
|
||||
@ -36,7 +36,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: iq80310_intr.c,v 1.34 2014/03/26 17:40:03 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: iq80310_intr.c,v 1.35 2019/11/10 21:16:26 chs Exp $");
|
||||
|
||||
#ifndef EVBARM_SPL_NOINLINE
|
||||
#define EVBARM_SPL_NOINLINE
|
||||
@ -373,10 +373,7 @@ iq80310_intr_establish(int irq, int ipl, int (*func)(void *), void *arg)
|
||||
if (irq < 0 || irq > NIRQ)
|
||||
panic("iq80310_intr_establish: IRQ %d out of range", irq);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_ipl = ipl;
|
||||
|
@ -131,7 +131,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mini2440_machdep.c,v 1.15 2019/07/16 14:41:47 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mini2440_machdep.c,v 1.16 2019/11/10 21:16:26 chs Exp $");
|
||||
|
||||
#include "opt_arm_debug.h"
|
||||
#include "opt_console.h"
|
||||
@ -1026,9 +1026,7 @@ s3c2xx0_bus_dma_init(struct arm32_bus_dma_tag *dma_tag_template)
|
||||
#if 1
|
||||
dmat = dma_tag_template;
|
||||
#else
|
||||
dmat = malloc(sizeof *dmat, M_DEVBUF, M_NOWAIT);
|
||||
if (dmat == NULL)
|
||||
return NULL;
|
||||
dmat = malloc(sizeof *dmat, M_DEVBUF, M_WAITOK);
|
||||
*dmat = *dma_tag_template;
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: smdk2410_machdep.c,v 1.41 2019/07/16 14:41:48 skrll Exp $ */
|
||||
/* $NetBSD: smdk2410_machdep.c,v 1.42 2019/11/10 21:16:26 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002, 2003 Fujitsu Component Limited
|
||||
@ -105,7 +105,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: smdk2410_machdep.c,v 1.41 2019/07/16 14:41:48 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: smdk2410_machdep.c,v 1.42 2019/11/10 21:16:26 chs Exp $");
|
||||
|
||||
#include "opt_arm_debug.h"
|
||||
#include "opt_console.h"
|
||||
@ -993,9 +993,7 @@ s3c2xx0_bus_dma_init(struct arm32_bus_dma_tag *dma_tag_template)
|
||||
#if 1
|
||||
dmat = dma_tag_template;
|
||||
#else
|
||||
dmat = malloc(sizeof *dmat, M_DEVBUF, M_NOWAIT);
|
||||
if (dmat == NULL)
|
||||
return NULL;
|
||||
dmat = malloc(sizeof *dmat, M_DEVBUF, M_WAITOK);
|
||||
*dmat = *dma_tag_template;
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gdium_intr.c,v 1.8 2016/08/26 15:45:47 skrll Exp $ */
|
||||
/* $NetBSD: gdium_intr.c,v 1.9 2019/11/10 21:16:26 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: gdium_intr.c,v 1.8 2016/08/26 15:45:47 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gdium_intr.c,v 1.9 2019/11/10 21:16:26 chs Exp $");
|
||||
|
||||
#define __INTR_PRIVATE
|
||||
|
||||
@ -239,10 +239,7 @@ evbmips_intr_establish(int irq, int (*func)(void *), void *arg)
|
||||
|
||||
KASSERT(irq == irqmap->irqidx);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT|M_ZERO);
|
||||
if (ih == NULL)
|
||||
return NULL;
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK|M_ZERO);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_irq = irq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: loongson_intr.c,v 1.6 2016/08/27 05:53:40 skrll Exp $ */
|
||||
/* $NetBSD: loongson_intr.c,v 1.7 2019/11/10 21:16:26 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: loongson_intr.c,v 1.6 2016/08/27 05:53:40 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: loongson_intr.c,v 1.7 2019/11/10 21:16:26 chs Exp $");
|
||||
|
||||
#define __INTR_PRIVATE
|
||||
|
||||
@ -295,10 +295,7 @@ evbmips_intr_establish(int irq, int (*func)(void *), void *arg)
|
||||
KASSERT(irq < BONITO_NINTS);
|
||||
DPRINTF(("loongson_intr_establish %d %p", irq, func));
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT|M_ZERO);
|
||||
if (ih == NULL)
|
||||
return NULL;
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK|M_ZERO);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_irq = irq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: malta_intr.c,v 1.25 2016/08/26 15:45:48 skrll Exp $ */
|
||||
/* $NetBSD: malta_intr.c,v 1.26 2019/11/10 21:16:26 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001, 2002 Wasabi Systems, Inc.
|
||||
@ -40,7 +40,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: malta_intr.c,v 1.25 2016/08/26 15:45:48 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: malta_intr.c,v 1.26 2019/11/10 21:16:26 chs Exp $");
|
||||
|
||||
#define __INTR_PRIVATE
|
||||
|
||||
@ -206,10 +206,7 @@ evbmips_intr_establish(int irq, int (*func)(void *), void *arg)
|
||||
struct evbmips_intrhand *ih;
|
||||
int s;
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pcib.c,v 1.18 2014/03/29 19:28:28 christos Exp $ */
|
||||
/* $NetBSD: pcib.c,v 1.19 2019/11/10 21:16:26 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2002 Wasabi Systems, Inc.
|
||||
@ -36,7 +36,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.18 2014/03/29 19:28:28 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.19 2019/11/10 21:16:26 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -508,10 +508,7 @@ pcib_isa_intr_establish(void *v, int irq, int type, int level,
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_func = func;
|
||||
ih->ih_arg = arg;
|
||||
ih->ih_irq = irq;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cpc_mainbus.c,v 1.6 2011/07/01 19:03:09 dyoung Exp $ */
|
||||
/* $NetBSD: cpc_mainbus.c,v 1.7 2019/11/10 21:16:26 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: cpc_mainbus.c,v 1.6 2011/07/01 19:03:09 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: cpc_mainbus.c,v 1.7 2019/11/10 21:16:26 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/extent.h>
|
||||
@ -79,11 +79,10 @@ cpc_mainbus_attach(device_t parent, device_t self, void *aux)
|
||||
struct genppc_pci_chipset_businfo *pbi;
|
||||
|
||||
genppc_pct = malloc(sizeof(struct genppc_pci_chipset), M_DEVBUF,
|
||||
M_NOWAIT);
|
||||
M_WAITOK);
|
||||
pmppc_pci_get_chipset_tag(genppc_pct);
|
||||
pbi = malloc(sizeof(struct genppc_pci_chipset_businfo),
|
||||
M_DEVBUF, M_NOWAIT);
|
||||
KASSERT(pbi != NULL);
|
||||
M_DEVBUF, M_WAITOK);
|
||||
pbi->pbi_properties = prop_dictionary_create();
|
||||
KASSERT(pbi->pbi_properties != NULL);
|
||||
SIMPLEQ_INIT(&genppc_pct->pc_pbi);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pic_cpc700.c,v 1.6 2011/07/01 19:03:09 dyoung Exp $ */
|
||||
/* $NetBSD: pic_cpc700.c,v 1.7 2019/11/10 21:16:26 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pic_cpc700.c,v 1.6 2011/07/01 19:03:09 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pic_cpc700.c,v 1.7 2019/11/10 21:16:26 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/malloc.h>
|
||||
@ -60,8 +60,7 @@ setup_cpc700(void)
|
||||
struct cpc700_ops *cpc700;
|
||||
struct pic_ops *pic;
|
||||
|
||||
cpc700 = malloc(sizeof(struct cpc700_ops), M_DEVBUF, M_NOWAIT);
|
||||
KASSERT(cpc700 != NULL);
|
||||
cpc700 = malloc(sizeof(struct cpc700_ops), M_DEVBUF, M_WAITOK);
|
||||
pic = &cpc700->pic;
|
||||
|
||||
pic->pic_numintrs = 32;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: design_gsrd1.c,v 1.3 2011/06/18 06:44:27 matt Exp $ */
|
||||
/* $NetBSD: design_gsrd1.c,v 1.4 2019/11/10 21:16:27 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2006 Jachym Holecek
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: design_gsrd1.c,v 1.3 2011/06/18 06:44:27 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: design_gsrd1.c,v 1.4 2019/11/10 21:16:27 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -373,11 +373,7 @@ ll_dmac_intr_establish(int chan, void (*func)(void *), void *arg)
|
||||
if (cdmac_intrs[chan] != NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(struct cdmac_intr_handle), M_DEVBUF,
|
||||
cold ? M_NOWAIT : M_WAITOK);
|
||||
if (ih == NULL)
|
||||
return (NULL);
|
||||
|
||||
ih = malloc(sizeof(struct cdmac_intr_handle), M_DEVBUF, M_WAITOK);
|
||||
ih->cih_func = func;
|
||||
ih->cih_arg = arg;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ap_ms104_sh4_intr.c,v 1.2 2012/01/21 19:44:29 nonaka Exp $ */
|
||||
/* $NetBSD: ap_ms104_sh4_intr.c,v 1.3 2019/11/10 21:16:27 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 2009 NONAKA Kimihiro <nonaka@netbsd.org>
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ap_ms104_sh4_intr.c,v 1.2 2012/01/21 19:44:29 nonaka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ap_ms104_sh4_intr.c,v 1.3 2019/11/10 21:16:27 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -102,9 +102,7 @@ extintr_establish(int irq, int trigger, int level,
|
||||
|
||||
KDASSERT(irq >= 1 && irq <= 14);
|
||||
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
|
||||
if (ih == NULL)
|
||||
panic("intr_establish: can't malloc handler info");
|
||||
ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
|
||||
|
||||
s = _cpu_intr_suspend();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fb_sbdio.c,v 1.16 2017/06/13 19:13:55 spz Exp $ */
|
||||
/* $NetBSD: fb_sbdio.c,v 1.17 2019/11/10 21:16:27 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
|
||||
@ -32,7 +32,7 @@
|
||||
#define WIRED_FB_TLB
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: fb_sbdio.c,v 1.16 2017/06/13 19:13:55 spz Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: fb_sbdio.c,v 1.17 2019/11/10 21:16:27 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -146,17 +146,8 @@ fb_sbdio_attach(device_t parent, device_t self, void *aux)
|
||||
sc->sc_nscreens = 1;
|
||||
} else {
|
||||
ri = malloc(sizeof(struct rasops_info), M_DEVBUF,
|
||||
M_NOWAIT | M_ZERO);
|
||||
if (ri == NULL) {
|
||||
printf(":can't allocate rasops memory\n");
|
||||
return;
|
||||
}
|
||||
ga = malloc(sizeof(struct ga), M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (ga == NULL) {
|
||||
printf(":can't allocate ga memory\n");
|
||||
free(ri, M_DEVBUF);
|
||||
return;
|
||||
}
|
||||
M_WAITOK | M_ZERO);
|
||||
ga = malloc(sizeof(struct ga), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
ga->reg_paddr = sa->sa_addr2;
|
||||
ga->flags = sa->sa_flags;
|
||||
fb_pmap_enter(sa->sa_addr1, sa->sa_addr2,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: hpib.c,v 1.39 2012/10/13 06:12:23 tsutsui Exp $ */
|
||||
/* $NetBSD: hpib.c,v 1.40 2019/11/10 21:16:27 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
|
||||
@ -65,7 +65,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: hpib.c,v 1.39 2012/10/13 06:12:23 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: hpib.c,v 1.40 2019/11/10 21:16:27 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -161,11 +161,7 @@ hpibbusattach(device_t parent, device_t self, void *aux)
|
||||
/*
|
||||
* Initialize the DMA queue entry.
|
||||
*/
|
||||
sc->sc_dq = malloc(sizeof(struct dmaqueue), M_DEVBUF, M_NOWAIT);
|
||||
if (sc->sc_dq == NULL) {
|
||||
aprint_error_dev(self, "can't allocate DMA queue entry\n");
|
||||
return;
|
||||
}
|
||||
sc->sc_dq = malloc(sizeof(struct dmaqueue), M_DEVBUF, M_WAITOK);
|
||||
sc->sc_dq->dq_softc = sc;
|
||||
sc->sc_dq->dq_start = hpibstart;
|
||||
sc->sc_dq->dq_done = hpibdone;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: autoconf.c,v 1.106 2019/06/29 02:41:17 tsutsui Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.107 2019/11/10 21:16:27 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
|
||||
@ -88,7 +88,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.106 2019/06/29 02:41:17 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.107 2019/11/10 21:16:27 chs Exp $");
|
||||
|
||||
#include "dvbox.h"
|
||||
#include "gbox.h"
|
||||
@ -395,10 +395,7 @@ device_register(device_t dev, void *aux)
|
||||
* we can mount as root.
|
||||
*/
|
||||
|
||||
dd = malloc(sizeof(struct dev_data), M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (dd == NULL)
|
||||
panic("device_register: can't allocate dev_data");
|
||||
|
||||
dd = malloc(sizeof(struct dev_data), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
dd->dd_dev = dev;
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: intr.c,v 1.42 2016/01/17 17:49:55 tsutsui Exp $ */
|
||||
/* $NetBSD: intr.c,v 1.43 2019/11/10 21:16:27 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1999 The NetBSD Foundation, Inc.
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.42 2016/01/17 17:49:55 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.43 2019/11/10 21:16:27 chs Exp $");
|
||||
|
||||
#define _HP300_INTR_H_PRIVATE
|
||||
|
||||
@ -108,11 +108,7 @@ intr_establish(int (*func)(void *), void *arg, int ipl, int priority)
|
||||
if ((ipl < 0) || (ipl >= NISR))
|
||||
panic("intr_establish: bad ipl %d", ipl);
|
||||
|
||||
newih = malloc(sizeof(struct hp300_intrhand), M_DEVBUF, M_NOWAIT);
|
||||
if (newih == NULL)
|
||||
panic("intr_establish: can't allocate space for handler");
|
||||
|
||||
/* Fill in the new entry. */
|
||||
newih = malloc(sizeof(struct hp300_intrhand), M_DEVBUF, M_WAITOK);
|
||||
newih->ih_fn = func;
|
||||
newih->ih_arg = arg;
|
||||
newih->ih_ipl = ipl;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: config_hook.c,v 1.10 2013/11/27 17:24:43 christos Exp $ */
|
||||
/* $NetBSD: config_hook.c,v 1.11 2019/11/10 21:16:27 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999-2001
|
||||
@ -35,7 +35,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: config_hook.c,v 1.10 2013/11/27 17:24:43 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: config_hook.c,v 1.11 2019/11/10 21:16:27 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
@ -118,10 +118,7 @@ config_hook(int type, long id, enum config_hook_mode mode,
|
||||
}
|
||||
|
||||
/* allocate new record */
|
||||
hr = malloc(sizeof(*hr), M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
|
||||
if (hr == NULL)
|
||||
panic("config_hook: malloc failed");
|
||||
|
||||
hr = malloc(sizeof(*hr), M_DEVBUF, M_WAITOK);
|
||||
hr->hr_ctx = ctx;
|
||||
hr->hr_type = type;
|
||||
hr->hr_id = id;
|
||||
@ -211,10 +208,7 @@ config_connect(int type, long id)
|
||||
}
|
||||
|
||||
/* allocate new record */
|
||||
cr = malloc(sizeof(*hr), M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
|
||||
if (cr == NULL)
|
||||
panic("config_connect: malloc failed");
|
||||
|
||||
cr = malloc(sizeof(*hr), M_DEVBUF, M_WAITOK);
|
||||
cr->hr_func = NULL;
|
||||
cr->hr_type = type;
|
||||
cr->hr_id = id;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: wzero3_kbd.c,v 1.8 2012/10/27 17:17:52 chs Exp $ */
|
||||
/* $NetBSD: wzero3_kbd.c,v 1.9 2019/11/10 21:16:27 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 2008, 2009, 2010 NONAKA Kimihiro <nonaka@netbsd.org>
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: wzero3_kbd.c,v 1.8 2012/10/27 17:17:52 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: wzero3_kbd.c,v 1.9 2019/11/10 21:16:27 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -289,17 +289,9 @@ wzero3kbd_attach(device_t parent, device_t self, void *aux)
|
||||
}
|
||||
|
||||
sc->sc_okeystat = malloc(sc->sc_nrow * sc->sc_ncolumn, M_DEVBUF,
|
||||
M_NOWAIT | M_ZERO);
|
||||
M_WAITOK | M_ZERO);
|
||||
sc->sc_keystat = malloc(sc->sc_nrow * sc->sc_ncolumn, M_DEVBUF,
|
||||
M_NOWAIT | M_ZERO);
|
||||
if (sc->sc_okeystat == NULL || sc->sc_keystat == NULL) {
|
||||
aprint_error_dev(self, "couldn't alloc memory.\n");
|
||||
if (sc->sc_okeystat)
|
||||
free(sc->sc_okeystat, M_DEVBUF);
|
||||
if (sc->sc_keystat)
|
||||
free(sc->sc_keystat, M_DEVBUF);
|
||||
return;
|
||||
}
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
sc->sc_if.hii_ctx = sc;
|
||||
sc->sc_if.hii_establish = wzero3kbd_input_establish;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: softintr.c,v 1.15 2013/12/02 18:36:11 joerg Exp $ */
|
||||
/* $NetBSD: softintr.c,v 1.16 2019/11/10 21:16:27 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: softintr.c,v 1.15 2013/12/02 18:36:11 joerg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: softintr.c,v 1.16 2019/11/10 21:16:27 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -63,10 +63,7 @@ softintr_establish(int level, void (*fun)(void *), void *arg)
|
||||
{
|
||||
struct softintr_handler *sh;
|
||||
|
||||
sh = malloc(sizeof(*sh), M_DEVBUF, M_NOWAIT);
|
||||
if (sh == NULL)
|
||||
return NULL;
|
||||
|
||||
sh = malloc(sizeof(*sh), M_DEVBUF, M_WAITOK);
|
||||
sh->sh_fun = fun;
|
||||
sh->sh_level = ipl_to_spl(level);
|
||||
sh->sh_arg = arg;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: plum.c,v 1.16 2015/10/02 09:05:33 msaitoh Exp $ */
|
||||
/* $NetBSD: plum.c,v 1.17 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: plum.c,v 1.16 2015/10/02 09:05:33 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: plum.c,v 1.17 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -103,11 +103,8 @@ plum_attach(device_t parent, device_t self, void *aux)
|
||||
printf(": Plum2 #2\n");
|
||||
break;
|
||||
}
|
||||
if (!(sc->sc_pc = malloc(sizeof(struct plum_chipset_tag),
|
||||
M_DEVBUF, M_NOWAIT))) {
|
||||
panic("no memory");
|
||||
}
|
||||
memset(sc->sc_pc, 0, sizeof(struct plum_chipset_tag));
|
||||
sc->sc_pc = malloc(sizeof(struct plum_chipset_tag),
|
||||
M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
sc->sc_pc->pc_tc = ca->ca_tc;
|
||||
|
||||
/* Attach Plum devices */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: plumiobus.c,v 1.14 2012/10/27 17:17:53 chs Exp $ */
|
||||
/* $NetBSD: plumiobus.c,v 1.15 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: plumiobus.c,v 1.14 2012/10/27 17:17:53 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: plumiobus.c,v 1.15 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#define PLUMIOBUSDEBUG
|
||||
|
||||
@ -172,10 +172,7 @@ __plumiobus_subregion(bus_space_tag_t t, bus_addr_t ofs, bus_size_t size)
|
||||
{
|
||||
struct hpcmips_bus_space *hbs;
|
||||
|
||||
if (!(hbs = malloc(sizeof(struct hpcmips_bus_space),
|
||||
M_DEVBUF, M_NOWAIT))) {
|
||||
panic ("__plumiobus_subregion: no memory.");
|
||||
}
|
||||
hbs = malloc(sizeof(*hbs), M_DEVBUF, M_WAITOK);
|
||||
*hbs = *t;
|
||||
hbs->t_base += ofs;
|
||||
hbs->t_size = size;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: tx39icu.c,v 1.35 2015/07/11 10:32:45 kamil Exp $ */
|
||||
/* $NetBSD: tx39icu.c,v 1.36 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: tx39icu.c,v 1.35 2015/07/11 10:32:45 kamil Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: tx39icu.c,v 1.36 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include "opt_vr41xx.h"
|
||||
#include "opt_tx39xx.h"
|
||||
@ -507,11 +507,7 @@ tx39_irqhigh_establish(tx_chipset_tag_t tc, int set, int bit, int pri,
|
||||
/*
|
||||
* Add new entry to `pri' priority
|
||||
*/
|
||||
if (!(he = malloc(sizeof(struct txintr_high_entry),
|
||||
M_DEVBUF, M_NOWAIT))) {
|
||||
panic ("tx39_irqhigh_establish: no memory.");
|
||||
}
|
||||
memset(he, 0, sizeof(struct txintr_high_entry));
|
||||
he = malloc(sizeof(struct txintr_high_entry), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
he->he_set = set;
|
||||
he->he_mask= (1 << bit);
|
||||
he->he_fun = ih_fun;
|
||||
@ -631,17 +627,14 @@ tx39_poll_establish(tx_chipset_tag_t tc, int interval, int level,
|
||||
int s;
|
||||
void *ret;
|
||||
|
||||
s = splhigh();
|
||||
sc = tc->tc_intrt;
|
||||
|
||||
if (!(p = malloc(sizeof(*p), M_DEVBUF, M_NOWAIT | M_ZERO))) {
|
||||
panic ("tx39_poll_establish: no memory.");
|
||||
}
|
||||
|
||||
p = malloc(sizeof(*p), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
p->p_fun = ih_fun;
|
||||
p->p_arg = ih_arg;
|
||||
p->p_cnt = interval;
|
||||
|
||||
s = splhigh();
|
||||
sc = tc->tc_intrt;
|
||||
|
||||
if (!sc->sc_polling) {
|
||||
tx39clock_alarm_set(tc, 33); /* 33 msec */
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: flash_vrip.c,v 1.11 2018/09/03 16:29:24 riastradh Exp $ */
|
||||
/* $NetBSD: flash_vrip.c,v 1.12 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: flash_vrip.c,v 1.11 2018/09/03 16:29:24 riastradh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: flash_vrip.c,v 1.12 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
@ -262,11 +262,7 @@ flash_attach(device_t parent, device_t self, void *aux)
|
||||
sc->sc_block_size = block_size;
|
||||
}
|
||||
|
||||
if ((sc->sc_buf = malloc(sc->sc_block_size, M_DEVBUF, M_NOWAIT))
|
||||
== NULL) {
|
||||
printf(": can't alloc buffer space\n");
|
||||
return;
|
||||
}
|
||||
sc->sc_buf = malloc(sc->sc_block_size, M_DEVBUF, M_WAITOK);
|
||||
|
||||
sc->sc_write_buffer_size
|
||||
= 1 << (sc->sc_cfi_raw[CFI_MAX_WBUF_SIZE_REG0]
|
||||
@ -375,8 +371,6 @@ int
|
||||
flashwrite(dev_t dev, struct uio *uio, int flag)
|
||||
{
|
||||
struct flash_softc *sc;
|
||||
bus_space_tag_t iot;
|
||||
bus_space_handle_t ioh;
|
||||
bus_size_t off;
|
||||
int stat;
|
||||
int error;
|
||||
@ -390,9 +384,6 @@ flashwrite(dev_t dev, struct uio *uio, int flag)
|
||||
if (uio->uio_resid % sc->sc_block_size)
|
||||
return EINVAL;
|
||||
|
||||
iot = sc->sc_iot;
|
||||
ioh = sc->sc_ioh;
|
||||
|
||||
for (off = uio->uio_offset;
|
||||
uio->uio_resid > 0;
|
||||
off += sc->sc_block_size) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vr4181giu.c,v 1.4 2012/10/27 17:17:55 chs Exp $ */
|
||||
/* $NetBSD: vr4181giu.c,v 1.5 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999-2001
|
||||
@ -35,7 +35,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: vr4181giu.c,v 1.4 2012/10/27 17:17:55 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vr4181giu.c,v 1.5 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/device.h>
|
||||
@ -325,9 +325,7 @@ vr4181giu_intr_establish(
|
||||
|
||||
s = splhigh();
|
||||
|
||||
if ((ih = malloc(sizeof *ih, M_DEVBUF, M_NOWAIT)) == NULL)
|
||||
panic("vr4181giu_intr_establish: memory exhausted.");
|
||||
|
||||
ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
|
||||
ih->ih_port = port;
|
||||
ih->ih_fun = ih_fun;
|
||||
ih->ih_arg = ih_arg;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vrc4172gpio.c,v 1.13 2012/10/27 17:17:55 chs Exp $ */
|
||||
/* $NetBSD: vrc4172gpio.c,v 1.14 2019/11/10 21:16:28 chs Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2001 TAKEMRUA Shin. All rights reserved.
|
||||
*
|
||||
@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: vrc4172gpio.c,v 1.13 2012/10/27 17:17:55 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vrc4172gpio.c,v 1.14 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -498,10 +498,7 @@ vrc4172gpio_intr_establish(
|
||||
mask2 = (1 << (port % 8));
|
||||
intlv_reg = intlv_regs[port/8];
|
||||
|
||||
ih = malloc(sizeof(struct vrc4172gpio_intr_entry), M_DEVBUF, M_NOWAIT);
|
||||
if (ih == NULL)
|
||||
panic("%s: no memory", __func__);
|
||||
|
||||
ih = malloc(sizeof(struct vrc4172gpio_intr_entry), M_DEVBUF, M_WAITOK);
|
||||
ih->ih_port = port;
|
||||
ih->ih_fun = ih_fun;
|
||||
ih->ih_arg = ih_arg;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vrgiu.c,v 1.42 2012/10/27 17:17:56 chs Exp $ */
|
||||
/* $NetBSD: vrgiu.c,v 1.43 2019/11/10 21:16:28 chs Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 1999-2001
|
||||
* Shin Takemura and PocketBSD Project. All rights reserved.
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: vrgiu.c,v 1.42 2012/10/27 17:17:56 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vrgiu.c,v 1.43 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -534,9 +534,7 @@ vrgiu_intr_establish(
|
||||
|
||||
s = splhigh();
|
||||
|
||||
if (!(ih = malloc(sizeof(struct vrgiu_intr_entry), M_DEVBUF, M_NOWAIT)))
|
||||
panic ("vrgiu_intr_establish: no memory.");
|
||||
|
||||
ih = malloc(sizeof(struct vrgiu_intr_entry), M_DEVBUF, M_WAITOK);
|
||||
DPRINTF(DEBUG_INTR, ("%s: port %d ", device_xname(sc->sc_dev), port));
|
||||
ih->ih_port = port;
|
||||
ih->ih_fun = ih_fun;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: apic.c,v 1.2 2014/03/31 20:51:20 christos Exp $ */
|
||||
/* $NetBSD: apic.c,v 1.3 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/* $OpenBSD: apic.c,v 1.14 2011/05/01 21:59:39 kettenis Exp $ */
|
||||
|
||||
@ -110,9 +110,7 @@ apic_attach(struct elroy_softc *sc)
|
||||
data & APIC_VERSION_MASK, sc->sc_nints);
|
||||
|
||||
sc->sc_irq = malloc(sc->sc_nints * sizeof(int), M_DEVBUF,
|
||||
M_NOWAIT | M_ZERO);
|
||||
if (sc->sc_irq == NULL)
|
||||
panic("apic_attach: can't allocate irq table\n");
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
apic_get_int_tbl(sc);
|
||||
|
||||
@ -173,16 +171,8 @@ apic_intr_establish(void *v, pci_intr_handle_t ih,
|
||||
if (irq <= 0 || irq > 31)
|
||||
return NULL;
|
||||
|
||||
aiv = malloc(sizeof(struct apic_iv), M_DEVBUF, M_NOWAIT);
|
||||
if (aiv == NULL)
|
||||
return NULL;
|
||||
|
||||
cnt = malloc(sizeof(struct evcnt), M_DEVBUF, M_NOWAIT);
|
||||
if (cnt == NULL) {
|
||||
free(aiv, M_DEVBUF);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
aiv = malloc(sizeof(struct apic_iv), M_DEVBUF, M_WAITOK);
|
||||
cnt = malloc(sizeof(struct evcnt), M_DEVBUF, M_WAITOK);
|
||||
aiv->sc = sc;
|
||||
aiv->ih = ih;
|
||||
aiv->handler = handler;
|
||||
@ -277,9 +267,7 @@ apic_get_int_tbl(struct elroy_softc *sc)
|
||||
|
||||
size = nentries * sizeof(struct pdc_pat_pci_rt);
|
||||
sc->sc_int_tbl_sz = nentries;
|
||||
sc->sc_int_tbl = malloc(size, M_DEVBUF, M_NOWAIT);
|
||||
if (sc->sc_int_tbl == NULL)
|
||||
return;
|
||||
sc->sc_int_tbl = malloc(size, M_DEVBUF, M_WAITOK);
|
||||
|
||||
pdcproc_pci_gettable(nentries, size, sc->sc_int_tbl);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mtrr_k6.c,v 1.13 2008/04/04 22:07:22 cegger Exp $ */
|
||||
/* $NetBSD: mtrr_k6.c,v 1.14 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2001 Wasabi Systems, Inc.
|
||||
@ -40,7 +40,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mtrr_k6.c,v 1.13 2008/04/04 22:07:22 cegger Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mtrr_k6.c,v 1.14 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -149,9 +149,7 @@ k6_mtrr_init_first(void)
|
||||
#endif
|
||||
|
||||
mtrr_var = (struct mtrr *)
|
||||
malloc(MTRR_K6_NVAR * sizeof(struct mtrr), M_TEMP, M_NOWAIT);
|
||||
if (mtrr_var == NULL)
|
||||
panic("can't allocate variable MTRR array");
|
||||
malloc(MTRR_K6_NVAR * sizeof(struct mtrr), M_TEMP, M_WAITOK);
|
||||
mtrr_funcs = &k6_mtrr_funcs;
|
||||
|
||||
k6_raw2soft();
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ahc_isa.c,v 1.41 2016/07/11 11:31:49 msaitoh Exp $ */
|
||||
/* $NetBSD: ahc_isa.c,v 1.42 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Product specific probe and attach routines for:
|
||||
@ -110,7 +110,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ahc_isa.c,v 1.41 2016/07/11 11:31:49 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ahc_isa.c,v 1.42 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -336,11 +336,7 @@ ahc_isa_probe(device_t parent, cfdata_t match, void *aux)
|
||||
/*
|
||||
* Don't have one, so make one.
|
||||
*/
|
||||
as = (struct ahc_isa_slot *)
|
||||
malloc(sizeof(struct ahc_isa_slot), M_DEVBUF, M_NOWAIT);
|
||||
if (as == NULL)
|
||||
panic("ahc_isa_probe: can't allocate slot marker");
|
||||
|
||||
as = malloc(sizeof(struct ahc_isa_slot), M_DEVBUF, M_WAITOK);
|
||||
as->bus = device_unit(parent);
|
||||
as->slot = AHC_ISA_MIN_SLOT;
|
||||
LIST_INSERT_HEAD(&ahc_isa_all_slots, as, link);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pci_intr_fixup.c,v 1.50 2014/09/09 06:38:33 apb Exp $ */
|
||||
/* $NetBSD: pci_intr_fixup.c,v 1.51 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
@ -60,7 +60,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pci_intr_fixup.c,v 1.50 2014/09/09 06:38:33 apb Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pci_intr_fixup.c,v 1.51 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include "opt_pcibios.h"
|
||||
#include "opt_pcifixup.h"
|
||||
@ -287,12 +287,7 @@ pciintr_link_alloc(struct pcibios_intr_routing *pir, int pin)
|
||||
}
|
||||
}
|
||||
|
||||
l = malloc(sizeof(*l), M_DEVBUF, M_NOWAIT);
|
||||
if (l == NULL)
|
||||
panic("pciintr_link_alloc");
|
||||
|
||||
memset(l, 0, sizeof(*l));
|
||||
|
||||
l = malloc(sizeof(*l), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
l->link = link;
|
||||
l->bitmap = pir->linkmap[pin].bitmap;
|
||||
if (pciintr_icu_tag != NULL) { /* compatible PCI ICU found */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pcibios.c,v 1.39 2010/07/26 22:33:23 jym Exp $ */
|
||||
/* $NetBSD: pcibios.c,v 1.40 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
@ -60,7 +60,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcibios.c,v 1.39 2010/07/26 22:33:23 jym Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pcibios.c,v 1.40 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include "opt_pcibios.h"
|
||||
#include "opt_pcifixup.h"
|
||||
@ -275,11 +275,7 @@ pcibios_pir_init(void)
|
||||
*/
|
||||
memcpy(&pcibios_pir_header, p, 32);
|
||||
pcibios_pir_table = malloc(tablesize - 32, M_DEVBUF,
|
||||
M_NOWAIT);
|
||||
if (pcibios_pir_table == NULL) {
|
||||
aprint_error("pcibios_pir_init: no memory for $PIR\n");
|
||||
return;
|
||||
}
|
||||
M_WAITOK);
|
||||
memcpy(pcibios_pir_table, p + 32, tablesize - 32);
|
||||
pcibios_pir_table_nentries = (tablesize - 32) / 16;
|
||||
|
||||
@ -288,13 +284,11 @@ pcibios_pir_init(void)
|
||||
PIR_DEVFUNC_DEVICE(pcibios_pir_header.router_devfunc),
|
||||
PIR_DEVFUNC_FUNCTION(pcibios_pir_header.router_devfunc));
|
||||
if (pcibios_pir_header.compat_router != 0) {
|
||||
devinfo = malloc(256, M_DEVBUF, M_NOWAIT);
|
||||
if (devinfo) {
|
||||
pci_devinfo(pcibios_pir_header.compat_router,
|
||||
0, 0, devinfo, 256);
|
||||
aprint_verbose(" (%s compatible)", devinfo);
|
||||
free(devinfo, M_DEVBUF);
|
||||
}
|
||||
devinfo = malloc(256, M_DEVBUF, M_WAITOK);
|
||||
pci_devinfo(pcibios_pir_header.compat_router,
|
||||
0, 0, devinfo, 256);
|
||||
aprint_verbose(" (%s compatible)", devinfo);
|
||||
free(devinfo, M_DEVBUF);
|
||||
}
|
||||
aprint_verbose("\n");
|
||||
pcibios_print_exclirq();
|
||||
@ -321,11 +315,7 @@ pcibios_pir_init(void)
|
||||
*/
|
||||
pcibios_pir_table_nentries = 32;
|
||||
pcibios_pir_table = malloc(pcibios_pir_table_nentries *
|
||||
sizeof(*pcibios_pir_table), M_DEVBUF, M_NOWAIT);
|
||||
if (pcibios_pir_table == NULL) {
|
||||
aprint_error("pcibios_pir_init: no memory for $PIR\n");
|
||||
return;
|
||||
}
|
||||
sizeof(*pcibios_pir_table), M_DEVBUF, M_WAITOK);
|
||||
if (pcibios_get_intr_routing(pcibios_pir_table,
|
||||
&pcibios_pir_table_nentries,
|
||||
&pcibios_pir_header.exclusive_irq) != PCIBIOS_SUCCESS) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pnpbios.c,v 1.73 2017/02/26 10:49:25 maya Exp $ */
|
||||
/* $NetBSD: pnpbios.c,v 1.74 2019/11/10 21:16:28 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Jason R. Thorpe. All rights reserved.
|
||||
@ -41,7 +41,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pnpbios.c,v 1.73 2017/02/26 10:49:25 maya Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pnpbios.c,v 1.74 2019/11/10 21:16:28 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -330,7 +330,7 @@ pnpbios_attach(device_t parent, device_t self, void *aux)
|
||||
aprint_error(": no vm for mapping\n");
|
||||
return;
|
||||
}
|
||||
pnpbios_scratchbuf = malloc(PNPBIOS_BUFSIZE, M_DEVBUF, M_NOWAIT);
|
||||
pnpbios_scratchbuf = malloc(PNPBIOS_BUFSIZE, M_DEVBUF, M_WAITOK);
|
||||
|
||||
setsegment(&gdtstore[GPNPBIOSCODE_SEL].sd, codeva, 0xffff,
|
||||
SDT_MEMERA, SEL_KPL, 0, 0);
|
||||
@ -393,11 +393,7 @@ pnpbios_enumerate(struct pnpbios_softc *sc)
|
||||
return;
|
||||
}
|
||||
|
||||
buf = malloc(size, M_DEVBUF, M_NOWAIT);
|
||||
if (buf == NULL) {
|
||||
aprint_error_dev(sc->sc_dev, "unable to allocate node buffer\n");
|
||||
return;
|
||||
}
|
||||
buf = malloc(size, M_DEVBUF, M_WAITOK);
|
||||
|
||||
/*
|
||||
* Loop through the list of indices getting data and match/attaching
|
||||
@ -965,7 +961,7 @@ pnp_scan(const uint8_t **bufp, size_t maxlen,
|
||||
const struct pnpansiidentres *res = start;
|
||||
if (in_depends)
|
||||
aprint_normal("ID in dep?\n");
|
||||
idstr = malloc(len + 1, M_DEVBUF, M_NOWAIT);
|
||||
idstr = malloc(len + 1, M_DEVBUF, M_WAITOK);
|
||||
for (i = 0; i < len; i++)
|
||||
idstr[i] = res->r_id[i];
|
||||
idstr[len] = '\0';
|
||||
@ -1086,7 +1082,7 @@ pnp_scan(const uint8_t **bufp, size_t maxlen,
|
||||
last = r;
|
||||
do {
|
||||
new = malloc(sizeof(*new),
|
||||
M_DEVBUF, M_NOWAIT);
|
||||
M_DEVBUF, M_WAITOK);
|
||||
|
||||
rv = pnp_scan(&p, maxlen - (p - *bufp),
|
||||
new, 1);
|
||||
@ -1133,7 +1129,7 @@ pnp_newirq(struct pnpresources *r, const void *vres, size_t len)
|
||||
DPRINTF(("\ttag irq zeroed\n"));
|
||||
return (0);
|
||||
}
|
||||
irq = malloc(sizeof(struct pnp_irq), M_DEVBUF, M_NOWAIT);
|
||||
irq = malloc(sizeof(struct pnp_irq), M_DEVBUF, M_WAITOK);
|
||||
irq->mask = res->r_mask;
|
||||
if (len > 2)
|
||||
irq->flags = res->r_info;
|
||||
@ -1158,7 +1154,7 @@ pnp_newdma(struct pnpresources *r, const void *vres, size_t len)
|
||||
DPRINTF(("\ttag DMA zeroed\n"));
|
||||
return (0);
|
||||
}
|
||||
dma = malloc(sizeof(struct pnp_dma), M_DEVBUF, M_NOWAIT);
|
||||
dma = malloc(sizeof(struct pnp_dma), M_DEVBUF, M_WAITOK);
|
||||
dma->mask = res->r_mask;
|
||||
dma->flags = res->r_flags;
|
||||
SIMPLEQ_INSERT_TAIL(&r->dma, dma, next);
|
||||
@ -1180,7 +1176,7 @@ pnp_newioport(struct pnpresources *r, const void *vres, size_t len)
|
||||
DPRINTF(("\ttag io zeroed\n"));
|
||||
return (0);
|
||||
}
|
||||
io = malloc(sizeof(struct pnp_io), M_DEVBUF, M_NOWAIT);
|
||||
io = malloc(sizeof(struct pnp_io), M_DEVBUF, M_WAITOK);
|
||||
io->flags = res->r_flags;
|
||||
io->minbase = res->r_minbase;
|
||||
io->maxbase = res->r_maxbase;
|
||||
@ -1208,7 +1204,7 @@ pnp_newfixedioport(struct pnpresources *r, const void *vres,
|
||||
DPRINTF(("\ttag fixedio zeroed\n"));
|
||||
return (0);
|
||||
}
|
||||
io = malloc(sizeof(struct pnp_io), M_DEVBUF, M_NOWAIT);
|
||||
io = malloc(sizeof(struct pnp_io), M_DEVBUF, M_WAITOK);
|
||||
io->flags = 1; /* 10 bit decoding */
|
||||
io->minbase = io->maxbase = res->r_base;
|
||||
io->align = 1;
|
||||
@ -1229,7 +1225,7 @@ pnp_compatid(struct pnpresources *r, const void *vres, size_t len)
|
||||
struct pnp_compatid *id;
|
||||
|
||||
res = vres;
|
||||
id = malloc(sizeof(*id), M_DEVBUF, M_NOWAIT);
|
||||
id = malloc(sizeof(*id), M_DEVBUF, M_WAITOK);
|
||||
pnpbios_id_to_string(res->r_id, id->idstr);
|
||||
id->next = r->compatids;
|
||||
r->compatids = id;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user