Date: Fri, 16 Jun 2000 15:37:30 -0700 (PDT) From: Matthew Jacob <mjacob@feral.com> To: hackers@freebsd.org Subject: use of '#pragma weak...' Message-ID: <Pine.BSF.4.05.10006161530150.2928-100000@semuta.feral.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.10006161530150.2928-100000>
