From owner-freebsd-hackers Tue Jul 29 20:09:34 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id UAA02581 for hackers-outgoing; Tue, 29 Jul 1997 20:09:34 -0700 (PDT) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA02576 for ; Tue, 29 Jul 1997 20:09:29 -0700 (PDT) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id UAA12221; Tue, 29 Jul 1997 20:10:28 -0700 (PDT) Message-Id: <199707300310.UAA12221@implode.root.com> To: Michael Smith cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Location of copyin() and copyout().. In-reply-to: Your message of "Wed, 30 Jul 1997 12:19:48 +0930." <199707300249.MAA17292@genesis.atrad.adelaide.edu.au> From: David Greenman Reply-To: dg@root.com Date: Tue, 29 Jul 1997 20:10:28 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >> I don't understand the distinction you're making. copyout *always* runs in >> the (kernel) context of a user process and the destination is always process >> (as opposed to kernel) memory. Please explain. > >If I am writing an ABI emulation function that exchanges data with the >emulated binary in one format, but need to pass the data in a >different format to/from the function(s) in the kernel which provide >the required functionality, I have to perform the format translation >in buffers in kernel space. > >If the kernel function(s) use copyin/copyout, they cannot access these >buffers, and thus the emulation cannot be performed. I still don't understand. copyin/out is only for copying between the kernel and user memory. If this is what you're doing and you don't need the extra features of uiomove (which is designed to do piecemeal copies by keeping track of offsets/lengths in a struct uio), then copyin/out is the function to use. If on the other hand you're copying from kernel<->kernel, then you can just use bcopy. I'm afraid that I started reading this thread rather late into it and don't have the original context...so what are we talking about? :-) -DG David Greenman Core-team/Principal Architect, The FreeBSD Project