summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/include/asm.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sparc/include/asm.h')
-rw-r--r--sys/arch/sparc/include/asm.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/sys/arch/sparc/include/asm.h b/sys/arch/sparc/include/asm.h
index d1f4082b5f0..d3382f94cda 100644
--- a/sys/arch/sparc/include/asm.h
+++ b/sys/arch/sparc/include/asm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asm.h,v 1.2 1997/08/08 08:26:02 downsj Exp $ */
+/* $OpenBSD: asm.h,v 1.3 2002/08/11 12:13:16 art Exp $ */
/* $NetBSD: asm.h,v 1.5 1997/07/16 15:16:43 christos Exp $ */
/*
@@ -45,13 +45,36 @@
#ifndef _ASM_H_
#define _ASM_H_
+#ifdef __ELF__
+#define _C_LABEL(name) name
+#else
#ifdef __STDC__
#define _C_LABEL(name) _ ## name
#else
#define _C_LABEL(name) _/**/name
#endif
+#endif
#define _ASM_LABEL(name) name
+/*
+ * WEAK_ALIAS: create a weak alias (ELF only)
+ */
+#ifdef __ELF__
+#define WEAK_ALIAS(alias,sym) \
+ .weak alias; \
+ alias = sym
+#endif
+
+/*
+ * WARN_REFERENCES: create a warning if the specified symbol is referenced
+ * (ELF only).
+ */
+#ifdef __ELF__
+#define WARN_REFERENCES(_sym,_msg) \
+ .section .gnu.warning. ## _sym ; .ascii _msg ; .text
+#endif /* __ELF__ */
+
+
#ifdef PIC
/*
* PIC_PROLOGUE() is akin to the compiler generated function prologue for
@@ -61,8 +84,8 @@
*/
#define PIC_PROLOGUE(dest,tmp) \
mov %o7,tmp; 3: call 4f; nop; 4: \
- sethi %hi(__GLOBAL_OFFSET_TABLE_-(3b-.)),dest; \
- or dest,%lo(__GLOBAL_OFFSET_TABLE_-(3b-.)),dest; \
+ sethi %hi(_C_LABEL(_GLOBAL_OFFSET_TABLE_)-(3b-.)),dest; \
+ or dest,%lo(_C_LABEL(_GLOBAL_OFFSET_TABLE_)-(3b-.)),dest; \
add dest,%o7,dest; mov tmp,%o7
/*