Date: Wed, 19 Apr 2006 19:58:17 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95616 for review Message-ID: <200604191958.k3JJwHMM083220@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95616 Change 95616 by jb@jb_freebsd2 on 2006/04/19 19:58:07 Implement the load initialisation and unload cleanup in separate functions because there are quite a few things to do. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace.c#4 edit .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_load.c#1 add .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_modevent.c#2 edit .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_unload.c#1 add Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace.c#4 (text+ko) ==== @@ -50,9 +50,11 @@ #define DTRACE_MINOR 0 -static d_close_t dtrace_close; -static d_ioctl_t dtrace_ioctl; -static d_open_t dtrace_open; +static d_close_t dtrace_close; +static d_ioctl_t dtrace_ioctl; +static d_open_t dtrace_open; +static int dtrace_load(void); +static int dtrace_unload(void); static struct cdevsw dtrace_cdevsw = { .d_version = D_VERSION, @@ -65,11 +67,13 @@ /* For use with make_dev(9)/destroy_dev(9). */ static struct cdev *dtrace_dev; -#include <cddl/dev/dtrace/dtrace_sysctl.c> #include <cddl/dev/dtrace/dtrace_close.c> +#include <cddl/dev/dtrace/dtrace_ioctl.c> +#include <cddl/dev/dtrace/dtrace_load.c> #include <cddl/dev/dtrace/dtrace_modevent.c> #include <cddl/dev/dtrace/dtrace_open.c> -#include <cddl/dev/dtrace/dtrace_ioctl.c> +#include <cddl/dev/dtrace/dtrace_sysctl.c> +#include <cddl/dev/dtrace/dtrace_unload.c> DEV_MODULE(dtrace, dtrace_modevent, NULL); MODULE_VERSION(dtrace, 1); ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_modevent.c#2 (text+ko) ==== @@ -30,12 +30,11 @@ switch (type) { case MOD_LOAD: - dtrace_dev = make_dev(&dtrace_cdevsw, DTRACE_MINOR, - UID_ROOT, GID_WHEEL, 0660, "dtrace"); + error = dtrace_load(); break; case MOD_UNLOAD: - destroy_dev(dtrace_dev); + error = dtrace_unload(); break; case MOD_SHUTDOWN:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604191958.k3JJwHMM083220>