summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/asm.h
diff options
context:
space:
mode:
authorandreast <andreast@FreeBSD.org>2013-11-21 21:25:58 +0000
committerandreast <andreast@FreeBSD.org>2013-11-21 21:25:58 +0000
commit3eb2c9b8dd1cb275159a8413feae04232f578522 (patch)
tree366d8180456720ddc0a9d3562c7413bda57970e1 /sys/amd64/include/asm.h
parent36699710473d4c46ebaedb4b2f50404d28375585 (diff)
downloadFreeBSD-src-3eb2c9b8dd1cb275159a8413feae04232f578522.zip
FreeBSD-src-3eb2c9b8dd1cb275159a8413feae04232f578522.tar.gz
Introduce a WEAK_REFERENCE() alias and use it. Get rid of the CNAME and the
CONCAT macros in SYS.h. Reviewed by: bde, kib
Diffstat (limited to 'sys/amd64/include/asm.h')
-rw-r--r--sys/amd64/include/asm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/amd64/include/asm.h b/sys/amd64/include/asm.h
index 078da03..87272f7 100644
--- a/sys/amd64/include/asm.h
+++ b/sys/amd64/include/asm.h
@@ -77,6 +77,15 @@
#endif
#define END(x) .size x, . - x
+/*
+ * WEAK_REFERENCE(): create a weak reference alias from sym.
+ * The macro is not a general asm macro that takes arbitrary names,
+ * but one that takes only C names. It does the non-null name
+ * translation inside the macro.
+ */
+#define WEAK_REFERENCE(sym, alias) \
+ .weak CNAME(alias); \
+ .equ CNAME(alias),CNAME(sym)
#define RCSID(x) .text; .asciz x
OpenPOWER on IntegriCloud