diff options
author | andreast <andreast@FreeBSD.org> | 2012-03-04 11:55:28 +0000 |
---|---|---|
committer | andreast <andreast@FreeBSD.org> | 2012-03-04 11:55:28 +0000 |
commit | 2e83fcc66188fc1cc5216900c5441dd22e736c2b (patch) | |
tree | 40f1e2301d9c1af5a6e5f96f1ab6947715ebdf6c /sys/powerpc/include | |
parent | d3c673348a51e3f37168fd1973291a6dd51b83dc (diff) | |
download | FreeBSD-src-2e83fcc66188fc1cc5216900c5441dd22e736c2b.zip FreeBSD-src-2e83fcc66188fc1cc5216900c5441dd22e736c2b.tar.gz |
Restore proper dot symbol creation for assembly files in the kernel build case.
Without this patch we were not able to see the assembly function.
Only the function descriptor was visible.
- Distinguish between user-land and kernel when creating the ENTRY() point of
assembly source.
- Make the ENTRY() macro more readable, replace the .align directive with the
gas platform independant .p2align directive.
- Create an END()macro for later use to provide traceback tables on powerpc64.
Diffstat (limited to 'sys/powerpc/include')
-rw-r--r-- | sys/powerpc/include/asm.h | 59 |
1 files changed, 46 insertions, 13 deletions
diff --git a/sys/powerpc/include/asm.h b/sys/powerpc/include/asm.h index 5f8b779..e571316 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 __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 +#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 */ + +#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)) |