[gst-devel] Re: Fill in the blank (fwd)

Thomas Vander Stichele thomas at urgent.rug.ac.be
Tue Dec 10 13:28:20 CET 2002


some info from Ulrich drepper on what we can put in gstarch.h

Can anyone integrate this ?

-- 

The Dave/Dina Project : future TV today ! - http://davedina.apestaart.org/
<-*- thomas (dot) apestaart (dot) org -*->
Kiss me please kiss me
Kiss me out of desire baby not consolation
Oh you know it makes me so angry cause I know that in time
I'll only make you cry
<-*- thomas  (at) apestaart (dot) org -*->
URGent, the best radio on the Internet - 24/7 ! - http://urgent.rug.ac.be/

> /***** Intel x86 *****/
> #if defined(HAVE_CPU_I386)
> #define GST_ARCH_SET_SP(stackpointer) \
>   __asm__( "movl %0, %%esp\n" : : "r"(stackpointer) );
> 
> #define GST_ARCH_CALL(target) \
>     __asm__("call *%0" : : "r"(target) );
> 
> /* assuming the stackframe is 16 bytes */
> #define GST_ARCH_SETUP_STACK(sp) sp -= 4

GST_ARCH_SETUP_STACK should be able to be empty.  If the cothread
returns it's doomed.  In any case, use (sp) -= 4 (missing parenthesis).

>From stack, the x86-64 code can look like this:


#define GST_ARCH_SET_SP(stackpointer) \
  __asm__( "movq %q0, %%rsp\n" : : "r"(stackpointer) );

#define GST_ARCH_CALL(target) \
    __asm__("call *%0" : : "r"(target) );

#define GST_ARCH_SETUP_STACK(sp)


If this fails try


#define GST_ARCH_SETUP_STACK(sp) (sp) -= 4

but I cannot why.



IA-64 is more complex.  The current infrastructure cannot support it.
IA-64 needs two stacks.  They usually are placed in the same memory
region.  The normal stack at the top (it grows downward) and the
register stack at the bottom (it grows upward).

The stack size is available in thread->stack_size but still, the
GST_ARCH_SET_SP macro needs to get this information passed as well.  All
architectures beside IA-64 can ignore it.

I'm not all sure we can handle ia64 in this simplified setup.  Using
makecontext would be much better.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------





More information about the gstreamer-devel mailing list