2016-11-22 23:06:35 +00:00
|
|
|
|
|
|
|
/*#define IMPORT_BEGIN(lib) .align 2; .section .fimport_##lib,"ax";*/
|
|
|
|
#define IMPORT_BEGIN(lib)
|
|
|
|
|
|
|
|
/*#define IMPORT(name) \
|
|
|
|
.global name; \
|
|
|
|
name: \
|
|
|
|
nop; \
|
|
|
|
nop*/
|
|
|
|
|
|
|
|
|
|
|
|
#define IMPORT(name) \
|
|
|
|
.align 2; \
|
|
|
|
.section ".rplTramp.text","ax"; \
|
|
|
|
.global name; \
|
|
|
|
name: \
|
|
|
|
lis %r0, name##_stub@h; \
|
|
|
|
ori %r0, %r0, name##_stub@l; \
|
|
|
|
mtctr %r0; \
|
|
|
|
bctr;
|
|
|
|
|
|
|
|
/*#define IMPORT_END() .align 2;*/
|
2016-11-23 07:47:02 +00:00
|
|
|
#define IMPORT_END()
|
2016-11-22 23:06:35 +00:00
|
|
|
|
|
|
|
#include "imports.h"
|
|
|
|
|
|
|
|
|
2016-11-23 07:47:02 +00:00
|
|
|
#undef IMPORT_BEGIN
|
2016-11-22 23:06:35 +00:00
|
|
|
#undef IMPORT
|
|
|
|
#undef IMPORT_END
|
|
|
|
|
|
|
|
#define IMPORT_BEGIN(lib) \
|
2016-11-23 07:47:02 +00:00
|
|
|
.section ".rodata.rplNames"; \
|
|
|
|
1: \
|
|
|
|
.string #lib; \
|
2016-11-22 23:06:35 +00:00
|
|
|
.section ".data.rplFuncStubs"; \
|
|
|
|
.align 2; \
|
2016-11-23 07:47:02 +00:00
|
|
|
2:
|
2016-11-22 23:06:35 +00:00
|
|
|
|
|
|
|
#define IMPORT(name) \
|
|
|
|
.global name##_stub; \
|
|
|
|
name##_stub: \
|
|
|
|
.long name;
|
|
|
|
|
2016-11-23 07:47:02 +00:00
|
|
|
#define IMPORT_END() \
|
|
|
|
3: \
|
2016-11-22 23:06:35 +00:00
|
|
|
.section ".lib.rplLibs"; \
|
|
|
|
.align 2; \
|
2016-11-23 07:47:02 +00:00
|
|
|
.long 1b; \
|
|
|
|
.long 2b; \
|
|
|
|
.long 3b
|
2016-11-22 23:06:35 +00:00
|
|
|
|
|
|
|
#include "imports.h"
|
2017-01-25 18:52:31 +00:00
|
|
|
|
|
|
|
.section ".text"
|
|
|
|
.globl SC0x25_KernelCopyData
|
|
|
|
SC0x25_KernelCopyData:
|
|
|
|
li r0, 0x2500
|
|
|
|
sc
|
|
|
|
blr
|