diff options
author | Micael Karlberg <[email protected]> | 2011-04-08 11:28:47 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-04-08 11:28:47 +0200 |
commit | c7022587ac4974dc13403e8493a9885e32f44e7b (patch) | |
tree | 4fc2191d1bcffad7d1b1fc9072f31cc36df77cc0 /erts/emulator/hipe/hipe_ppc_asm.m4 | |
parent | 2b46b0e42fe95d99619ffa343537c8468e27295c (diff) | |
parent | 5ad09d2928fd4584ce6dc50f44825b3f6d7ef66a (diff) | |
download | otp-c7022587ac4974dc13403e8493a9885e32f44e7b.tar.gz otp-c7022587ac4974dc13403e8493a9885e32f44e7b.tar.bz2 otp-c7022587ac4974dc13403e8493a9885e32f44e7b.zip |
Merge branch 'dev' into bmk/snmp/snmp420_integration
Diffstat (limited to 'erts/emulator/hipe/hipe_ppc_asm.m4')
-rw-r--r-- | erts/emulator/hipe/hipe_ppc_asm.m4 | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/erts/emulator/hipe/hipe_ppc_asm.m4 b/erts/emulator/hipe/hipe_ppc_asm.m4 index a0f8b78679..0eb5c441e6 100644 --- a/erts/emulator/hipe/hipe_ppc_asm.m4 +++ b/erts/emulator/hipe/hipe_ppc_asm.m4 @@ -1,25 +1,24 @@ changecom(`/*', `*/')dnl /* * %CopyrightBegin% - * - * Copyright Ericsson AB 2004-2009. All Rights Reserved. - * + * + * Copyright Ericsson AB 2004-2011. All Rights Reserved. + * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved online at http://www.erlang.org/. - * + * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. - * + * * %CopyrightEnd% */ -/* - * $Id$ - */ + + `#ifndef HIPE_PPC_ASM_H #define HIPE_PPC_ASM_H' @@ -63,15 +62,31 @@ ifelse(OPSYS,darwin,`` #define SEMI @ #define SET_SIZE(NAME) /*empty*/ #define TYPE_FUNCTION(NAME) /*empty*/ +#define OPD(NAME) /*empty*/ '',`` /* Not Darwin */'' `ifelse(ARCH,ppc64,`` /* 64-bit */ +/* + * The 64-bit PowerPC ABI requires us to setup Official Procedure Descriptors + * for functions called from C. These are exported as "func", while the entry + * point should is exported as ".func". A function pointer in C points to the + * function descriptor in the opd rather than to the function entry point. + */ #define JOIN(X,Y) X##Y #define CSYM(NAME) JOIN(.,NAME) +#define OPD(NAME) \ + .pushsection .opd, "aw"; \ + .align 3; \ + .global NAME; \ +NAME: \ + .quad CSYM(NAME), .TOC.@tocbase, 0; \ + .type NAME, @function; \ + .popsection '',`` /* 32-bit */ #define CSYM(NAME) NAME +#define OPD(NAME) /*empty*/ '')' ``#define ASYM(NAME) NAME #define GLOBAL(NAME) .global NAME |