From owner-freebsd-hackers Fri Jun 16 15:37:44 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id 614EB37BB71 for ; Fri, 16 Jun 2000 15:37:39 -0700 (PDT) (envelope-from mjacob@feral.com) Received: from semuta.feral.com (semuta [192.67.166.70]) by feral.com (8.9.3/8.9.3) with ESMTP id PAA06628; Fri, 16 Jun 2000 15:37:37 -0700 Date: Fri, 16 Jun 2000 15:37:30 -0700 (PDT) From: Matthew Jacob Reply-To: mjacob@feral.com To: hackers@freebsd.org Subject: use of '#pragma weak...' Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Now that the heat wave is over in SF....back to my loadable module project changes to isp... maybe this is more for the toolchain folks than kernel hackers... So, I notice that '#pragma weak' appears to work for me for the compilers and linkers we currently use for i386 && alpha (at least in user space), so you can do things like: --------- extern void *isp_static_fw_vector(void); #pragma weak isp_static_fw_vector ..... if (isp_static_fw_vector) { /* * We have statically loaded f/w * fw_ptr = isp_static_fw_vector(); } else { /* * Statically loaded f/w not available. See if * there's a module for it somewhere and get the f/w * vector from there... */ fw_ptr = find_isp_fw_preloaded_module_and_return_fw_vector(); } .... --------- Is there any reason to *not* use this trick in the kernel? -matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message