blob: 8d33b132020d19e0782fa8352cae3cb565be9b3b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#include <revolution/base/PPCArch.h>
#ifdef __cplusplus
extern "C" {
#endif
void __init_cpp(void);
void _ExitProcess(void);
typedef void (*voidfunctionptr)();
extern voidfunctionptr _ctors[];
extern voidfunctionptr _dtors[];
void __init_user(void) {
__init_cpp();
}
void __init_cpp(void) {
/**
* call static initializers
*/
voidfunctionptr* constructor;
for (constructor = _ctors; *constructor; constructor++) {
(*constructor)();
}
}
static void __fini_cpp(void) {
voidfunctionptr* dtor;
for (dtor = _dtors; *dtor; dtor++) {
(*dtor)();
}
}
void exit(int status) {
__fini_cpp();
_ExitProcess();
}
void _ExitProcess(void) {
PPCHalt();
}
#ifdef __cplusplus
}
#endif
|