1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
This commit is contained in:
Poul-Henning Kamp 2004-02-21 21:10:55 +00:00
parent c33f7bb853
commit dc08ffec87
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126080
163 changed files with 349 additions and 73 deletions

View File

@ -83,6 +83,7 @@ static d_mmap_t memmmap;
#define CDEV_MAJOR 2
static struct cdevsw mem_cdevsw = {
.d_version = D_VERSION,
.d_open = mmopen,
.d_close = mmclose,
.d_read = mmrw,
@ -91,7 +92,7 @@ static struct cdevsw mem_cdevsw = {
.d_mmap = memmmap,
.d_name = "mem",
.d_maj = CDEV_MAJOR,
.d_flags = D_MEM,
.d_flags = D_MEM | D_NEEDGIANT,
};
struct mem_range_softc mem_range_softc;

View File

@ -64,11 +64,12 @@ static d_close_t promclose;
static d_ioctl_t promioctl;
static struct cdevsw prom_cdevsw = {
.d_version = D_VERSION,
.d_open = promopen,
.d_close = promclose,
.d_ioctl = promioctl,
.d_name = "prom",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};

View File

@ -71,11 +71,12 @@ static d_close_t zsclose;
static d_ioctl_t zsioctl;
static struct cdevsw zs_cdevsw = {
.d_version = D_VERSION,
.d_open = zsopen,
.d_close = zsclose,
.d_ioctl = zsioctl,
.d_name = "zs",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static void zsstart(struct tty *);

View File

@ -81,6 +81,7 @@ static d_mmap_t memmmap;
#define CDEV_MAJOR 2
static struct cdevsw mem_cdevsw = {
.d_version = D_VERSION,
.d_open = mmopen,
.d_close = mmclose,
.d_read = mmrw,
@ -89,7 +90,7 @@ static struct cdevsw mem_cdevsw = {
.d_mmap = memmmap,
.d_name = "mem",
.d_maj = CDEV_MAJOR,
.d_flags = D_MEM,
.d_flags = D_MEM | D_NEEDGIANT,
};
MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");

View File

@ -636,6 +636,8 @@ static d_close_t xptclose;
static d_ioctl_t xptioctl;
static struct cdevsw xpt_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = xptopen,
.d_close = xptclose,
.d_ioctl = xptioctl,

View File

@ -212,6 +212,8 @@ static struct periph_driver chdriver =
PERIPHDRIVER_DECLARE(ch, chdriver);
static struct cdevsw ch_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = chopen,
.d_close = chclose,
.d_ioctl = chioctl,

View File

@ -105,6 +105,8 @@ static struct periph_driver passdriver =
PERIPHDRIVER_DECLARE(pass, passdriver);
static struct cdevsw pass_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = passopen,
.d_close = passclose,
.d_ioctl = passioctl,

View File

@ -118,6 +118,8 @@ PERIPHDRIVER_DECLARE(pt, ptdriver);
static struct cdevsw pt_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = ptopen,
.d_close = ptclose,
.d_read = physread,

View File

@ -425,6 +425,7 @@ PERIPHDRIVER_DECLARE(sa, sadriver);
static struct cdevsw sa_cdevsw = {
.d_version = D_VERSION,
.d_open = saopen,
.d_close = saclose,
.d_read = physread,
@ -432,7 +433,7 @@ static struct cdevsw sa_cdevsw = {
.d_ioctl = saioctl,
.d_strategy = sastrategy,
.d_name = "sa",
.d_flags = D_TAPE,
.d_flags = D_TAPE | D_NEEDGIANT,
};
static int

View File

@ -175,10 +175,12 @@ static struct periph_driver sesdriver = {
PERIPHDRIVER_DECLARE(ses, sesdriver);
static struct cdevsw ses_cdevsw = {
.d_version = D_VERSION,
.d_open = sesopen,
.d_close = sesclose,
.d_ioctl = sesioctl,
.d_name = "ses",
.d_flags = D_NEEDGIANT,
};
static void

View File

@ -105,6 +105,8 @@ static struct filterops targread_filtops =
{ 1, NULL, targreadfiltdetach, targreadfilt };
static struct cdevsw targ_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = targopen,
.d_close = targclose,
.d_read = targread,

View File

@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$");
#define VC_DEV_NO 93
static struct cdevsw codadevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = vc_nb_open,
.d_close = vc_nb_close,
.d_read = vc_nb_read,

View File

@ -206,6 +206,8 @@ toid_t ipfr_slowtimer_ch;
defined(_KERNEL)
# include <sys/conf.h>
const struct cdevsw ipl_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
iplopen, iplclose, iplread, nowrite, iplioctl,
nostop, notty, nopoll, nommap,
};

View File

@ -105,6 +105,8 @@ SYSCTL_INT(_net_inet_ipf, OID_AUTO, fr_minttllog, CTLFLAG_RW,
#define CDEV_MAJOR 79
static struct cdevsw ipl_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = iplopen,
.d_close = iplclose,
.d_read = iplread,

View File

@ -181,6 +181,8 @@ static int aac_return_aif(struct aac_softc *sc, caddr_t uptr);
static int aac_query_disk(struct aac_softc *sc, caddr_t uptr);
static struct cdevsw aac_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = aac_open,
.d_close = aac_close,
.d_ioctl = aac_ioctl,

View File

@ -67,6 +67,8 @@ static d_close_t acpiclose;
static d_ioctl_t acpiioctl;
static struct cdevsw acpi_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = acpiopen,
.d_close = acpiclose,
.d_ioctl = acpiioctl,

View File

@ -393,6 +393,8 @@ adlink_intr(void *arg)
}
static struct cdevsw adlink_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = adlink_open,
.d_ioctl = adlink_ioctl,
.d_mmap = adlink_mmap,

View File

@ -70,6 +70,8 @@ static d_ioctl_t agp_ioctl;
static d_mmap_t agp_mmap;
static struct cdevsw agp_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = agp_open,
.d_close = agp_close,
.d_ioctl = agp_ioctl,

View File

@ -91,6 +91,8 @@ static d_close_t amr_close;
static d_ioctl_t amr_ioctl;
static struct cdevsw amr_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = amr_open,
.d_close = amr_close,
.d_ioctl = amr_ioctl,

View File

@ -578,6 +578,8 @@ DATA_SET (mode0_pciset, mode0_pcidev);
*/
#define CDEV_MAJOR 154 /* preferred default character major */
STATIC struct cdevsw asr_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = asr_open,
.d_close = asr_close,
.d_ioctl = asr_ioctl,

View File

@ -59,6 +59,8 @@ __FBSDID("$FreeBSD$");
/* device structures */
static d_ioctl_t ata_ioctl;
static struct cdevsw ata_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_ioctl = ata_ioctl,
.d_name = "ata",
};

View File

@ -53,6 +53,7 @@ static d_close_t ast_close;
static d_ioctl_t ast_ioctl;
static d_strategy_t ast_strategy;
static struct cdevsw ast_cdevsw = {
.d_version = D_VERSION,
.d_open = ast_open,
.d_close = ast_close,
.d_read = physread,
@ -61,7 +62,7 @@ static struct cdevsw ast_cdevsw = {
.d_strategy = ast_strategy,
.d_name = "ast",
.d_maj = 119,
.d_flags = D_TAPE | D_TRACKCLOSE | D_NOGIANT,
.d_flags = D_TAPE | D_TRACKCLOSE,
};
/* prototypes */

View File

@ -348,6 +348,8 @@ static driver_t psm_driver = {
static struct cdevsw psm_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = psmopen,
.d_close = psmclose,
.d_read = psmread,

View File

@ -258,6 +258,8 @@ static d_mmap_t bktr_mmap;
static d_poll_t bktr_poll;
static struct cdevsw bktr_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = bktr_open,
.d_close = bktr_close,
.d_read = bktr_read,

View File

@ -212,8 +212,9 @@ static d_open_t ciss_open;
static d_close_t ciss_close;
static d_ioctl_t ciss_ioctl;
static struct cdevsw ciss_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = ciss_open,
.d_close = ciss_close,
.d_ioctl = ciss_ioctl,

View File

@ -2550,6 +2550,7 @@ static struct cdevsw cx_cdevsw = {
};
#else /* __FreeBSD_version > 501000 */
static struct cdevsw cx_cdevsw = {
.d_version = D_VERSION,
.d_open = cx_open,
.d_close = cx_close,
.d_read = cx_read,
@ -2557,7 +2558,7 @@ static struct cdevsw cx_cdevsw = {
.d_ioctl = cx_ioctl,
.d_name = "cx",
.d_maj = CDEV_MAJOR,
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
#endif

View File

@ -386,12 +386,13 @@ static d_write_t siowrite;
static d_ioctl_t sioioctl;
static struct cdevsw sio_cdevsw = {
.d_version = D_VERSION,
.d_open = sioopen,
.d_close = sioclose,
.d_write = siowrite,
.d_ioctl = sioioctl,
.d_name = driver_name,
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static int comconsole = -1;

View File

@ -386,12 +386,13 @@ static d_write_t siowrite;
static d_ioctl_t sioioctl;
static struct cdevsw sio_cdevsw = {
.d_version = D_VERSION,
.d_open = sioopen,
.d_close = sioclose,
.d_write = siowrite,
.d_ioctl = sioioctl,
.d_name = driver_name,
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static int comconsole = -1;

View File

@ -88,11 +88,12 @@ static d_ioctl_t dcons_ioctl;
static struct cdevsw dcons_cdevsw = {
#if __FreeBSD_version >= 500104
.d_version = D_VERSION,
.d_open = dcons_open,
.d_close = dcons_close,
.d_ioctl = dcons_ioctl,
.d_name = "dcons",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
#else
/* open */ dcons_open,
/* close */ dcons_close,

View File

@ -142,13 +142,14 @@ const struct digi_control_signals digi_normal_signals = {
};
static struct cdevsw digi_sw = {
.d_version = D_VERSION,
.d_open = digiopen,
.d_close = digiclose,
.d_read = digiread,
.d_write = digiwrite,
.d_ioctl = digiioctl,
.d_name = driver_name,
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static void

View File

@ -212,6 +212,7 @@ const char *DRM(find_description)(int vendor, int device);
#ifdef __FreeBSD__
static struct cdevsw DRM(cdevsw) = {
.d_version = D_VERSION,
.d_open = DRM( open ),
.d_close = DRM( close ),
.d_read = DRM( read ),
@ -219,7 +220,7 @@ static struct cdevsw DRM(cdevsw) = {
.d_poll = DRM( poll ),
.d_mmap = DRM( mmap ),
.d_name = DRIVER_NAME,
.d_flags = D_TRACKCLOSE,
.d_flags = D_TRACKCLOSE | D_NEEDGIANT,
#if __FreeBSD_version < 500000
.d_bmaj = -1
#endif

View File

@ -363,6 +363,8 @@ static d_mmap_t fbmmap;
static struct cdevsw fb_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = fbopen,
.d_close = fbclose,
.d_read = fbread,

View File

@ -482,6 +482,7 @@ fdin_rd(fdc_p fdc)
}
static struct cdevsw fd_cdevsw = {
.d_version = D_VERSION,
.d_open = fdopen,
.d_close = fdclose,
.d_read = physread,
@ -489,7 +490,7 @@ static struct cdevsw fd_cdevsw = {
.d_ioctl = fdioctl,
.d_strategy = fdstrategy,
.d_name = "fd",
.d_flags = D_DISK,
.d_flags = D_DISK | D_NEEDGIANT,
};
/*

View File

@ -73,9 +73,9 @@ static d_write_t fw_write;
static d_mmap_t fw_mmap;
static d_strategy_t fw_strategy;
struct cdevsw firewire_cdevsw =
{
struct cdevsw firewire_cdevsw = {
#if __FreeBSD_version >= 500104
.d_version = D_VERSION,
.d_open = fw_open,
.d_close = fw_close,
.d_read = fw_read,
@ -85,7 +85,7 @@ struct cdevsw firewire_cdevsw =
.d_mmap = fw_mmap,
.d_strategy = fw_strategy,
.d_name = "fw",
.d_flags = D_MEM
.d_flags = D_MEM | D_NEEDGIANT
#else
fw_open, fw_close, fw_read, fw_write, fw_ioctl,
fw_poll, fw_mmap, fw_strategy, "fw", CDEV_MAJOR,

View File

@ -505,6 +505,8 @@ fore_reset(fup)
* Driver entry points
*/
static struct cdevsw fore_cdev = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_maj = -1,
};

View File

@ -66,6 +66,8 @@ static int ida_wait(struct ida_softc *ida, struct ida_qcb *qcb);
static d_ioctl_t ida_ioctl;
static struct cdevsw ida_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_ioctl = ida_ioctl,
.d_name = "ida",
};

View File

@ -93,6 +93,8 @@ static d_read_t iicread;
static d_ioctl_t iicioctl;
static struct cdevsw iic_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = iicopen,
.d_close = iicclose,
.d_read = iicread,

View File

@ -70,6 +70,8 @@ static d_ioctl_t iir_ioctl;
/* Normally, this is a static structure. But we need it in pci/iir_pci.c */
static struct cdevsw iir_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = iir_open,
.d_close = iir_close,
.d_read = iir_read,

View File

@ -38,6 +38,8 @@ static d_close_t ips_close;
static d_ioctl_t ips_ioctl;
static struct cdevsw ips_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = ips_open,
.d_close = ips_close,
.d_ioctl = ips_ioctl,

View File

@ -53,6 +53,8 @@ static void isp_action(struct cam_sim *, union ccb *);
static struct cdevsw isp_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_ioctl = ispioctl,
.d_name = "isp",
};

View File

@ -69,6 +69,8 @@ static d_read_t joyread;
static d_ioctl_t joyioctl;
static struct cdevsw joy_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = joyopen,
.d_close = joyclose,
.d_read = joyread,

View File

@ -433,6 +433,8 @@ static d_poll_t genkbdpoll;
static struct cdevsw kbd_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = genkbdopen,
.d_close = genkbdclose,
.d_read = genkbdread,

View File

@ -211,6 +211,8 @@ led_write(dev_t dev, struct uio *uio, int ioflag)
}
static struct cdevsw led_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_write = led_write,
.d_name = "LED",
};

View File

@ -740,6 +740,7 @@ static int matcd_pitch(int ldrive, int cdrive, int controller,
---------------------------------------------------------------------------*/
static struct cdevsw matcd_cdevsw = {
.d_version = D_VERSION,
.d_open = matcdopen, /* open */
.d_close = matcdclose, /* close */
.d_read = physread, /* read */
@ -750,7 +751,7 @@ static struct cdevsw matcd_cdevsw = {
.d_strategy = matcdstrategy, /* strategy */
.d_name = "matcd", /* name */
.d_maj = RAW_DEVICE, /* maj */
.d_flags = D_DISK, /* flags */
.d_flags = D_DISK | D_NEEDGIANT,
};

View File

@ -160,15 +160,15 @@ static d_close_t mcdclose;
static d_ioctl_t mcdioctl;
static d_strategy_t mcdstrategy;
static struct cdevsw mcd_cdevsw = {
.d_version = D_VERSION,
.d_open = mcdopen,
.d_close = mcdclose,
.d_read = physread,
.d_ioctl = mcdioctl,
.d_strategy = mcdstrategy,
.d_name = "mcd",
.d_flags = D_DISK,
.d_flags = D_DISK | D_NEEDGIANT,
};
#define MCD_RETRYS 5

View File

@ -116,6 +116,8 @@ static dev_t status_dev = 0;
static d_ioctl_t mdctlioctl;
static struct cdevsw mdctl_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_ioctl = mdctlioctl,
.d_name = MD_NAME,
};

View File

@ -53,8 +53,9 @@
#include <dev/mlx/mlxvar.h>
#include <dev/mlx/mlxreg.h>
static struct cdevsw mlx_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = mlx_open,
.d_close = mlx_close,
.d_ioctl = mlx_ioctl,

View File

@ -149,8 +149,9 @@ static driver_t mly_pci_driver = {
static devclass_t mly_devclass;
DRIVER_MODULE(mly, pci, mly_pci_driver, mly_devclass, 0, 0);
static struct cdevsw mly_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = mly_user_open,
.d_close = mly_user_close,
.d_ioctl = mly_user_ioctl,

View File

@ -140,6 +140,8 @@ static d_ioctl_t mseioctl;
static d_poll_t msepoll;
static struct cdevsw mse_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = mseopen,
.d_close = mseclose,
.d_read = mseread,

View File

@ -72,13 +72,14 @@ static d_write_t nmdmwrite;
static d_ioctl_t nmdmioctl;
static struct cdevsw nmdm_cdevsw = {
.d_version = D_VERSION,
.d_open = nmdmopen,
.d_close = nmdmclose,
.d_read = nmdmread,
.d_write = nmdmwrite,
.d_ioctl = nmdmioctl,
.d_name = "nmdm",
.d_flags = D_TTY | D_PSEUDO,
.d_name = "nmdn",
.d_flags = D_TTY | D_PSEUDO | D_NEEDGIANT,
};
#define BUFSIZ 100 /* Chunk size iomoved to/from user */

View File

@ -52,20 +52,21 @@ static d_read_t zero_read;
#define ZERO_MINOR 12
static struct cdevsw null_cdevsw = {
.d_version = D_VERSION,
.d_read = (d_read_t *)nullop,
.d_write = null_write,
.d_ioctl = null_ioctl,
.d_name = "null",
.d_maj = CDEV_MAJOR,
.d_flags = D_NOGIANT,
};
static struct cdevsw zero_cdevsw = {
.d_version = D_VERSION,
.d_read = zero_read,
.d_write = null_write,
.d_name = "zero",
.d_maj = CDEV_MAJOR,
.d_flags = D_MMAP_ANON | D_NOGIANT,
.d_flags = D_MMAP_ANON,
};
static void *zbuf;

View File

@ -51,13 +51,13 @@ static d_open_t ofw_dev_open;
static d_close_t ofw_dev_close;
static d_ioctl_t ofw_dev_ioctl;
static struct cdevsw ofw_cdevsw = {
.d_version = D_VERSION,
.d_open = ofw_dev_open,
.d_close = ofw_dev_close,
.d_ioctl = ofw_dev_ioctl,
.d_name = "ofw",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static struct tty *ofw_tp = NULL;

View File

@ -67,6 +67,8 @@ static d_ioctl_t openfirm_ioctl;
#define OPENFIRM_MINOR 0
static struct cdevsw openfirm_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_ioctl = openfirm_ioctl,
.d_name = "openfirm",
};

View File

@ -58,6 +58,8 @@ static int openprom_node_valid(phandle_t node);
static int openprom_node_search(phandle_t root, phandle_t node);
static struct cdevsw openprom_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = openprom_open,
.d_close = openprom_close,
.d_ioctl = openprom_ioctl,

View File

@ -74,6 +74,8 @@ static d_ioctl_t pci_ioctl;
#endif
struct cdevsw pcicdev = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = pci_open,
.d_close = pci_close,
.d_ioctl = pci_ioctl,

View File

@ -190,6 +190,8 @@ static d_read_t lptread;
static d_ioctl_t lptioctl;
static struct cdevsw lpt_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = lptopen,
.d_close = lptclose,
.d_read = lptread,

View File

@ -68,6 +68,8 @@ static d_close_t pcfclock_close;
static d_read_t pcfclock_read;
static struct cdevsw pcfclock_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = pcfclock_open,
.d_close = pcfclock_close,
.d_read = pcfclock_read,

View File

@ -91,6 +91,8 @@ static d_write_t ppiwrite;
static d_read_t ppiread;
static struct cdevsw ppi_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = ppiopen,
.d_close = ppiclose,
.d_read = ppiread,

View File

@ -63,6 +63,8 @@ static d_close_t ppsclose;
static d_ioctl_t ppsioctl;
static struct cdevsw pps_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = ppsopen,
.d_close = ppsclose,
.d_ioctl = ppsioctl,

View File

@ -215,6 +215,8 @@ d_close_t raidctlclose;
d_ioctl_t raidctlioctl;
static struct cdevsw raidctl_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = raidctlopen,
.d_close = raidctlclose,
.d_ioctl = raidctlioctl,

View File

@ -64,6 +64,8 @@ static d_poll_t random_poll;
#define RANDOM_FIFO_MAX 256 /* How many events to queue up */
static struct cdevsw random_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_close = random_close,
.d_read = random_read,
.d_write = random_write,

View File

@ -147,11 +147,12 @@ static d_close_t rcclose;
static d_ioctl_t rcioctl;
static struct cdevsw rc_cdevsw = {
.d_version = D_VERSION,
.d_open = rcopen,
.d_close = rcclose,
.d_ioctl = rcioctl,
.d_name = "rc",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static devclass_t rc_devclass;

View File

@ -572,12 +572,13 @@ static d_write_t rpwrite;
static d_ioctl_t rpioctl;
struct cdevsw rp_cdevsw = {
.d_version = D_VERSION,
.d_open = rpopen,
.d_close = rpclose,
.d_write = rpwrite,
.d_ioctl = rpioctl,
.d_name = "rp",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static int rp_num_ports_open = 0;

View File

@ -161,11 +161,12 @@ static void sabttystop(struct tty *tp, int rw);
static int sabttyparam(struct tty *tp, struct termios *t);
static struct cdevsw sabtty_cdevsw = {
.d_version = D_VERSION,
.d_open = sabttyopen,
.d_close = sabttyclose,
.d_ioctl = sabttyioctl,
.d_name = "sabtty",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static device_method_t sab_methods[] = {

View File

@ -147,13 +147,14 @@ static d_strategy_t scdstrategy;
static struct cdevsw scd_cdevsw = {
.d_version = D_VERSION,
.d_open = scdopen,
.d_close = scdclose,
.d_read = physread,
.d_ioctl = scdioctl,
.d_strategy = scdstrategy,
.d_name = "scd",
.d_flags = D_DISK,
.d_flags = D_DISK | D_NEEDGIANT,
};
int

View File

@ -118,12 +118,13 @@ static d_write_t siwrite;
static d_ioctl_t siioctl;
static struct cdevsw si_cdevsw = {
.d_version = D_VERSION,
.d_open = siopen,
.d_close = siclose,
.d_write = siwrite,
.d_ioctl = siioctl,
.d_name = "si",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static int si_Nports;

View File

@ -323,13 +323,14 @@ static d_write_t siowrite;
static d_ioctl_t sioioctl;
static struct cdevsw sio_cdevsw = {
.d_version = D_VERSION,
.d_open = sioopen,
.d_close = sioclose,
.d_read = sioread,
.d_write = siowrite,
.d_ioctl = sioioctl,
.d_name = sio_driver_name,
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
int comconsole = -1;

View File

@ -88,6 +88,8 @@ static d_read_t smbread;
static d_ioctl_t smbioctl;
static struct cdevsw smb_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = smbopen,
.d_close = smbclose,
.d_read = smbread,

View File

@ -39,6 +39,8 @@ static d_ioctl_t snpioctl;
static d_poll_t snppoll;
static struct cdevsw snp_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = snpopen,
.d_close = snpclose,
.d_read = snpread,

View File

@ -70,6 +70,8 @@ static int midi_readstatus(char *buf, int *ptr, struct uio *uio);
#define CDEV_MAJOR MIDI_CDEV_MAJOR
static struct cdevsw midi_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = midiopen,
.d_close = midiclose,
.d_read = midiread,

View File

@ -135,6 +135,8 @@ static d_poll_t seqpoll;
#define CDEV_MAJOR SEQ_CDEV_MAJOR
static struct cdevsw seq_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = seqopen,
.d_close = seqclose,
.d_read = seqread,

View File

@ -42,6 +42,8 @@ static d_poll_t dsp_poll;
static d_mmap_t dsp_mmap;
struct cdevsw dsp_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = dsp_open,
.d_close = dsp_close,
.d_read = dsp_read,

View File

@ -73,6 +73,8 @@ static d_open_t mixer_open;
static d_close_t mixer_close;
static struct cdevsw mixer_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = mixer_open,
.d_close = mixer_close,
.d_ioctl = mixer_ioctl,

View File

@ -41,6 +41,8 @@ static d_close_t sndstat_close;
static d_read_t sndstat_read;
static struct cdevsw sndstat_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = sndstat_open,
.d_close = sndstat_close,
.d_read = sndstat_read,

View File

@ -34,6 +34,8 @@ static d_write_t spkrwrite;
static d_ioctl_t spkrioctl;
static struct cdevsw spkr_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = spkropen,
.d_close = spkrclose,
.d_write = spkrwrite,

View File

@ -102,6 +102,8 @@ static struct fileops svr4_netops = {
};
static struct cdevsw streams_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = streamsopen,
.d_name = "streams",
};

View File

@ -194,8 +194,6 @@ static int update_kbd_state(scr_stat *scp, int state, int mask);
static int update_kbd_leds(scr_stat *scp, int which);
static timeout_t blink_screen;
#define CDEV_MAJOR 12
static cn_probe_t sccnprobe;
static cn_init_t sccninit;
static cn_getc_t sccngetc;
@ -218,14 +216,14 @@ static d_ioctl_t scioctl;
static d_mmap_t scmmap;
static struct cdevsw sc_cdevsw = {
.d_version = D_VERSION,
.d_open = scopen,
.d_close = scclose,
.d_read = scread,
.d_ioctl = scioctl,
.d_mmap = scmmap,
.d_name = "sc",
.d_maj = CDEV_MAJOR,
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
int

View File

@ -49,11 +49,12 @@ static d_close_t smclose;
static d_ioctl_t smioctl;
static struct cdevsw sm_cdevsw = {
.d_version = D_VERSION,
.d_open = smopen,
.d_close = smclose,
.d_ioctl = smioctl,
.d_name = "sysmouse",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
/* local variables */

View File

@ -104,6 +104,8 @@ LINUX_IOCTL_SET(tdfx, LINUX_IOCTL_TDFX_MIN, LINUX_IOCTL_TDFX_MAX);
/* Char. Dev. file operations structure */
static struct cdevsw tdfx_cdev = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = tdfx_open,
.d_close = tdfx_close,
.d_ioctl = tdfx_ioctl,

View File

@ -100,6 +100,8 @@ static struct gfb_type tga_devs[] = {
#ifdef FB_INSTALL_CDEV
static struct cdevsw tga_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = pcigfb_open,
.d_close = pcigfb_close,
.d_read = pcigfb_read,

View File

@ -186,6 +186,8 @@ static d_close_t ti_close;
static d_ioctl_t ti_ioctl2;
static struct cdevsw ti_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = ti_open,
.d_close = ti_close,
.d_ioctl = ti_ioctl2,

View File

@ -67,6 +67,8 @@ static d_close_t twe_close;
static d_ioctl_t twe_ioctl_wrapper;
static struct cdevsw twe_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = twe_open,
.d_close = twe_close,
.d_ioctl = twe_ioctl_wrapper,

View File

@ -67,11 +67,12 @@ static d_close_t uart_tty_close;
static d_ioctl_t uart_tty_ioctl;
static struct cdevsw uart_cdevsw = {
.d_version = D_VERSION,
.d_open = uart_tty_open,
.d_close = uart_tty_close,
.d_ioctl = uart_tty_ioctl,
.d_name = uart_driver_name,
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static struct uart_devinfo uart_console;

View File

@ -128,13 +128,14 @@ Static d_ioctl_t ucomioctl;
static struct cdevsw ucom_cdevsw = {
.d_version = D_VERSION,
.d_open = ucomopen,
.d_close = ucomclose,
.d_read = ucomread,
.d_write = ucomwrite,
.d_ioctl = ucomioctl,
.d_name = "ucom",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
#if __FreeBSD_version < 500014
.d_bmaj = -1,
#endif

View File

@ -89,6 +89,8 @@ d_close_t ufmclose;
d_ioctl_t ufmioctl;
Static struct cdevsw ufm_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = ufmopen,
.d_close = ufmclose,
.d_ioctl = ufmioctl,

View File

@ -151,6 +151,8 @@ d_poll_t ugenpoll;
Static struct cdevsw ugen_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = ugenopen,
.d_close = ugenclose,
.d_read = ugenread,

View File

@ -156,6 +156,8 @@ d_poll_t uhidpoll;
Static struct cdevsw uhid_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = uhidopen,
.d_close = uhidclose,
.d_read = uhidread,

View File

@ -147,6 +147,8 @@ Static d_ioctl_t ulptioctl;
Static struct cdevsw ulpt_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = ulptopen,
.d_close = ulptclose,
.d_write = ulptwrite,

View File

@ -154,6 +154,8 @@ Static d_poll_t ums_poll;
Static struct cdevsw ums_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = ums_open,
.d_close = ums_close,
.d_read = ums_read,

View File

@ -117,6 +117,8 @@ d_ioctl_t urioioctl;
Static struct cdevsw urio_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = urioopen,
.d_close = urioclose,
.d_read = urioread,

View File

@ -146,6 +146,8 @@ d_ioctl_t usbioctl;
d_poll_t usbpoll;
struct cdevsw usb_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = usbopen,
.d_close = usbclose,
.d_read = usbread,

View File

@ -268,6 +268,8 @@ d_poll_t uscannerpoll;
Static struct cdevsw uscanner_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = uscanneropen,
.d_close = uscannerclose,
.d_read = uscannerread,

View File

@ -152,11 +152,12 @@ static void zsttystop(struct tty *tp, int rw);
static int zsttyparam(struct tty *tp, struct termios *t);
static struct cdevsw zstty_cdevsw = {
.d_version = D_VERSION,
.d_open = zsttyopen,
.d_close = zsttyclose,
.d_ioctl = zsttyioctl,
.d_name = "zstty",
.d_flags = D_TTY,
.d_flags = D_TTY | D_NEEDGIANT,
};
static struct zstty_softc *zstty_cons;

View File

@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$");
#define VC_DEV_NO 93
static struct cdevsw codadevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = vc_nb_open,
.d_close = vc_nb_close,
.d_read = vc_nb_read,

View File

@ -194,7 +194,7 @@ spec_open(ap)
vp->v_vflag |= VV_ISTTY;
VOP_UNLOCK(vp, 0, td);
if(dsw->d_flags & D_NOGIANT) {
if(!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
if (dsw->d_fdopen != NULL)
error = dsw->d_fdopen(dev, ap->a_mode, td, ap->a_fdidx);
@ -267,7 +267,7 @@ spec_read(ap)
dsw = devsw(dev);
VOP_UNLOCK(vp, 0, td);
if (dsw->d_flags & D_NOGIANT) {
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
error = dsw->d_read(dev, uio, ap->a_ioflag);
PICKUP_GIANT();
@ -307,7 +307,7 @@ spec_write(ap)
resid = uio->uio_resid;
VOP_UNLOCK(vp, 0, td);
if (dsw->d_flags & D_NOGIANT) {
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
error = dsw->d_write(dev, uio, ap->a_ioflag);
PICKUP_GIANT();
@ -342,7 +342,7 @@ spec_ioctl(ap)
dev = ap->a_vp->v_rdev;
dsw = devsw(dev);
if (dsw->d_flags & D_NOGIANT) {
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
error = dsw->d_ioctl(dev, ap->a_command,
ap->a_data, ap->a_fflag, ap->a_td);
@ -371,7 +371,7 @@ spec_poll(ap)
dev = ap->a_vp->v_rdev;
dsw = devsw(dev);
if (dsw->d_flags & D_NOGIANT) {
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
error = dsw->d_poll(dev, ap->a_events, ap->a_td);
PICKUP_GIANT();
@ -394,7 +394,7 @@ spec_kqfilter(ap)
dev = ap->a_vp->v_rdev;
dsw = devsw(dev);
if (dsw->d_flags & D_NOGIANT) {
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
error = dsw->d_kqfilter(dev, ap->a_kn);
PICKUP_GIANT();
@ -509,7 +509,7 @@ spec_xstrategy(struct vnode *vp, struct buf *bp)
("No strategy on dev %s responsible for buffer %p\n",
devtoname(bp->b_dev), bp));
if (dsw->d_flags & D_NOGIANT) {
if (!(dsw->d_flags & D_NEEDGIANT)) {
/* XXX: notyet DROP_GIANT(); */
DEV_STRATEGY(bp);
/* XXX: notyet PICKUP_GIANT(); */
@ -631,7 +631,7 @@ spec_close(ap)
return (0);
}
VI_UNLOCK(vp);
if (dsw->d_flags & D_NOGIANT) {
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
error = dsw->d_close(dev, ap->a_fflag, S_IFCHR, td);
PICKUP_GIANT();

View File

@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$");
static d_ioctl_t g_ctl_ioctl;
static struct cdevsw g_ctl_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_ioctl = g_ctl_ioctl,
.d_name = "g_ctl",
};

View File

@ -58,6 +58,7 @@ static d_strategy_t g_dev_strategy;
static d_ioctl_t g_dev_ioctl;
static struct cdevsw g_dev_cdevsw = {
.d_version = D_VERSION,
.d_open = g_dev_open,
.d_close = g_dev_close,
.d_read = physread,
@ -66,7 +67,7 @@ static struct cdevsw g_dev_cdevsw = {
.d_strategy = g_dev_strategy,
.d_name = "g_dev",
.d_maj = GEOM_MAJOR,
.d_flags = D_DISK | D_TRACKCLOSE | D_NOGIANT,
.d_flags = D_DISK | D_TRACKCLOSE,
};
static g_taste_t g_dev_taste;

View File

@ -73,6 +73,8 @@ static d_ioctl_t apmioctl;
static d_poll_t apmpoll;
static struct cdevsw apm_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = apmopen,
.d_close = apmclose,
.d_write = apmwrite,

View File

@ -108,6 +108,8 @@ static d_ioctl_t apmioctl;
static d_poll_t apmpoll;
static struct cdevsw apm_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_NEEDGIANT,
.d_open = apmopen,
.d_close = apmclose,
.d_write = apmwrite,

View File

@ -75,9 +75,10 @@ devclass_t smapi_devclass;
static d_ioctl_t smapi_ioctl;
static struct cdevsw smapi_cdevsw = {
.d_version = D_VERSION,
.d_ioctl = smapi_ioctl,
.d_name = "smapi",
.d_flags = D_MEM,
.d_flags = D_MEM | D_NEEDGIANT,
};
static void smapi_identify (driver_t *, device_t);

Some files were not shown because too many files have changed in this diff Show More