From owner-freebsd-hackers Wed Jul 30 09:53:02 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA14908 for hackers-outgoing; Wed, 30 Jul 1997 09:53:02 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id JAA14895 for ; Wed, 30 Jul 1997 09:52:55 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id JAA05201; Wed, 30 Jul 1997 09:50:36 -0700 From: Terry Lambert Message-Id: <199707301650.JAA05201@phaeton.artisoft.com> Subject: Re: Location of copyin() and copyout().. To: dg@root.com Date: Wed, 30 Jul 1997 09:50:36 -0700 (MST) Cc: terry@lambert.org, freebsd-hackers@FreeBSD.ORG In-Reply-To: <199707300146.SAA11272@implode.root.com> from "David Greenman" at Jul 29, 97 06:46:08 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > >Probably there needs to be _copyin/_copyout for the internal usage, > >and a "safe" copyin/copyout for usage which isn't safed against > >reentrancy. > > There is no problem with using copyout() in the kernel to copy data out to > a user process, assuming that the currently running process is the intended > target of the copy. That is the sole purpose of the function. copyout() > correctly handles all issues of COW/ZF/page faults. > uiomove() is escentially a wrapper for copyin/copyout that has an > optimization for the case of kernel-to-kernel copies (in which case it > uses bcopy instead). The magic I was thinking of was related to reentrancy... I could see how you could also make the statement Mike made, and have it refer to the copy[in|out] -> bcopy conversion (ie: you can't call the new function from the kernel if your code will attempt a copy[in|out] instead of a bcopy). Shows my bias as a kernel preemption/multithreaing advocate, I suppose. ;-). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.