-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* match some runtime functions * match the last non-c++ file
- Loading branch information
Showing
10 changed files
with
1,365 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef RUNTIME_GECKO_SETJMP_H | ||
#define RUNTIME_GECKO_SETJMP_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
struct __jmp_buf { | ||
unsigned long lr; | ||
unsigned long cr; | ||
unsigned long sp; | ||
unsigned long toc; | ||
unsigned long _padding1; | ||
unsigned long gprs[32 - 13]; | ||
double fprs[(32 - 14) * 2]; | ||
double fpscr; | ||
double _padding2; | ||
}; | ||
|
||
int __setjmp(struct __jmp_buf* env); | ||
void longjmp(struct __jmp_buf* env, int status); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "revolution/os.h" | ||
#include "macros.h" | ||
|
||
//! TODO: document | ||
fn_80063C28(s32 handle, void *p); | ||
|
||
static inline void InitInline(void) { | ||
void* arenaLo; | ||
void* arenaHi; | ||
|
||
if (__OSCurrHeap == -1) { | ||
OSReport("GCN_Mem_Alloc.c : InitDefaultHeap. No Heap Available\n"); | ||
OSReport("Metrowerks CW runtime library initializing default heap\n"); | ||
|
||
arenaLo = OSGetArenaLo(); | ||
arenaHi = OSGetArenaHi(); | ||
arenaLo = OSInitAlloc(arenaLo, arenaHi, 1); | ||
OSSetArenaLo(arenaLo); | ||
|
||
arenaLo = (void*)OSRoundUp32B(arenaLo); | ||
arenaHi = (void*)OSRoundDown32B(arenaHi); | ||
OSSetCurrentHeap(OSCreateHeap(arenaLo, arenaHi)); | ||
OSSetArenaLo(arenaLo = arenaHi); | ||
} | ||
} | ||
|
||
void Init(void *ptr) { | ||
InitInline(); | ||
fn_80063C28(__OSCurrHeap, ptr); | ||
} | ||
|
||
WEAK void __sys_free(void *ptr) { | ||
InitInline(); | ||
OSFreeToHeap(__OSCurrHeap, ptr); | ||
} |
Oops, something went wrong.