summaryrefslogtreecommitdiffstats
path: root/share/examples/kld
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2001-11-13 07:42:30 +0000
committerarr <arr@FreeBSD.org>2001-11-13 07:42:30 +0000
commit491cdadd597b9c5ae026a2155894c4bc2203334f (patch)
treede5bca87848e638d53ca7568af50ddaf84e7bec6 /share/examples/kld
parent4cc415408875b9210d227fe070f832455ee9fc8c (diff)
downloadFreeBSD-src-491cdadd597b9c5ae026a2155894c4bc2203334f.zip
FreeBSD-src-491cdadd597b9c5ae026a2155894c4bc2203334f.tar.gz
Update the KLD examples so they will work with current.
Reviewed: jhb
Diffstat (limited to 'share/examples/kld')
-rw-r--r--share/examples/kld/cdev/module/cdev.c12
-rw-r--r--share/examples/kld/syscall/module/syscall.c2
2 files changed, 10 insertions, 4 deletions
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 <sys/types.h>
#include <sys/uio.h>
#include <sys/param.h>
+#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/ioccom.h>
#include <sys/systm.h>
@@ -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;
OpenPOWER on IntegriCloud