home *** CD-ROM | disk | FTP | other *** search
- #include <sys/regdef.h>
- #include <sys/asm.h>
-
- /*
- void *_stacktrace_get_pc();
- */
- LEAF(_stacktrace_get_pc)
- move v0,ra /* our ra is pc of the caller, I hope */
- j ra
- END(_stacktrace_get_pc)
-
-
- /*
- void *_stacktrace_get_sp();
- */
- LEAF(_stacktrace_get_sp)
- move v0,sp /* this is a leaf so sp doesn't change, I hope */
- j ra
- END(_stacktrace_get_sp)
-
-
- /*
- void _stacktrace_get_regs(void *regs[32]);
- */
- LEAF(_stacktrace_get_regs)
- sw $31, 31*4(a0) /* XXX not right, but this app doesn't care */
- sw $30, 30*4(a0)
- sw $29, 29*4(a0)
- sw $28, 28*4(a0)
- sw $27, 27*4(a0)
- sw $26, 26*4(a0)
- sw $25, 25*4(a0)
- sw $24, 24*4(a0)
- sw $23, 23*4(a0)
- sw $22, 22*4(a0)
- sw $21, 21*4(a0)
- sw $20, 20*4(a0)
- sw $19, 19*4(a0)
- sw $18, 18*4(a0)
- sw $17, 17*4(a0)
- sw $16, 16*4(a0)
- sw $15, 15*4(a0)
- sw $14, 14*4(a0)
- sw $13, 13*4(a0)
- sw $12, 12*4(a0)
- sw $11, 11*4(a0)
- sw $10, 10*4(a0)
- sw $9, 9*4(a0)
- sw $8, 8*4(a0)
- sw $7, 7*4(a0)
- sw $6, 6*4(a0)
- sw $5, 5*4(a0)
- sw $4, 4*4(a0)
- sw $3, 3*4(a0)
- sw $2, 2*4(a0)
- /* sw $1, 1*4(a0) */
- sw $0, 0*4(a0)
- j ra
- END(_stacktrace_get_regs)
-