[gst-devel] Cothreads on alpha

Erik Walthinsen omega at temple-baptist.com
Sun Jan 14 12:18:35 CET 2001


OK, I see how it works for ppc now...  gstppc.h and gsti386.h contain the
relevant bits of code.  Nice ;-)

But that means we need to scramble for gstalpha.h in order to get the
build going.  I tried to get as far as a fakesrc ! fakesink pipeline, and
ran into the lack of cothreads support routines.  Here are the i386 and
ppc routines:

/* i386 */
#define GET_SP(target) \
  __asm__("movl %%esp, %0" : "=m"(target) : : "esp", "ebp");
#define SET_SP(source) \
  __asm__("movl %0, %%esp\n" : "=m"(thread->sp));
#define JUMP(target) \
    __asm__("jmp " SYMBOL_NAME_STR(cothread_stub))
#define SETUP_STACK(sp) do ; while(0)

/* ppc */
#define GET_SP(target) \
    __asm__("stw 1,%0" : "=m"(target) : : "r1");
#define SET_SP(source) \
    __asm__("lwz 1,%0" : "=m"(source))
#define JUMP(target) \
    __asm__("b " SYMBOL_NAME_STR(cothread_stub))
struct minimal_ppc_stackframe {
    unsigned long back_chain;
    unsigned long LR_save;
    unsigned long unused1;
    unsigned long unused2;
};
#define SETUP_STACK(sp) \
    sp = ((unsigned long *)(sp)) - 4; \
    ((struct minimal_ppc_stackframe *)sp)->back_chain = 0;

Hopefully there's someone here who knows Alpha well enough to code up
these functions.  I'll probably hold off on the contest build until we
have something that works.  I won't leak any of the timings I've taken so
far, and my bet is (for reference) locked at 4hrs, wtay can confirm that.

TTYL,
    Omega

      Erik Walthinsen <omega at temple-baptist.com> - System Administrator
        __
       /  \                GStreamer - The only way to stream!
      |    | M E G A        ***** http://gstreamer.net/ *****
      _\  /_





More information about the gstreamer-devel mailing list