sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
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
15
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/* Note: This function is being called from _init and it is overrided when compiling with -pg */
29__attribute__((weak))
30void __gprof_init() {}
31
32/* Note: This function is being called from _exit and it is overrided when compiling with -pg */
33__attribute__((weak))
34void __gprof_cleanup() {}
35
36/* Note: This function is being called from __libcglue_init.
37* It is a weak function because can be override by user program
38*/
39__attribute__((weak))
40void __libpthreadglue_init()
41{
42 pthread_init();
43}
44
45/* Note: This function is being called from __libcglue_deinit.
46* It is a weak function because can be override by user program
47*/
48__attribute__((weak))
49void __libpthreadglue_deinit()
50{
51 pthread_terminate();
52}
53
54__attribute__((weak))
55void _libcglue_init()
56{
57 /* Initialize lock API */
58 __locks_init();
59
60 /* Initialize filedescriptor management */
61 __fdman_init();
62
63 /* Initialize pthread library */
64 __libpthreadglue_init();
65
66 _libcglue_timezone_update();
67 _libcglue_rtc_update();
68
69 __gprof_init();
70}
71
72__attribute__((weak))
73void _libcglue_deinit()
74{
75 __gprof_cleanup();
76 __libpthreadglue_deinit();
77 __fdman_deinit();
78 __locks_deinit();
79}
80
81__attribute__((weak))
82void _libcglue_args_parse(int argc, char ** argv)
83{
84 /* Initialize cwd from this program's path */
85 __init_cwd(argc, argv);
86}
87