From owner-svn-src-all@FreeBSD.ORG Sun Mar 4 11:55:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39A41106564A; Sun, 4 Mar 2012 11:55:29 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F29B8FC16; Sun, 4 Mar 2012 11:55:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q24BtSt0033449; Sun, 4 Mar 2012 11:55:28 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q24BtSZn033447; Sun, 4 Mar 2012 11:55:28 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201203041155.q24BtSZn033447@svn.freebsd.org> From: Andreas Tobler Date: Sun, 4 Mar 2012 11:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232488 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 11:55:29 -0000 Author: andreast Date: Sun Mar 4 11:55:28 2012 New Revision: 232488 URL: http://svn.freebsd.org/changeset/base/232488 Log: 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. Modified: head/sys/powerpc/include/asm.h Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Sun Mar 4 11:11:03 2012 (r232487) +++ head/sys/powerpc/include/asm.h Sun Mar 4 11:55:28 2012 (r232488) @@ -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))