From 643584db6c8de64519d281f69af2d81ff79bffe4 Mon Sep 17 00:00:00 2001 From: tjr Date: Fri, 16 Jul 2004 06:55:34 +0000 Subject: Update for struct cdevsw and dev_t -> struct cdev * changes, plus one 64-bit portability fix. --- share/examples/kld/cdev/module/cdev.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'share/examples/kld/cdev/module/cdev.c') diff --git a/share/examples/kld/cdev/module/cdev.c b/share/examples/kld/cdev/module/cdev.c index 45c3736..dda63c4 100644 --- a/share/examples/kld/cdev/module/cdev.c +++ b/share/examples/kld/cdev/module/cdev.c @@ -95,10 +95,10 @@ /* Stores string recv'd by _write() */ static char buf[512+1]; -static int len; +static size_t len; int -mydev_open(dev_t dev, int flag, int otyp, struct thread *td) +mydev_open(struct cdev *dev, int flag, int otyp, struct thread *td) { struct proc *procp = td->td_proc; @@ -110,7 +110,7 @@ mydev_open(dev_t dev, int flag, int otyp, struct thread *td) } int -mydev_close(dev_t dev, int flag, int otyp, struct thread *td) +mydev_close(struct cdev *dev, int flag, int otyp, struct thread *td) { struct proc *procp = td->td_proc; @@ -120,7 +120,8 @@ mydev_close(dev_t dev, int flag, int otyp, struct thread *td) } int -mydev_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct thread *td) +mydev_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int mode, + struct thread *td) { int error = 0; struct proc *procp = td->td_proc; @@ -145,7 +146,7 @@ mydev_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct thread *td) * to buf for later accessing. */ int -mydev_write(dev_t dev, struct uio *uio, int ioflag) +mydev_write(struct cdev *dev, struct uio *uio, int ioflag) { int err = 0; @@ -165,7 +166,7 @@ mydev_write(dev_t dev, struct uio *uio, int ioflag) * accessing. */ int -mydev_read(dev_t dev, struct uio *uio, int ioflag) +mydev_read(struct cdev *dev, struct uio *uio, int ioflag) { int err = 0; -- cgit v1.1