Skip to content

Commit

Permalink
Merge pull request #649 from fjtrujy/crt0InitSys
Browse files Browse the repository at this point in the history
Call `_InitSys()` before newlib initialization
  • Loading branch information
rickgaiser authored Jul 15, 2024
2 parents a5cd227 + 015b0b2 commit 2ef91b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ee/startup/src/crt0.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ static void _main()
// NOTE: this call can restart the application
if (_ps2sdk_memory_init)
_ps2sdk_memory_init();

// Initialize the kernel (Apply necessary patches).
_InitSys();

// Use arguments sent through start if sent (by ps2link for instance)
pa = &args;
Expand All @@ -109,16 +112,13 @@ static void _main()
// initialize libcglue
_libcglue_init();

// Enable interruts
EI();

// call global constructors (weak)
if (_init)
_init();

// Initialize the kernel (Apply necessary patches).
_InitSys();

// Enable interruts
EI();

// call main
retval = main(pa->argc, pa->argv);

Expand Down

0 comments on commit 2ef91b7

Please sign in to comment.