Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jul 1997 20:10:28 -0700
From:      David Greenman <dg@root.com>
To:        Michael Smith <msmith@atrad.adelaide.edu.au>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Location of copyin() and copyout().. 
Message-ID:  <199707300310.UAA12221@implode.root.com>
In-Reply-To: Your message of "Wed, 30 Jul 1997 12:19:48 %2B0930." <199707300249.MAA17292@genesis.atrad.adelaide.edu.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
>>    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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707300310.UAA12221>