summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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