From owner-freebsd-hackers Wed Jul 30 10:25:48 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA17810 for hackers-outgoing; Wed, 30 Jul 1997 10:25:48 -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 KAA17790 for ; Wed, 30 Jul 1997 10:25:39 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id KAA05290; Wed, 30 Jul 1997 10:23:05 -0700 From: Terry Lambert Message-Id: <199707301723.KAA05290@phaeton.artisoft.com> Subject: Re: Location of copyin() and copyout().. To: dg@root.com Date: Wed, 30 Jul 1997 10:23:04 -0700 (MST) Cc: msmith@atrad.adelaide.edu.au, freebsd-hackers@FreeBSD.ORG In-Reply-To: <199707300310.UAA12221@implode.root.com> from "David Greenman" at Jul 29, 97 08:10:28 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 > >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? :-) bsd_syscall_X() { ... copyin(...); /* copy in arguments*/ ... /* do syscall stuff*/ copyout(...); /* copy out results*/ } /* * XXX BROKEN! BSD SYSCALL CALLS COPYIN/COPYOUT, AND CAN NOT USE * XXX DATA FROM KERNEL SPACE INSTEAD OF USER SPACE! */ linux_syscall_X() { ... copyin(...); /* copy in arguments*/ ... /* massage Linux arguments into BSD format...*/ /* call BSD call to implement Linux call...*/ bsd_syscall_X(); ... /* massage BSD returns into Linux format...*/ copyout(...); /* copy out results*/ } I didn't get this part from his orginal posting either, since my interpretation of his original posting assumed that he was worried about kernel preeemption for RT and threading and SMP (like I was) instead of being worried about calling functions from within the kernel *from other functions within the kernel*. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.