From owner-p4-projects@FreeBSD.ORG Wed Apr 26 04:22:55 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0925616A465; Wed, 26 Apr 2006 04:22:55 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C28A116A463 for ; Wed, 26 Apr 2006 04:22:54 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8717143D45 for ; Wed, 26 Apr 2006 04:22:54 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k3Q4Msio029073 for ; Wed, 26 Apr 2006 04:22:54 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3Q4Msaa029067 for perforce@freebsd.org; Wed, 26 Apr 2006 04:22:54 GMT (envelope-from jb@freebsd.org) Date: Wed, 26 Apr 2006 04:22:54 GMT Message-Id: <200604260422.k3Q4Msaa029067@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 96127 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2006 04:22:55 -0000 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: