180 |
|
isync |
181 |
|
lwarx r5,0,r3 |
182 |
|
cmpi 0,r5,0x0000 |
183 |
< |
beq 1f |
183 |
> |
bne 1f |
184 |
|
stwcx. r4,0,r3 |
185 |
|
bne- 0b |
186 |
|
1: isync |
245 |
|
// Restore PowerPC registers |
246 |
|
lwz r1,XLM_EMUL_RETURN_STACK(0) |
247 |
|
RESTORE_SYSTEM_R2 |
248 |
+ |
RESTORE_SYSTEM_R13 |
249 |
|
lmw r13,20(r1) |
250 |
|
lfd f14,20+19*4+0*8(r1) |
251 |
|
lfd f15,20+19*4+1*8(r1) |
345 |
|
lwz r0,56+19*4+18*8+4(r1) |
346 |
|
mtlr r0 |
347 |
|
addi r1,r1,56+19*4+18*8 |
348 |
+ |
RESTORE_SYSTEM_R2 |
349 |
+ |
RESTORE_SYSTEM_R13 |
350 |
|
blr |
351 |
|
|
352 |
|
|
383 |
|
mfxer r0 |
384 |
|
stw r0,16(r1) |
385 |
|
stw r2,12(r1) |
386 |
< |
stwu r1,-(24+16*4+15*8)(r1) |
384 |
< |
RESTORE_SYSTEM_R2 |
386 |
> |
stwu r1,-(56+16*4+15*8)(r1) |
387 |
|
|
388 |
|
// Save 68k registers (M68kRegisters) |
389 |
< |
stw r8,24+0*4(r1) // d[0]..d[7] |
390 |
< |
stw r9,24+1*4(r1) |
391 |
< |
stw r10,24+2*4(r1) |
392 |
< |
stw r11,24+3*4(r1) |
393 |
< |
stw r12,24+4*4(r1) |
394 |
< |
stw r13,24+5*4(r1) |
395 |
< |
stw r14,24+6*4(r1) |
396 |
< |
stw r15,24+7*4(r1) |
397 |
< |
stw r16,24+8*4(r1) // a[0]..a[7] |
398 |
< |
stw r17,24+9*4(r1) |
399 |
< |
stw r18,24+10*4(r1) |
400 |
< |
stw r19,24+11*4(r1) |
401 |
< |
stw r20,24+12*4(r1) |
402 |
< |
stw r21,24+13*4(r1) |
403 |
< |
stw r22,24+14*4(r1) |
404 |
< |
stw r3,24+15*4(r1) |
405 |
< |
stfd f0,24+16*4+0*8(r1) |
406 |
< |
stfd f1,24+16*4+1*8(r1) |
407 |
< |
stfd f2,24+16*4+2*8(r1) |
408 |
< |
stfd f3,24+16*4+3*8(r1) |
409 |
< |
stfd f4,24+16*4+4*8(r1) |
410 |
< |
stfd f5,24+16*4+5*8(r1) |
411 |
< |
stfd f6,24+16*4+6*8(r1) |
412 |
< |
stfd f7,24+16*4+7*8(r1) |
389 |
> |
stw r8,56+0*4(r1) // d[0]..d[7] |
390 |
> |
stw r9,56+1*4(r1) |
391 |
> |
stw r10,56+2*4(r1) |
392 |
> |
stw r11,56+3*4(r1) |
393 |
> |
stw r12,56+4*4(r1) |
394 |
> |
stw r13,56+5*4(r1) |
395 |
> |
stw r14,56+6*4(r1) |
396 |
> |
stw r15,56+7*4(r1) |
397 |
> |
stw r16,56+8*4(r1) // a[0]..a[7] |
398 |
> |
stw r17,56+9*4(r1) |
399 |
> |
stw r18,56+10*4(r1) |
400 |
> |
stw r19,56+11*4(r1) |
401 |
> |
stw r20,56+12*4(r1) |
402 |
> |
stw r21,56+13*4(r1) |
403 |
> |
stw r22,56+14*4(r1) |
404 |
> |
stw r3,56+15*4(r1) |
405 |
> |
stfd f0,56+16*4+0*8(r1) |
406 |
> |
stfd f1,56+16*4+1*8(r1) |
407 |
> |
stfd f2,56+16*4+2*8(r1) |
408 |
> |
stfd f3,56+16*4+3*8(r1) |
409 |
> |
stfd f4,56+16*4+4*8(r1) |
410 |
> |
stfd f5,56+16*4+5*8(r1) |
411 |
> |
stfd f6,56+16*4+6*8(r1) |
412 |
> |
stfd f7,56+16*4+7*8(r1) |
413 |
|
mffs f0 |
414 |
< |
stfd f8,24+16*4+8*8(r1) |
415 |
< |
stfd f9,24+16*4+9*8(r1) |
416 |
< |
stfd f10,24+16*4+10*8(r1) |
417 |
< |
stfd f11,24+16*4+11*8(r1) |
418 |
< |
stfd f12,24+16*4+12*8(r1) |
419 |
< |
stfd f13,24+16*4+13*8(r1) |
420 |
< |
stfd f0,24+16*4+14*8(r1) |
414 |
> |
stfd f8,56+16*4+8*8(r1) |
415 |
> |
stfd f9,56+16*4+9*8(r1) |
416 |
> |
stfd f10,56+16*4+10*8(r1) |
417 |
> |
stfd f11,56+16*4+11*8(r1) |
418 |
> |
stfd f12,56+16*4+12*8(r1) |
419 |
> |
stfd f13,56+16*4+13*8(r1) |
420 |
> |
stfd f0,56+16*4+14*8(r1) |
421 |
|
|
422 |
|
// Execute native routine |
423 |
|
RESTORE_SYSTEM_R2 |
424 |
|
RESTORE_SYSTEM_R13 |
425 |
< |
addi r3,r1,24 |
425 |
> |
addi r3,r1,56 |
426 |
|
mr r4,r24 |
427 |
|
bl C_SYMBOL_NAME(EmulOp) |
428 |
|
|
429 |
|
// Restore 68k registers (M68kRegisters) |
430 |
< |
lwz r8,24+0*4(r1) // d[0]..d[7] |
431 |
< |
lwz r9,24+1*4(r1) |
432 |
< |
lwz r10,24+2*4(r1) |
433 |
< |
lwz r11,24+3*4(r1) |
434 |
< |
lwz r12,24+4*4(r1) |
435 |
< |
lwz r13,24+5*4(r1) |
436 |
< |
lwz r14,24+6*4(r1) |
437 |
< |
lwz r15,24+7*4(r1) |
438 |
< |
lwz r16,24+8*4(r1) // a[0]..a[7] |
439 |
< |
lwz r17,24+9*4(r1) |
440 |
< |
lwz r18,24+10*4(r1) |
441 |
< |
lwz r19,24+11*4(r1) |
442 |
< |
lwz r20,24+12*4(r1) |
443 |
< |
lwz r21,24+13*4(r1) |
444 |
< |
lwz r22,24+14*4(r1) |
445 |
< |
lwz r3,24+15*4(r1) |
446 |
< |
lfd f13,24+16*4+14*8(r1) |
447 |
< |
lfd f0,24+16*4+0*8(r1) |
448 |
< |
lfd f1,24+16*4+1*8(r1) |
449 |
< |
lfd f2,24+16*4+2*8(r1) |
450 |
< |
lfd f3,24+16*4+3*8(r1) |
451 |
< |
lfd f4,24+16*4+4*8(r1) |
452 |
< |
lfd f5,24+16*4+5*8(r1) |
453 |
< |
lfd f6,24+16*4+6*8(r1) |
454 |
< |
lfd f7,24+16*4+7*8(r1) |
430 |
> |
lwz r8,56+0*4(r1) // d[0]..d[7] |
431 |
> |
lwz r9,56+1*4(r1) |
432 |
> |
lwz r10,56+2*4(r1) |
433 |
> |
lwz r11,56+3*4(r1) |
434 |
> |
lwz r12,56+4*4(r1) |
435 |
> |
lwz r13,56+5*4(r1) |
436 |
> |
lwz r14,56+6*4(r1) |
437 |
> |
lwz r15,56+7*4(r1) |
438 |
> |
lwz r16,56+8*4(r1) // a[0]..a[7] |
439 |
> |
lwz r17,56+9*4(r1) |
440 |
> |
lwz r18,56+10*4(r1) |
441 |
> |
lwz r19,56+11*4(r1) |
442 |
> |
lwz r20,56+12*4(r1) |
443 |
> |
lwz r21,56+13*4(r1) |
444 |
> |
lwz r22,56+14*4(r1) |
445 |
> |
lwz r3,56+15*4(r1) |
446 |
> |
lfd f13,56+16*4+14*8(r1) |
447 |
> |
lfd f0,56+16*4+0*8(r1) |
448 |
> |
lfd f1,56+16*4+1*8(r1) |
449 |
> |
lfd f2,56+16*4+2*8(r1) |
450 |
> |
lfd f3,56+16*4+3*8(r1) |
451 |
> |
lfd f4,56+16*4+4*8(r1) |
452 |
> |
lfd f5,56+16*4+5*8(r1) |
453 |
> |
lfd f6,56+16*4+6*8(r1) |
454 |
> |
lfd f7,56+16*4+7*8(r1) |
455 |
|
mtfsf 0xff,f13 |
456 |
< |
lfd f8,24+16*4+8*8(r1) |
457 |
< |
lfd f9,24+16*4+9*8(r1) |
458 |
< |
lfd f10,24+16*4+10*8(r1) |
459 |
< |
lfd f11,24+16*4+11*8(r1) |
460 |
< |
lfd f12,24+16*4+12*8(r1) |
461 |
< |
lfd f13,24+16*4+13*8(r1) |
456 |
> |
lfd f8,56+16*4+8*8(r1) |
457 |
> |
lfd f9,56+16*4+9*8(r1) |
458 |
> |
lfd f10,56+16*4+10*8(r1) |
459 |
> |
lfd f11,56+16*4+11*8(r1) |
460 |
> |
lfd f12,56+16*4+12*8(r1) |
461 |
> |
lfd f13,56+16*4+13*8(r1) |
462 |
|
|
463 |
|
// Delete PowerPC stack frame |
464 |
< |
lwz r2,24+16*4+15*8+12(r1) |
465 |
< |
lwz r0,24+16*4+15*8+16(r1) |
464 |
> |
lwz r2,56+16*4+15*8+12(r1) |
465 |
> |
lwz r0,56+16*4+15*8+16(r1) |
466 |
|
mtxer r0 |
467 |
< |
lwz r0,24+16*4+15*8+4(r1) |
467 |
> |
lwz r0,56+16*4+15*8+4(r1) |
468 |
|
mtcrf 0xff,r0 |
469 |
|
mr r1,r3 |
470 |
|
|
597 |
|
ASM_MACRO_END |
598 |
|
|
599 |
|
ASM_MACRO_START epilog |
598 |
– |
RESTORE_SYSTEM_R2 |
599 |
– |
RESTORE_SYSTEM_R13 |
600 |
|
lwz r0,64+4(r1) |
601 |
|
mtlr r0 |
602 |
|
addi r1,r1,64 |
603 |
+ |
RESTORE_SYSTEM_R2 |
604 |
+ |
RESTORE_SYSTEM_R13 |
605 |
|
blr |
606 |
|
ASM_MACRO_END |
607 |
|
|
710 |
|
* Native resource manager patches |
711 |
|
*/ |
712 |
|
|
713 |
< |
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(get_resource) |
712 |
< |
C_SYMBOL_NAME(get_resource): |
713 |
> |
ASM_MACRO_START do_get_resource ASM_MACRO_ARG0_DEF |
714 |
|
// Create stack frame |
715 |
|
mflr r0 |
716 |
|
stw r0,8(r1) |
721 |
|
stw r4,56+4(r1) |
722 |
|
|
723 |
|
// Call old routine |
724 |
< |
lwz r0,XLM_GET_RESOURCE(0) |
724 |
> |
lwz r0,ASM_MACRO_ARG0(0) |
725 |
|
lwz r2,XLM_RES_LIB_TOC(0) |
726 |
|
mtctr r0 |
727 |
|
bctrl |
727 |
– |
RESTORE_SYSTEM_R2 |
728 |
|
stw r3,56+8(r1) // Save handle |
729 |
|
|
730 |
|
// Call CheckLoad |
731 |
+ |
RESTORE_SYSTEM_R2 |
732 |
+ |
RESTORE_SYSTEM_R13 |
733 |
|
lwz r3,56(r1) |
734 |
|
lha r4,56+6(r1) |
735 |
|
lwz r5,56+8(r1) |
741 |
|
mtlr r0 |
742 |
|
addi r1,r1,56+12 |
743 |
|
blr |
744 |
+ |
ASM_MACRO_END |
745 |
+ |
|
746 |
+ |
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(get_resource) |
747 |
+ |
C_SYMBOL_NAME(get_resource): |
748 |
+ |
do_get_resource XLM_GET_RESOURCE |
749 |
|
|
750 |
|
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(get_1_resource) |
751 |
|
C_SYMBOL_NAME(get_1_resource): |
752 |
< |
// Create stack frame |
746 |
< |
mflr r0 |
747 |
< |
stw r0,8(r1) |
748 |
< |
stwu r1,-(56+12)(r1) |
749 |
< |
|
750 |
< |
// Save type/ID |
751 |
< |
stw r3,56(r1) |
752 |
< |
stw r4,56+4(r1) |
753 |
< |
|
754 |
< |
// Call old routine |
755 |
< |
lwz r0,XLM_GET_1_RESOURCE(0) |
756 |
< |
lwz r2,XLM_RES_LIB_TOC(0) |
757 |
< |
mtctr r0 |
758 |
< |
bctrl |
759 |
< |
RESTORE_SYSTEM_R2 |
760 |
< |
stw r3,56+8(r1) // Save handle |
761 |
< |
|
762 |
< |
// Call CheckLoad |
763 |
< |
lwz r3,56(r1) |
764 |
< |
lha r4,56+6(r1) |
765 |
< |
lwz r5,56+8(r1) |
766 |
< |
bl C_SYMBOL_NAME(check_load_invoc) |
767 |
< |
lwz r3,56+8(r1) // Restore handle |
768 |
< |
|
769 |
< |
// Return to caller |
770 |
< |
lwz r0,56+12+8(r1) |
771 |
< |
mtlr r0 |
772 |
< |
addi r1,r1,56+12 |
773 |
< |
blr |
752 |
> |
do_get_resource XLM_GET_1_RESOURCE |
753 |
|
|
754 |
|
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(get_ind_resource) |
755 |
|
C_SYMBOL_NAME(get_ind_resource): |
756 |
< |
// Create stack frame |
778 |
< |
mflr r0 |
779 |
< |
stw r0,8(r1) |
780 |
< |
stwu r1,-(56+12)(r1) |
781 |
< |
|
782 |
< |
// Save type/index |
783 |
< |
stw r3,56(r1) |
784 |
< |
stw r4,56+4(r1) |
785 |
< |
|
786 |
< |
// Call old routine |
787 |
< |
lwz r0,XLM_GET_IND_RESOURCE(0) |
788 |
< |
lwz r2,XLM_RES_LIB_TOC(0) |
789 |
< |
mtctr r0 |
790 |
< |
bctrl |
791 |
< |
RESTORE_SYSTEM_R2 |
792 |
< |
stw r3,56+8(r1) // Save handle |
793 |
< |
|
794 |
< |
// Call CheckLoad |
795 |
< |
lwz r3,56(r1) |
796 |
< |
lha r4,56+6(r1) |
797 |
< |
lwz r5,56+8(r1) |
798 |
< |
bl C_SYMBOL_NAME(check_load_invoc) |
799 |
< |
lwz r3,56+8(r1) // Restore handle |
800 |
< |
|
801 |
< |
// Return to caller |
802 |
< |
lwz r0,56+12+8(r1) |
803 |
< |
mtlr r0 |
804 |
< |
addi r1,r1,56+12 |
805 |
< |
blr |
756 |
> |
do_get_resource XLM_GET_IND_RESOURCE |
757 |
|
|
758 |
|
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(get_1_ind_resource) |
759 |
|
C_SYMBOL_NAME(get_1_ind_resource): |
760 |
< |
// Create stack frame |
810 |
< |
mflr r0 |
811 |
< |
stw r0,8(r1) |
812 |
< |
stwu r1,-(56+12)(r1) |
813 |
< |
|
814 |
< |
// Save type/index |
815 |
< |
stw r3,56(r1) |
816 |
< |
stw r4,56+4(r1) |
817 |
< |
|
818 |
< |
// Call old routine |
819 |
< |
lwz r0,XLM_GET_1_IND_RESOURCE(0) |
820 |
< |
lwz r2,XLM_RES_LIB_TOC(0) |
821 |
< |
mtctr r0 |
822 |
< |
bctrl |
823 |
< |
RESTORE_SYSTEM_R2 |
824 |
< |
stw r3,56+8(r1) // Save handle |
825 |
< |
|
826 |
< |
// Call CheckLoad |
827 |
< |
lwz r3,56(r1) |
828 |
< |
lha r4,56+6(r1) |
829 |
< |
lwz r5,56+8(r1) |
830 |
< |
bl C_SYMBOL_NAME(check_load_invoc) |
831 |
< |
lwz r3,56+8(r1) // Restore handle |
832 |
< |
|
833 |
< |
// Return to caller |
834 |
< |
lwz r0,56+12+8(r1) |
835 |
< |
mtlr r0 |
836 |
< |
addi r1,r1,56+12 |
837 |
< |
blr |
760 |
> |
do_get_resource XLM_GET_1_IND_RESOURCE |
761 |
|
|
762 |
|
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(r_get_resource) |
763 |
|
C_SYMBOL_NAME(r_get_resource): |
764 |
< |
// Create stack frame |
842 |
< |
mflr r0 |
843 |
< |
stw r0,8(r1) |
844 |
< |
stwu r1,-(56+12)(r1) |
845 |
< |
|
846 |
< |
// Save type/ID |
847 |
< |
stw r3,56(r1) |
848 |
< |
stw r4,56+4(r1) |
849 |
< |
|
850 |
< |
// Call old routine |
851 |
< |
lwz r0,XLM_R_GET_RESOURCE(0) |
852 |
< |
lwz r2,XLM_RES_LIB_TOC(0) |
853 |
< |
mtctr r0 |
854 |
< |
bctrl |
855 |
< |
RESTORE_SYSTEM_R2 |
856 |
< |
stw r3,56+8(r1) // Save handle |
857 |
< |
|
858 |
< |
// Call CheckLoad |
859 |
< |
lwz r3,56(r1) |
860 |
< |
lha r4,56+6(r1) |
861 |
< |
lwz r5,56+8(r1) |
862 |
< |
bl C_SYMBOL_NAME(check_load_invoc) |
863 |
< |
lwz r3,56+8(r1) // Restore handle |
864 |
< |
|
865 |
< |
// Return to caller |
866 |
< |
lwz r0,56+12+8(r1) |
867 |
< |
mtlr r0 |
868 |
< |
addi r1,r1,56+12 |
869 |
< |
blr |
764 |
> |
do_get_resource XLM_R_GET_RESOURCE |
765 |
|
|
766 |
|
|
767 |
|
/* |
814 |
|
|
815 |
|
|
816 |
|
/* |
817 |
< |
* Glue for glibc with TLS support which clobbers r2 |
923 |
< |
* |
924 |
< |
* The following is derived from dietlibc and only provides |
925 |
< |
* pass-through to kernel syscalls. You also lose asynchronous |
926 |
< |
* cancellation support. |
817 |
> |
* Define signal handlers with alternate stack initialization magic |
818 |
|
*/ |
819 |
|
|
820 |
< |
#if defined(__linux__) |
821 |
< |
#define __NR_getpid 20 |
822 |
< |
#define __NR__newselect 142 |
823 |
< |
|
824 |
< |
#define syscall_weak(name,wsym,sym) \ |
825 |
< |
.text; \ |
826 |
< |
.type wsym,@function; \ |
827 |
< |
.weak wsym; \ |
828 |
< |
wsym: ; \ |
829 |
< |
.type sym,@function; \ |
830 |
< |
.global sym; \ |
831 |
< |
sym: \ |
832 |
< |
li 0,__NR_##name; \ |
833 |
< |
b __unified_syscall |
834 |
< |
|
835 |
< |
#define syscall(name,sym) \ |
836 |
< |
.text; \ |
837 |
< |
.type sym,@function; \ |
838 |
< |
.global sym; \ |
839 |
< |
sym: \ |
840 |
< |
li 0,__NR_##name; \ |
841 |
< |
b __unified_syscall |
842 |
< |
|
843 |
< |
|
844 |
< |
.type __unified_syscall,@function |
845 |
< |
__unified_syscall: |
846 |
< |
sc |
847 |
< |
bnslr+ |
848 |
< |
stwu 1,-16(1) |
849 |
< |
mflr 0 |
850 |
< |
stw 0,20(1) |
851 |
< |
stw 3,12(1) |
852 |
< |
bl __errno_location |
853 |
< |
lwz 0,12(1) |
854 |
< |
stw 0,0(3) |
855 |
< |
lwz 0,20(1) |
856 |
< |
mtlr 0 |
857 |
< |
addi 1,1,16 |
858 |
< |
blr |
859 |
< |
|
860 |
< |
/* name weak symbol symbol */ |
861 |
< |
syscall( getpid, getpid) |
862 |
< |
syscall_weak( _newselect, select, __select) |
863 |
< |
#endif |
820 |
> |
#define SIG_STACK_SIZE 0x10000 |
821 |
> |
|
822 |
> |
ASM_MACRO_START do_define_signal_handler \ |
823 |
> |
ASM_MACRO_ARG0_DEF /* name */ \ |
824 |
> |
ASM_MACRO_ARG1_DEF /* stack */ \ |
825 |
> |
ASM_MACRO_ARG2_DEF /* stack id */ \ |
826 |
> |
ASM_MACRO_ARG3_DEF /* signal handler */ |
827 |
> |
|
828 |
> |
// Alternate stack lower base for this signal handler |
829 |
> |
.lcomm ASM_MACRO_ARG1,SIG_STACK_SIZE,ASM_ALIGN_2(4) |
830 |
> |
ASM_TYPE(ASM_MACRO_ARG1,@object) |
831 |
> |
|
832 |
> |
// Represents the current nest level for this signal handler |
833 |
> |
// Note that in SheepShaver, SIGUSR2 signals are blocked while |
834 |
> |
// handling other signals so, it's unlikely we ever get a nest |
835 |
> |
// level greater than 1 |
836 |
> |
.lcomm ASM_MACRO_ARG2,4,ASM_ALIGN_2(2) |
837 |
> |
ASM_TYPE(ASM_MACRO_ARG2,@object) |
838 |
> |
|
839 |
> |
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(ASM_MACRO_ARG0) |
840 |
> |
C_SYMBOL_NAME(ASM_MACRO_ARG0): |
841 |
> |
// Preserve args in scratch registers |
842 |
> |
mflr r14 |
843 |
> |
mr r15,r3 |
844 |
> |
mr r16,r4 |
845 |
> |
mr r17,r5 |
846 |
> |
mr r18,r1 |
847 |
> |
|
848 |
> |
// Atomically increase stack_id |
849 |
> |
lis r19,ASM_HA16(ASM_MACRO_ARG2) |
850 |
> |
la r19,ASM_LO16(ASM_MACRO_ARG2,r19) |
851 |
> |
li r4,1 |
852 |
> |
mr r3,r19 |
853 |
> |
bl C_SYMBOL_NAME(atomic_add) |
854 |
> |
cmpwi r3,0 |
855 |
> |
bne- 1f |
856 |
> |
|
857 |
> |
// ID was 0, we can use the local stack |
858 |
> |
lis r9,ASM_HA16(ASM_MACRO_ARG1) |
859 |
> |
lis r3,(SIG_STACK_SIZE>>16) |
860 |
> |
la r9,ASM_LO16(ASM_MACRO_ARG1,r9) |
861 |
> |
addi r3,r3,((SIG_STACK_SIZE&0xffff)-64) |
862 |
> |
add r1,r9,r3 |
863 |
> |
|
864 |
> |
1: // Invoke signal handler |
865 |
> |
stwu r1,-16(r1) |
866 |
> |
mr r3,r15 |
867 |
> |
mr r4,r16 |
868 |
> |
mr r5,r17 |
869 |
> |
bl C_SYMBOL_NAME(ASM_MACRO_ARG3) |
870 |
> |
addi r1,r1,16 |
871 |
> |
|
872 |
> |
// Atomically decrease stack id |
873 |
> |
mr r3,r19 |
874 |
> |
li r4,-1 |
875 |
> |
bl C_SYMBOL_NAME(atomic_add) |
876 |
> |
|
877 |
> |
// Restore kernel stack and return |
878 |
> |
mtlr r14 |
879 |
> |
mr r1,r18 |
880 |
> |
blr |
881 |
> |
ASM_MACRO_END |
882 |
> |
|
883 |
> |
#define DEFINE_SIGNAL_HANDLER(NAME) \ |
884 |
> |
do_define_signal_handler \ |
885 |
> |
NAME##_handler_init ASM_MACRO_ARG_SEP \ |
886 |
> |
NAME##_stack ASM_MACRO_ARG_SEP \ |
887 |
> |
NAME##_stack_id ASM_MACRO_ARG_SEP \ |
888 |
> |
NAME##_handler |
889 |
> |
|
890 |
> |
DEFINE_SIGNAL_HANDLER(sigusr2) |