From owner-freebsd-questions Wed Mar 13 9: 0:59 2002 Delivered-To: freebsd-questions@freebsd.org Received: from relay2.undp.org (rock.undp.org [192.124.42.30]) by hub.freebsd.org (Postfix) with ESMTP id 7532537B404 for ; Wed, 13 Mar 2002 09:00:56 -0800 (PST) Received: from belka.undp.org (belka.undp.org [192.124.42.51]) by relay2.undp.org (8.11.1/8.11.1/1.16) with ESMTP id g2DH0pA22049 for ; Wed, 13 Mar 2002 12:00:51 -0500 (EST) Received: from belka.undp.org (localhost [127.0.0.1]) by belka.undp.org (8.10.0/8.10.0) with ESMTP id g2DH0no05861 for ; Wed, 13 Mar 2002 12:00:49 -0500 (EST) Received: from inet02.hq.undp.org (strelka.undp.org [192.124.42.50]) by belka.undp.org (8.10.0/8.10.0) with ESMTP id g2DH0ml05844 for ; Wed, 13 Mar 2002 12:00:48 -0500 (EST) Received: from undp.org ([127.0.0.1]) by inet02.hq.undp.org (Netscape Messaging Server 4.15) with ESMTP id GSX8LB00.6VB for ; Wed, 13 Mar 2002 12:00:47 -0500 From: "Ugen Antsilevitch" To: questions@freebsd.org Message-ID: <897afe89645d.89645d897afe@undp.org> Date: Wed, 13 Mar 2002 12:00:47 -0500 X-Mailer: Netscape Webmail MIME-Version: 1.0 Content-Language: en Subject: Kernel module and syscall locking. X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I am getting a little rusty on my syscall skills. So here is the situation: - I have a kernel module that loads and initializes a function pointer or two. Once initialized, these function pointers will be used in a system call (such as execve for instance) to do some evil magic. - With ipfw as an example locking for the initialization is easy - splnet, that shuts down network processing for as long as init runs. - Now with a system call here is what i am wondering: 1) Do i have to lock at all? Can a user initiate a system call while something else happens in kernel? (That is - can the context get switched to a user and then another kernel?) 2) If i do have to lock is it by means of splsomething? I think these are pretty much interrupt levels, so for user calls that won't do any good? 3) 4.2 (and 4.X in general) are still single "thread" kernels, right? what about 5.0 ? (that may be an ignorance question but i can't download the source tree now, with the modem connection being the only one available). Thanx! --Ugen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message