Port-powerpc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ppc equivalent to x86 stack asm instructions?



I'm trying to compile a program called tnos which will allow me to do
ax25 (ham tcp/ip) on netbsd. I'm running into a problem with some weird
code it uses to manipulate the stack (involved in some sort of longjump()
call).

The relevant code:

#ifdef __386BSD__
        .file   "setsp.s"
        .globl  _setstack
_setstack:
        movl    %esp, %ebp
        movl    _newstackptr, %esp
        jmp     *(%ebp)
        .align  4
#endif

Can someone translate this to ppc asm for me please?

Alternately, there is a different chunk of code which does the same thing
inline (but for linux). It's defines are:
#define TNOS_PC(p) (p->env[0].__jmpbuf[JB_PC])
#define TNOS_SP(p) (p->env[0].__jmpbuf[JB_SP])

I tried this:
#define TNOS_PC(p) (p->env[0].__jmpbuf[JB_LR])
#define TNOS_SP(p) (p->env[0].__jmpbuf[JB_GPR1])

But it didn't work.

Thanks for any clues....
Bob



Home | Main Index | Thread Index | Old Index