From owner-freebsd-smp Mon Apr 1 23:59:13 2002 Delivered-To: freebsd-smp@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 0322E37B41A; Mon, 1 Apr 2002 23:59:08 -0800 (PST) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.6) with SMTP id g327x2g22758; Tue, 2 Apr 2002 02:59:02 -0500 (EST) (envelope-from arr@FreeBSD.org) X-Authentication-Warning: fledge.watson.org: arr owned process doing -bs Date: Tue, 2 Apr 2002 02:59:00 -0500 (EST) From: "Andrew R. Reiter" X-Sender: arr@fledge.watson.org To: Alfred Perlstein Cc: "Andrew R. Reiter" , smp@FreeBSD.org Subject: Re: Where to initialize certain locks... In-Reply-To: <20020402072411.GH93885@elvis.mu.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 1 Apr 2002, Alfred Perlstein wrote: :Your concern is valid, perhaps a macro that automagically makes :a sysinit to init a mutex? Sort of like the "SYSCALL_MODULE_HELPER" :stuff, but not as ugly? : How about something along the lines of: void mtx_sysinit(void *arg) { struct mtx_init *margs = arg; mtx_init(margs->mtx, margs->desc, margs->opts) } #define MTX_SYSINIT(name, desc, lock, opts, sub, order) \ static struct margs name##_args { \ lock, \ desc, \ opts, \ }; \ SYSINIT(name##_sysinit, sub, order, mtx_sysinit, &name##_args) -- Andrew R. Reiter arr@watson.org arr@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message