[MPlayer-dev-eng] OT: loader/stubs.s:EH_prolog convertion to C

Mark Zealey mark at zealos.org
Wed Oct 23 21:18:30 CEST 2002


> read my mail to the end first.
> 
> i do not want to convert it to C, only insert it into C source file as __asm__(...)
> 
> and yes, it doesn't returns to the caller, instead it calls some functions inside the caller
> dll (and it works).
> 
> first it did corruptions, but after some tricks it's working nice. I only wanted to get
> some hints if it can be done better.

I did read your email to the end, but I really dont like the compiler abuse. I
seriously would just do something like:

extern void EH_prolog();

__asm__(
	".globl EH_prolog		"
	"EH_prolog:			"
	"	pushl $0xff		"
	"	pushl %eax		"
	"	pushl %fs:0		"
	"	movl %esp, %fs:0	"
	"	movl 12(%esp), %eax	"
	"	movl %ebp, 12(%esp)	"
	"	leal 12(%esp), %ebp	"
	"	pushl %eax		"
	"	ret			"
);

Which is a lot neater imho and retains all the magic optomized as asm. If you
really really really want to use the C function there is a gcc __attribute__
thing which you can use to signify that the function doesn't return,
__attribute__((noreturn)) iirc.

-- 

Mark Zealey (aka JALH on irc.oftc.net: #zealos and many more)
mark at zealos.org; mark at itsolve.co.uk

UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a17! C++++>$ P++++>+++++$ L+++>+++++$
!E---? W+++>$ !w--- r++ !t---?@ !X---?  !R- !tv b+ G+++ e>+++++ !h++* r!-- y--



More information about the MPlayer-dev-eng mailing list