PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
init.c
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16void __init_cwd(int argc, char ** argv);
17void _libcglue_timezone_update();
18void _libcglue_rtc_update();
19void __fdman_init();
20void pthread_init();
21void pthread_terminate();
22void __fdman_deinit();
23void __locks_init();
24void __locks_deinit();
25
26int chdir(const char *path);
27
28#ifdef F___gprof_init
29/* Note: This function is being called from _init and it is overrided when compiling with -pg */
30__attribute__((weak))
31void __gprof_init() {}
32#else
33void __gprof_init();
34#endif
35
36#ifdef F___gprof_cleanup
37/* Note: This function is being called from _exit and it is overrided when compiling with -pg */
38__attribute__((weak))
39void __gprof_cleanup() {}
40#else
41void __gprof_cleanup();
42#endif
43
44#ifdef F___libpthreadglue_init
45/* Note: This function is being called from __libcglue_init.
46* It is a weak function because can be override by user program
47*/
48__attribute__((weak))
49void __libpthreadglue_init()
50{
51 pthread_init();
52}
53#else
54void __libpthreadglue_init();
55#endif
56
57#ifdef F___libpthreadglue_deinit
58/* Note: This function is being called from __libcglue_deinit.
59* It is a weak function because can be override by user program
60*/
61__attribute__((weak))
62void __libpthreadglue_deinit()
63{
64 pthread_terminate();
65}
66#else
67void __libpthreadglue_deinit();
68#endif
69
70#ifdef F__libcglue_init
71__attribute__((weak))
72void _libcglue_init()
73{
74 /* Initialize lock API */
75 __locks_init();
76
77 /* Initialize filedescriptor management */
78 __fdman_init();
79
80 /* Initialize pthread library */
81 __libpthreadglue_init();
82
83 _libcglue_timezone_update();
84 _libcglue_rtc_update();
85
86 __gprof_init();
87}
88#endif
89
90#ifdef F__libcglue_deinit
91__attribute__((weak))
92void _libcglue_deinit()
93{
94 __gprof_cleanup();
95 __libpthreadglue_deinit();
96 __fdman_deinit();
97 __locks_deinit();
98}
99#endif
100
101#ifdef F__libcglue_args_parse
102__attribute__((weak))
103void _libcglue_args_parse(int argc, char ** argv)
104{
105 /* Initialize cwd from this program's path */
106 __init_cwd(argc, argv);
107}
108#endif
109