aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_x86_asm.m4
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-10-13 20:09:19 +0200
committerSverker Eriksson <[email protected]>2014-10-24 18:12:16 +0200
commitda3073e8d3d26ec6c63979a22c913d7758eeed71 (patch)
tree57f185f5c002e09f2a3532a1c703be0189fcafc6 /erts/emulator/hipe/hipe_x86_asm.m4
parente45a4a8a3797a637a23ad5d660138c021f3ba1b1 (diff)
downloadotp-da3073e8d3d26ec6c63979a22c913d7758eeed71.tar.gz
otp-da3073e8d3d26ec6c63979a22c913d7758eeed71.tar.bz2
otp-da3073e8d3d26ec6c63979a22c913d7758eeed71.zip
erts: Extend usage of ASM macro to avoid including asm macros in C code
and reduce the probability of macro name collisions Catalyst: ppc macro "r0" conflicting with local variable in external.c
Diffstat (limited to 'erts/emulator/hipe/hipe_x86_asm.m4')
-rw-r--r--erts/emulator/hipe/hipe_x86_asm.m420
1 files changed, 15 insertions, 5 deletions
diff --git a/erts/emulator/hipe/hipe_x86_asm.m4 b/erts/emulator/hipe/hipe_x86_asm.m4
index 020ccf8d4b..39c5cb1044 100644
--- a/erts/emulator/hipe/hipe_x86_asm.m4
+++ b/erts/emulator/hipe/hipe_x86_asm.m4
@@ -33,6 +33,18 @@ define(SIMULATE_NSP,0)dnl change to 1 to simulate call/ret insns
`#define X86_LEAF_WORDS 'LEAF_WORDS
`#define LEAF_WORDS 'LEAF_WORDS
+`#define X86_NR_ARG_REGS 'NR_ARG_REGS
+`#define NR_ARG_REGS 'NR_ARG_REGS
+
+`#define X86_HP_IN_ESI 'HP_IN_ESI
+`#define X86_SIMULATE_NSP 'SIMULATE_NSP
+
+
+`#ifdef ASM'
+/*
+ * Only assembler stuff from here on (when included from *.S)
+ */
+
/*
* Workarounds for Darwin.
*/
@@ -60,7 +72,6 @@ ifelse(OPSYS,darwin,``
*/
`#define P %ebp'
-`#define X86_HP_IN_ESI 'HP_IN_ESI
`#if X86_HP_IN_ESI
#define SAVE_HP movl %esi, P_HP(P)
#define RESTORE_HP movl P_HP(P), %esi
@@ -73,7 +84,6 @@ ifelse(OPSYS,darwin,``
#define SAVE_CSP movl %esp, P_CSP(P)
#define RESTORE_CSP movl P_CSP(P), %esp'
-`#define X86_SIMULATE_NSP 'SIMULATE_NSP
/*
* Context switching macros.
@@ -100,12 +110,10 @@ ifelse(OPSYS,darwin,``
SAVE_CACHED_STATE; \
SWITCH_ERLANG_TO_C_QUICK'
+
/*
* Argument (parameter) registers.
*/
-`#define X86_NR_ARG_REGS 'NR_ARG_REGS
-`#define NR_ARG_REGS 'NR_ARG_REGS
-
ifelse(eval(NR_ARG_REGS >= 1),0,,
``#define ARG0 %eax
'')dnl
@@ -282,4 +290,6 @@ define(LOAD_CALLER_SAVE,`LAR_N(eval(NR_CALLER_SAVE-1))')dnl
`#define STORE_CALLER_SAVE 'STORE_CALLER_SAVE
`#define LOAD_CALLER_SAVE 'LOAD_CALLER_SAVE
+`#endif /* ASM */'
+
`#endif /* HIPE_X86_ASM_H */'