Mac Intel

Mikael Pettersson <>
Thu Aug 10 13:46:11 CEST 2006


Joel Reymont writes:
 > Mikael,
 > 
 > This is my chunk of code form hipe_x86_bifs.m4. I'm wrapping $1 with  
 > ASYM and $2 with CSYM.
 > 
 > I'm not well-versed with M4, though, so I'm wondering about "addl ` 
 > $'8, %esp" below. Does that need to be wrapped as well? What should  
 > it look like?
 > 
 > 	Thanks, Joel
 > 
 > --
 > define(nocons_nofail_primop_interface_1,
 > `
 > #ifndef HAVE_$1
 > #`define' HAVE_$1
 > 	TEXT
 > 	.align	4
 > 	GLOBAL(ASYM($1))
 > ASYM($1):
 > 	/* copy native stack pointer */
 > 	NBIF_COPY_NSP(1)
 > 
 > 	/* switch to C stack */
 > 	SWITCH_ERLANG_TO_C_QUICK
 > 
 > 	/* make the call on the C stack */
 > 	pushl	NBIF_ARG(1,0)
 > 	pushl	P
 > 	call	CSYM($2)
 > 	addl	`$'8, %esp
 > 
 > 	/* switch to native stack */
 > 	SWITCH_C_TO_ERLANG_QUICK
 > 
 > 	/* return */
 > 	NBIF_RET(1)
 > 	SET_SIZE(ASYM($1))
 > 	TYPE_FUNCTION(ASYM($1))
 > #endif')

This looks OK. Only the $1 and $2 definitions and references should be
wrapped. The "addl `$'8, %esp" is unrelated to the Darwin naming quirks
and MUST NOT be altered.



More information about the erlang-questions mailing list