summaryrefslogtreecommitdiff
path: root/sys/powerpc/include/asm.h
diff options
context:
space:
mode:
authorAndreas Tobler <andreast@FreeBSD.org>2012-03-04 11:55:28 +0000
committerAndreas Tobler <andreast@FreeBSD.org>2012-03-04 11:55:28 +0000
commitd59a23dc098fd39673df7e543dbd3c15e1c0f357 (patch)
tree40f1e2301d9c1af5a6e5f96f1ab6947715ebdf6c /sys/powerpc/include/asm.h
parent2db13e75757a7d77916e72a37758584e0aba8f37 (diff)
Notes
Diffstat (limited to 'sys/powerpc/include/asm.h')
-rw-r--r--sys/powerpc/include/asm.h57
1 files changed, 45 insertions, 12 deletions
diff --git a/sys/powerpc/include/asm.h b/sys/powerpc/include/asm.h
index 5f8b77910eb1..e571316d15ea 100644
--- a/sys/powerpc/include/asm.h
+++ b/sys/powerpc/include/asm.h
@@ -61,19 +61,51 @@
#define HIDENAME(asmsym) __CONCAT(.,asmsym)
#endif
-#define _GLOBAL(x) \
- .data; .align 2; .globl x; x:
+#ifdef _KERNEL
+#define DOT_LABEL(name) __CONCAT(.,name)
+#define TYPE_ENTRY(name) .size name,24; \
+ .type DOT_LABEL(name),@function; \
+ .globl DOT_LABEL(name);
+#define END_SIZE(name) .size DOT_LABEL(name),.-DOT_LABEL(name);
+#else /* !_KERNEL */
+#define DOT_LABEL(name) __CONCAT(.L.,name)
+#define TYPE_ENTRY(name) .type name,@function;
+#define END_SIZE(name) .size name,.-DOT_LABEL(name);
+#endif /* _KERNEL */
-#ifdef __powerpc64__
-#define _ENTRY(x) \
- .text; .align 2; .globl x; .section ".opd","aw"; \
- .align 3; x: \
- .quad .L.x,.TOC.@tocbase,0; .size x,24; .previous; \
- .align 4; .type x,@function; .L.x:
-#else
-#define _ENTRY(x) \
- .text; .align 4; .globl x; .type x,@function; x:
-#endif
+#define _GLOBAL(name) \
+ .data; \
+ .p2align 2; \
+ .globl name; \
+ name:
+
+#ifdef __powerpc64__
+#define _ENTRY(name) \
+ .section ".text"; \
+ .p2align 2; \
+ .globl name; \
+ .section ".opd","aw"; \
+ .p2align 3; \
+ name: \
+ .quad DOT_LABEL(name),.TOC.@tocbase,0; \
+ .previous; \
+ .p2align 4; \
+ TYPE_ENTRY(name) \
+DOT_LABEL(name):
+
+#define _END(name) \
+ .long 0; \
+ .byte 0,0,0,0,0,0,0,0; \
+ END_SIZE(name)
+#else /* !__powerpc64__ */
+#define _ENTRY(name) \
+ .text; \
+ .p2align 4; \
+ .globl name; \
+ .type name,@function; \
+ name:
+#define _END(name)
+#endif /* __powerpc64__ */
#if defined(PROF) || (defined(_KERNEL) && defined(GPROF))
# ifdef __powerpc64__
@@ -99,6 +131,7 @@
#endif
#define ASENTRY(y) _ENTRY(ASMNAME(y)); _PROF_PROLOGUE
+#define END(y) _END(CNAME(y))
#define ENTRY(y) _ENTRY(CNAME(y)); _PROF_PROLOGUE
#define GLOBAL(y) _GLOBAL(CNAME(y))