00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef PSPMODULEINFO_H
00015 #define PSPMODULEINFO_H
00016
00017
00018
00019
00020
00021
00022 typedef struct _scemoduleinfo {
00023 unsigned short modattribute;
00024 unsigned char modversion[2];
00025 char modname[27];
00026 char terminal;
00027 void * gp_value;
00028 void * ent_top;
00029 void * ent_end;
00030 void * stub_top;
00031 void * stub_end;
00032 } _sceModuleInfo;
00033
00034 typedef const _sceModuleInfo SceModuleInfo;
00035
00036 extern char _gp[];
00037
00038 #ifdef __cplusplus
00039
00040
00041 #define PSP_MODULE_INFO(name, attributes, major_version, minor_version) \
00042 __asm__ ( \
00043 " .set push\n" \
00044 " .section .lib.ent.top, \"a\", @progbits\n" \
00045 " .align 2\n" \
00046 " .word 0\n" \
00047 "__lib_ent_top:\n" \
00048 " .section .lib.ent.btm, \"a\", @progbits\n" \
00049 " .align 2\n" \
00050 "__lib_ent_bottom:\n" \
00051 " .word 0\n" \
00052 " .section .lib.stub.top, \"a\", @progbits\n" \
00053 " .align 2\n" \
00054 " .word 0\n" \
00055 "__lib_stub_top:\n" \
00056 " .section .lib.stub.btm, \"a\", @progbits\n" \
00057 " .align 2\n" \
00058 "__lib_stub_bottom:\n" \
00059 " .word 0\n" \
00060 " .set pop\n" \
00061 ); \
00062 extern char __lib_ent_top[], __lib_ent_bottom[]; \
00063 extern char __lib_stub_top[], __lib_stub_bottom[]; \
00064 extern SceModuleInfo module_info \
00065 __attribute__((section(".rodata.sceModuleInfo"), \
00066 aligned(16), unused)) = { \
00067 attributes, { minor_version, major_version }, #name, 0, _gp, \
00068 __lib_ent_top, __lib_ent_bottom, \
00069 __lib_stub_top, __lib_stub_bottom \
00070 }
00071 #else
00072
00073 #define PSP_MODULE_INFO(name, attributes, major_version, minor_version) \
00074 __asm__ ( \
00075 " .set push\n" \
00076 " .section .lib.ent.top, \"a\", @progbits\n" \
00077 " .align 2\n" \
00078 " .word 0\n" \
00079 "__lib_ent_top:\n" \
00080 " .section .lib.ent.btm, \"a\", @progbits\n" \
00081 " .align 2\n" \
00082 "__lib_ent_bottom:\n" \
00083 " .word 0\n" \
00084 " .section .lib.stub.top, \"a\", @progbits\n" \
00085 " .align 2\n" \
00086 " .word 0\n" \
00087 "__lib_stub_top:\n" \
00088 " .section .lib.stub.btm, \"a\", @progbits\n" \
00089 " .align 2\n" \
00090 "__lib_stub_bottom:\n" \
00091 " .word 0\n" \
00092 " .set pop\n" \
00093 ); \
00094 extern char __lib_ent_top[], __lib_ent_bottom[]; \
00095 extern char __lib_stub_top[], __lib_stub_bottom[]; \
00096 SceModuleInfo module_info \
00097 __attribute__((section(".rodata.sceModuleInfo"), \
00098 aligned(16), unused)) = { \
00099 attributes, { minor_version, major_version }, name, 0, _gp, \
00100 __lib_ent_top, __lib_ent_bottom, \
00101 __lib_stub_top, __lib_stub_bottom \
00102 }
00103 #endif
00104
00105
00106 #define PSP_MAIN_THREAD_PRIORITY(priority) \
00107 unsigned int sce_newlib_priority = (priority)
00108
00109 #define PSP_MAIN_THREAD_STACK_SIZE_KB(size_kb) \
00110 unsigned int sce_newlib_stack_kb_size = (size_kb)
00111
00112 #define PSP_MAIN_THREAD_ATTR(attr) \
00113 unsigned int sce_newlib_attribute = (attr)
00114 #define PSP_MAIN_THREAD_ATTRIBUTE PSP_MAIN_THREAD_ATTR
00115
00116
00117 #define PSP_MAIN_THREAD_PARAMS(priority, size_kb, attribute) \
00118 PSP_MAIN_THREAD_PRIORITY(priority); \
00119 PSP_MAIN_THREAD_STACK_SIZE_KB(size_kb); \
00120 PSP_MAIN_THREAD_ATTR(attribute)
00121
00122
00123 #define PSP_NO_CREATE_MAIN_THREAD() \
00124 int sce_newlib_nocreate_thread_in_start = 1
00125
00126
00127 #define PSP_HEAP_SIZE_KB(size_kb) \
00128 unsigned int sce_newlib_heap_kb_size = (size_kb)
00129
00130 #endif