245 |
|
// Restore PowerPC registers |
246 |
|
lwz r1,XLM_EMUL_RETURN_STACK(0) |
247 |
|
RESTORE_SYSTEM_R2 |
248 |
– |
RESTORE_SYSTEM_R13 |
248 |
|
lmw r13,20(r1) |
249 |
|
lfd f14,20+19*4+0*8(r1) |
250 |
|
lfd f15,20+19*4+1*8(r1) |
489 |
|
stw r1,XLM_EMUL_RETURN_STACK(0) |
490 |
|
|
491 |
|
// Preset registers for ROM boot routine |
492 |
< |
lis r3,0x40b0 // Pointer to ROM boot structure |
493 |
< |
ori r3,r3,0xd000 |
492 |
> |
lis r3,ASM_HA16(C_SYMBOL_NAME(ROMBase)) // Pointer to ROM boot structure: |
493 |
> |
lwz r3,ASM_LO16(C_SYMBOL_NAME(ROMBase))(r3) // r3 = ROMBase + 0x30d000 |
494 |
> |
addis r3,r3,ASM_HA16(0x30d000) |
495 |
> |
addi r3,r3,ASM_LO16(0x30d000) |
496 |
|
|
497 |
|
// 68k emulator is now active |
498 |
|
li r0,MODE_68K |
764 |
|
C_SYMBOL_NAME(r_get_resource): |
765 |
|
do_get_resource XLM_R_GET_RESOURCE |
766 |
|
|
767 |
+ |
ASM_MACRO_START do_get_named_resource ASM_MACRO_ARG0_DEF |
768 |
+ |
// Create stack frame |
769 |
+ |
mflr r0 |
770 |
+ |
stw r0,8(r1) |
771 |
+ |
stwu r1,-(56+12)(r1) |
772 |
+ |
|
773 |
+ |
// Save type/ID |
774 |
+ |
stw r3,56(r1) |
775 |
+ |
stw r4,56+4(r1) |
776 |
+ |
|
777 |
+ |
// Call old routine |
778 |
+ |
lwz r0,ASM_MACRO_ARG0(0) |
779 |
+ |
lwz r2,XLM_RES_LIB_TOC(0) |
780 |
+ |
mtctr r0 |
781 |
+ |
bctrl |
782 |
+ |
stw r3,56+8(r1) // Save handle |
783 |
+ |
|
784 |
+ |
// Call CheckLoad |
785 |
+ |
RESTORE_SYSTEM_R2 |
786 |
+ |
RESTORE_SYSTEM_R13 |
787 |
+ |
lwz r3,56(r1) |
788 |
+ |
lwz r4,56+4(r1) |
789 |
+ |
lwz r5,56+8(r1) |
790 |
+ |
bl C_SYMBOL_NAME(named_check_load_invoc) |
791 |
+ |
lwz r3,56+8(r1) // Restore handle |
792 |
+ |
|
793 |
+ |
// Return to caller |
794 |
+ |
lwz r0,56+12+8(r1) |
795 |
+ |
mtlr r0 |
796 |
+ |
addi r1,r1,56+12 |
797 |
+ |
blr |
798 |
+ |
ASM_MACRO_END |
799 |
+ |
|
800 |
+ |
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(get_named_resource) |
801 |
+ |
C_SYMBOL_NAME(get_named_resource): |
802 |
+ |
do_get_named_resource XLM_GET_NAMED_RESOURCE |
803 |
+ |
|
804 |
+ |
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(get_1_named_resource) |
805 |
+ |
C_SYMBOL_NAME(get_1_named_resource): |
806 |
+ |
do_get_named_resource XLM_GET_1_NAMED_RESOURCE |
807 |
+ |
|
808 |
|
|
809 |
|
/* |
810 |
|
* void ppc_interrupt(uint32 entry{r3}, uint32 kernel_data{r4}) - Execute PPC interrupt |
889 |
|
|
890 |
|
// Atomically increase stack_id |
891 |
|
lis r19,ASM_HA16(ASM_MACRO_ARG2) |
892 |
< |
la r19,ASM_LO16(ASM_MACRO_ARG2,r19) |
892 |
> |
la r19,ASM_LO16(ASM_MACRO_ARG2)(r19) |
893 |
|
li r4,1 |
894 |
|
mr r3,r19 |
895 |
|
bl C_SYMBOL_NAME(atomic_add) |
899 |
|
// ID was 0, we can use the local stack |
900 |
|
lis r9,ASM_HA16(ASM_MACRO_ARG1) |
901 |
|
lis r3,(SIG_STACK_SIZE>>16) |
902 |
< |
la r9,ASM_LO16(ASM_MACRO_ARG1,r9) |
902 |
> |
la r9,ASM_LO16(ASM_MACRO_ARG1)(r9) |
903 |
|
addi r3,r3,((SIG_STACK_SIZE&0xffff)-64) |
904 |
|
add r1,r9,r3 |
905 |
|
|