svn commit: trunk/uClibc/ldso/include
vapier at uclibc.org
vapier at uclibc.org
Sat Oct 7 06:40:20 UTC 2006
Author: vapier
Date: 2006-10-06 23:40:20 -0700 (Fri, 06 Oct 2006)
New Revision: 16332
Log:
fixup from Bernd Schmidt to properly document DL_ADDR_TO_FUNC_PTR
Modified:
trunk/uClibc/ldso/include/dl-defs.h
Changeset:
Modified: trunk/uClibc/ldso/include/dl-defs.h
===================================================================
--- trunk/uClibc/ldso/include/dl-defs.h 2006-10-07 06:36:32 UTC (rev 16331)
+++ trunk/uClibc/ldso/include/dl-defs.h 2006-10-07 06:40:20 UTC (rev 16332)
@@ -140,13 +140,19 @@
&& (!(TFROM) || (TFROM)->loadaddr < (TPNT)->loadaddr))
#endif
+/* Use this macro to convert a pointer to a function's entry point to
+ * a pointer to function. The pointer is assumed to have already been
+ * relocated. LOADADDR is passed because it may contain additional
+ * information needed to compute the pointer to function.
+ */
+#ifndef DL_ADDR_TO_FUNC_PTR
+# define DL_ADDR_TO_FUNC_PTR(ADDR, LOADADDR) ((void(*)(void))(ADDR))
+#endif
+
/* On some platforms, computing a pointer to function is more
expensive than calling a function at a given address, so this
alternative is provided. The function signature must be given
within parentheses, as in a type cast. */
-#ifndef DL_ADDR_TO_FUNC_PTR
-# define DL_ADDR_TO_FUNC_PTR(ADDR, LOADADDR) (ADDR)
-#endif
#ifndef DL_CALL_FUNC_AT_ADDR
# define DL_CALL_FUNC_AT_ADDR(ADDR, LOADADDR, SIGNATURE, ...) \
((*SIGNATURE DL_ADDR_TO_FUNC_PTR ((ADDR), (LOADADDR)))(__VA_ARGS__))
More information about the uClibc-cvs
mailing list