2000-09-15 22:44:10 +00:00
|
|
|
#ifndef GST_HGUARD_GSTPPC_H
|
|
|
|
#define GST_HGUARD_GSTPPC_H
|
|
|
|
|
2000-09-16 00:59:12 +00:00
|
|
|
/* FIXME: Hmm - does this work?
|
2000-09-15 22:44:10 +00:00
|
|
|
*/
|
2000-09-16 00:59:12 +00:00
|
|
|
#define GET_SP(target) \
|
2000-09-21 00:57:09 +00:00
|
|
|
__asm__("stw 1,%0" : "=m"(target) : : "r1");
|
2000-09-15 22:44:10 +00:00
|
|
|
|
2000-09-16 00:59:12 +00:00
|
|
|
#define SET_SP(source) \
|
2000-09-21 00:57:09 +00:00
|
|
|
__asm__("lwz 1,%0" : "=m"(source))
|
2000-09-15 22:44:10 +00:00
|
|
|
|
|
|
|
#define JUMP(target) \
|
|
|
|
__asm__("b " SYMBOL_NAME_STR(cothread_stub))
|
|
|
|
|
2000-09-21 00:57:09 +00:00
|
|
|
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;
|
|
|
|
|
2000-09-15 22:44:10 +00:00
|
|
|
#endif /* GST_HGUARD_GSTPPC_H */
|