From 491cdadd597b9c5ae026a2155894c4bc2203334f Mon Sep 17 00:00:00 2001 From: arr Date: Tue, 13 Nov 2001 07:42:30 +0000 Subject: Update the KLD examples so they will work with current. Reviewed: jhb --- share/examples/kld/cdev/module/cdev.c | 12 +++++++++--- share/examples/kld/syscall/module/syscall.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'share/examples/kld') diff --git a/share/examples/kld/cdev/module/cdev.c b/share/examples/kld/cdev/module/cdev.c index ba6fa54..748d4c6 100644 --- a/share/examples/kld/cdev/module/cdev.c +++ b/share/examples/kld/cdev/module/cdev.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -99,8 +100,10 @@ static char buf[512+1]; static int len; int -mydev_open(dev_t dev, int flag, int otyp, struct proc *procp) +mydev_open(dev_t dev, int flag, int otyp, struct thread *td) { + struct proc *procp = td->td_proc; + printf("mydev_open: dev_t=%d, flag=%x, otyp=%x, procp=%p\n", dev2udev(dev), flag, otyp, procp); memset(&buf, '\0', 513); @@ -109,17 +112,20 @@ mydev_open(dev_t dev, int flag, int otyp, struct proc *procp) } int -mydev_close(dev_t dev, int flag, int otyp, struct proc *procp) +mydev_close(dev_t dev, int flag, int otyp, struct thread *td) { + struct proc *procp = td->td_proc; + printf("mydev_close: dev_t=%d, flag=%x, otyp=%x, procp=%p\n", dev2udev(dev), flag, otyp, procp); return (0); } int -mydev_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc *procp) +mydev_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct thread *td) { int error = 0; + struct proc *procp = td->td_proc; printf("mydev_ioctl: dev_t=%d, cmd=%lx, arg=%p, mode=%x procp=%p\n", dev2udev(dev), cmd, arg, mode, procp); diff --git a/share/examples/kld/syscall/module/syscall.c b/share/examples/kld/syscall/module/syscall.c index 2376725..eb168c3 100644 --- a/share/examples/kld/syscall/module/syscall.c +++ b/share/examples/kld/syscall/module/syscall.c @@ -39,7 +39,7 @@ */ static int -hello (struct proc *p, void *arg) +hello (struct thread *td, void *arg) { printf ("hello kernel\n"); return 0; -- cgit v1.1