Date: Wed, 26 Apr 2006 04:22:54 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96127 for review Message-ID: <200604260422.k3Q4Msaa029067@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96127 Change 96127 by jb@jb_freebsd2 on 2006/04/26 04:22:53 SysV -> BSD ioctl conversion. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_ioctl.c#9 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_ioctl.c#9 (text+ko) ==== @@ -141,16 +141,13 @@ #endif break; case DTRACEIOC_AGGSNAP: - case DTRACEIOC_BUFSNAP: -printf("DTRACEIOC_AGGSNAP or DTRACEIOC_BUFSNAP:\n"); -error = EINVAL; -#ifdef DOODAD - { + case DTRACEIOC_BUFSNAP: { + dtrace_bufdesc_t **pdesc = (dtrace_bufdesc_t **) addr; dtrace_bufdesc_t desc; caddr_t cached; dtrace_buffer_t *buf; - if (copyin((void *)arg, &desc, sizeof (desc)) != 0) + if (copyin((void *) *pdesc, &desc, sizeof (desc)) != 0) return (EFAULT); if (desc.dtbd_cpu < 0 || desc.dtbd_cpu >= NCPU) @@ -186,7 +183,7 @@ desc.dtbd_oldest = 0; sz = sizeof (desc); - if (copyout(&desc, (void *)arg, sz) != 0) + if (copyout(&desc, (void *) *pdesc, sz) != 0) return (EFAULT); return (0); @@ -213,7 +210,7 @@ mutex_exit(&dtrace_lock); - if (copyout(&desc, (void *)arg, sizeof (desc)) != 0) + if (copyout(&desc, (void *) *pdesc, sizeof (desc)) != 0) return (EFAULT); buf->dtb_flags |= DTRACEBUF_CONSUMED; @@ -268,13 +265,11 @@ /* * Finally, copy out the buffer description. */ - if (copyout(&desc, (void *)arg, sizeof (desc)) != 0) + if (copyout(&desc, (void *) *pdesc, sizeof (desc)) != 0) return (EFAULT); return (0); } -#endif - break; case DTRACEIOC_CONF: { dtrace_conf_t conf; bzero(&conf, sizeof (conf)); @@ -369,11 +364,8 @@ return (err); } - case DTRACEIOC_EPROBE: -printf("DTRACEIOC_EPROBE:\n"); -error = EINVAL; -#ifdef DOODAD - { + case DTRACEIOC_EPROBE: { + dtrace_eprobedesc_t **pepdesc = (dtrace_eprobedesc_t **) addr; dtrace_eprobedesc_t epdesc; dtrace_ecb_t *ecb; dtrace_action_t *act; @@ -382,7 +374,7 @@ uintptr_t dest; int nrecs; - if (copyin((void *)arg, &epdesc, sizeof (epdesc)) != 0) + if (copyin((void *)*pepdesc, &epdesc, sizeof (epdesc)) != 0) return (EFAULT); mutex_enter(&dtrace_lock); @@ -439,7 +431,7 @@ mutex_exit(&dtrace_lock); - if (copyout(buf, (void *)arg, dest - (uintptr_t)buf) != 0) { + if (copyout(buf, (void *) *pepdesc, dest - (uintptr_t)buf) != 0) { kmem_free(buf, size); return (EFAULT); } @@ -447,8 +439,6 @@ kmem_free(buf, size); return (0); } -#endif - break; case DTRACEIOC_FORMAT: printf("DTRACEIOC_FORMAT:\n"); error = EINVAL; @@ -650,19 +640,13 @@ return (0); } - case DTRACEIOC_REPLICATE: -printf("DTRACEIOC_REPLICATE:\n"); -error = EINVAL; -#ifdef DOODAD - { - dtrace_repldesc_t desc; - dtrace_probedesc_t *match = &desc.dtrpd_match; - dtrace_probedesc_t *create = &desc.dtrpd_create; + case DTRACEIOC_REPLICATE: { + dtrace_repldesc_t *desc = (dtrace_repldesc_t *) addr; + dtrace_probedesc_t *match = &desc->dtrpd_match; + dtrace_probedesc_t *create = &desc->dtrpd_create; int err; - if (copyin((void *)arg, &desc, sizeof (desc)) != 0) - return (EFAULT); - +printf("DTRACEIOC_REPLICATE:\n"); match->dtpd_provider[DTRACE_PROVNAMELEN - 1] = '\0'; match->dtpd_mod[DTRACE_MODNAMELEN - 1] = '\0'; match->dtpd_func[DTRACE_FUNCNAMELEN - 1] = '\0'; @@ -679,8 +663,6 @@ return (err); } -#endif - break; case DTRACEIOC_STATUS: { dtrace_status_t *stat = (dtrace_status_t *) addr; dtrace_dstate_t *dstate; @@ -745,27 +727,19 @@ return (0); } - case DTRACEIOC_STOP: -printf("DTRACEIOC_STOP:\n"); -error = EINVAL; -#ifdef DOODAD - { - processorid_t cpuid; + case DTRACEIOC_STOP: { + int rval; + processorid_t *cpuid = (processorid_t *) addr; mutex_enter(&dtrace_lock); - rval = dtrace_state_stop(state, &cpuid); + rval = dtrace_state_stop(state, cpuid); mutex_exit(&dtrace_lock); if (rval != 0) return (rval); - if (copyout(&cpuid, (void *)arg, sizeof (cpuid)) != 0) - return (EFAULT); - return (0); } -#endif - break; /* Really handled in upper layer */ case FIOASYNC: case FIONBIO:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604260422.k3Q4Msaa029067>