2018-05-25 12:31:38 +02:00
|
|
|
.extern main
|
|
|
|
.extern exit
|
2018-05-27 13:12:49 +02:00
|
|
|
.extern __init_wut
|
|
|
|
.extern __fini_wut
|
2018-05-25 12:31:38 +02:00
|
|
|
|
|
|
|
.global _start
|
|
|
|
_start:
|
2018-05-30 23:13:49 +02:00
|
|
|
stwu 1, -0x14(1)
|
|
|
|
mflr 0
|
|
|
|
stw 0, 0x18(1)
|
|
|
|
stw 3, 0xC(1)
|
|
|
|
stw 4, 0x10(1)
|
2018-05-30 22:56:18 +02:00
|
|
|
cmpwi 3, 2
|
|
|
|
beq unload
|
|
|
|
|
|
|
|
load:
|
|
|
|
# Load
|
2018-05-30 23:00:58 +02:00
|
|
|
bl __init_wut
|
2018-05-30 22:56:18 +02:00
|
|
|
bl __eabi
|
2018-05-30 23:13:49 +02:00
|
|
|
lwz 3, 0xC(1)
|
|
|
|
lwz 4, 0x10(1)
|
2018-05-30 22:56:18 +02:00
|
|
|
bl rpl_main
|
2018-05-30 23:13:49 +02:00
|
|
|
addi 1, 1, 0x14
|
2018-05-30 22:56:18 +02:00
|
|
|
blr
|
|
|
|
|
|
|
|
unload:
|
|
|
|
# Handle unload
|
2018-05-30 23:13:49 +02:00
|
|
|
lwz 3, 0xC(1)
|
|
|
|
lwz 4, 0x10(1)
|
2018-05-30 22:56:18 +02:00
|
|
|
bl rpl_main
|
2018-05-27 13:12:49 +02:00
|
|
|
bl __fini_wut
|
2018-05-30 23:13:49 +02:00
|
|
|
addi 1, 1, 0x14
|
2018-05-25 12:31:38 +02:00
|
|
|
b exit
|
2018-05-30 23:13:49 +02:00
|
|
|
|