786 |
void * GC_save_regs_in_stack(); |
void * GC_save_regs_in_stack(); |
787 |
#endif |
#endif |
788 |
|
|
789 |
|
#if defined(__hppa__) /* Courtesy of Lamont Jones */ |
790 |
|
/* the calling sequence */ |
791 |
|
struct regs { |
792 |
|
void *callee_saves[16]; |
793 |
|
}; |
794 |
|
void hppa_save_regs(struct regs); |
795 |
|
|
796 |
|
/* the code */ |
797 |
|
|
798 |
|
asm(".code"); |
799 |
|
asm(".export hppa_save_regs, entry"); |
800 |
|
asm(".proc"); |
801 |
|
asm(".callinfo"); |
802 |
|
asm(".label hppa_save_regs"); |
803 |
|
asm(".entry"); |
804 |
|
|
805 |
|
asm("stw %r3,0(%arg0)"); |
806 |
|
asm("stw %r4,4(%arg0)"); |
807 |
|
asm("stw %r5,8(%arg0)"); |
808 |
|
asm("stw %r6,12(%arg0)"); |
809 |
|
asm("stw %r7,16(%arg0)"); |
810 |
|
asm("stw %r8,20(%arg0)"); |
811 |
|
asm("stw %r9,24(%arg0)"); |
812 |
|
asm("stw %r10,28(%arg0)"); |
813 |
|
asm("stw %r11,32(%arg0)"); |
814 |
|
asm("stw %r12,36(%arg0)"); |
815 |
|
asm("stw %r13,40(%arg0)"); |
816 |
|
asm("stw %r14,44(%arg0)"); |
817 |
|
asm("stw %r15,48(%arg0)"); |
818 |
|
asm("stw %r16,52(%arg0)"); |
819 |
|
asm("stw %r17,56(%arg0)"); |
820 |
|
asm("bv 0(%rp)"); |
821 |
|
asm("stw %r18,60(%arg0)"); |
822 |
|
|
823 |
|
asm(".exit"); |
824 |
|
asm(".procend"); |
825 |
|
asm(".end"); |
826 |
|
#endif |
827 |
|
|
828 |
void |
void |
829 |
mark_c_stack(jmp_buf env1, int n, void (*fn)(void *,void *,int)) { |
mark_c_stack(jmp_buf env1, int n, void (*fn)(void *,void *,int)) { |
830 |
|
|
831 |
|
#if defined(__hppa__) |
832 |
|
struct regs hppa_regs; |
833 |
|
#endif |
834 |
jmp_buf env; |
jmp_buf env; |
835 |
int where; |
int where; |
836 |
if (n== N_RECURSION_REQD) |
if (n== N_RECURSION_REQD) |
837 |
c_stack_where = (long *) (void *) &env; |
c_stack_where = (long *) (void *) &env; |
838 |
if (n > 0 ) { |
if (n > 0 ) { |
839 |
|
#if defined(__hppa__) |
840 |
|
hppa_save_regs(hppa_regs); |
841 |
|
#else |
842 |
setjmp(env); |
setjmp(env); |
843 |
|
#endif |
844 |
mark_c_stack(env,n - 1,fn); |
mark_c_stack(env,n - 1,fn); |
845 |
} else { |
} else { |
846 |
|
|
1015 |
int (*GBC_exit_hook)() = NULL; |
int (*GBC_exit_hook)() = NULL; |
1016 |
char *old_rb_start; |
char *old_rb_start; |
1017 |
|
|
|
/* #if defined(__hppa__) */ |
|
|
/* asm( */ |
|
|
/* ".code\n\t" */ |
|
|
/* ".export GBC,entry\n\t" */ |
|
|
/* ".import GBC1,code\n\t" */ |
|
|
/* ".proc\n\t" */ |
|
|
/* ".callinfo entry_gr=18, calls, save_rp\n\t" */ |
|
|
/* ".label GBC\n\t" */ |
|
|
/* ".entry\n\t" */ |
|
|
/* "stw %rp,-20(%sp)\n\t" */ |
|
|
/* "stwm %r3,128(%sp)\n\t" */ |
|
|
/* "stw %r4,-124(%sp)\n\t" */ |
|
|
/* "stw %r5,-120(%sp)\n\t" */ |
|
|
/* "stw %r6,-116(%sp)\n\t" */ |
|
|
/* "stw %r7,-112(%sp)\n\t" */ |
|
|
/* "stw %r8,-108(%sp)\n\t" */ |
|
|
/* "stw %r9,-104(%sp)\n\t" */ |
|
|
/* "stw %r10,-100(%sp)\n\t" */ |
|
|
/* "stw %r11,-96(%sp)\n\t" */ |
|
|
/* "stw %r12,-92(%sp)\n\t" */ |
|
|
/* "stw %r13,-88(%sp)\n\t" */ |
|
|
/* "stw %r14,-84(%sp)\n\t" */ |
|
|
/* "stw %r15,-80(%sp)\n\t" */ |
|
|
/* "stw %r16,-76(%sp)\n\t" */ |
|
|
/* "stw %r17,-72(%sp)\n\t" */ |
|
|
/* "stw %r18,-68(%sp)\n\t" */ |
|
|
/* "bl GBC1,%rp\n\t" */ |
|
|
/* "nop\n\t" */ |
|
|
/* "ldw -148(%sp),%rp\n\t" */ |
|
|
/* "ldw -72(%sp),%r18\n\t" */ |
|
|
/* "ldw -68(%sp),%r17\n\t" */ |
|
|
/* "ldw -76(%sp),%r16\n\t" */ |
|
|
/* "ldw -80(%sp),%r15\n\t" */ |
|
|
/* "ldw -84(%sp),%r14\n\t" */ |
|
|
/* "ldw -88(%sp),%r13\n\t" */ |
|
|
/* "ldw -92(%sp),%r12\n\t" */ |
|
|
/* "ldw -96(%sp),%r11\n\t" */ |
|
|
/* "ldw -100(%sp),%r10\n\t" */ |
|
|
/* "ldw -104(%sp),%r9\n\t" */ |
|
|
/* "ldw -108(%sp),%r8\n\t" */ |
|
|
/* "ldw -112(%sp),%r7\n\t" */ |
|
|
/* "ldw -116(%sp),%r6\n\t" */ |
|
|
/* "ldw -120(%sp),%r5\n\t" */ |
|
|
/* "ldw -124(%sp),%r4\n\t" */ |
|
|
/* "bv 0(%rp)\n\t" */ |
|
|
/* "ldwm 128(%sp),%r3\n\t" */ |
|
|
|
|
|
/* ".exit\n\t" */ |
|
|
/* ".procend\n\t" */ |
|
|
/* ".end\n\t" */ |
|
|
/* ); */ |
|
|
|
|
|
/* void */ |
|
|
/* GBC1(enum type t) { */ |
|
|
/* #else */ |
|
1018 |
void |
void |
1019 |
GBC(enum type t) { |
GBC(enum type t) { |
|
/* #endif */ |
|
1020 |
|
|
1021 |
int i, j; |
int i, j; |
1022 |
struct apage *pp, *qq; |
struct apage *pp, *qq; |