Skip to content

Commit

Permalink
- Actually stop multitasking kernel.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Aug 21, 2020
1 parent 3623ef7 commit 8c94739
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cube/swiss/source/aram/sidestep.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ static void ARAMStub(void)

}

void *ARAMRunStub() {
void ARAMRunStub(void)
{
BOOTSTUB stub;
char *p;
char *s = (char *) ARAMStub;

/*** Copy ARAMStub to 81300000 ***/
if (_dst + _len < 0x81300000) p = (void *) 0x81300000;
else p = (void *) 0x80003100;
Expand All @@ -128,15 +129,12 @@ void *ARAMRunStub() {
/*** Round length to 32 bytes ***/
if (_len & 0x1f) _len = (_len & ~0x1f) + 0x20;


/*** Flush everything! ***/
DCFlushRange((void *) 0x80000000, 0x1800000);

/*** Boot the bugger :D ***/
stub = (BOOTSTUB) p;
stub((u32) _entrypoint, _dst, _src, _len | 0x80000000, _len >> 5, _dst);

return 0;
stub((u32) _entrypoint, _dst, _src, _len | 0x80000000, _len >> 5, _dst);
}

/****************************************************************************
Expand All @@ -163,7 +161,7 @@ void ARAMRun(u32 entrypoint, u32 dst, u32 src, u32 len)
*(volatile u32*)0x800000D4 = osctxvirt;
install_code(1); // Must happen here because libOGC likes to write over all exception handlers.
/*** Shutdown all threads and exit to this method ***/
__lwp_thread_stopmultitasking((void(*)())ARAMRunStub());
__lwp_thread_stopmultitasking(ARAMRunStub);
}

/****************************************************************************
Expand Down

0 comments on commit 8c94739

Please sign in to comment.