Matched PPCArch.c, ai.c, db.c and got 99% on vi.c
This commit is contained in:
parent
692c9d32ec
commit
e2db9694ef
8 changed files with 2017 additions and 14 deletions
43
src/dolphin/db.c
Normal file
43
src/dolphin/db.c
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#include <dolphin/db.h>
|
||||
#include <dolphin/os.h>
|
||||
|
||||
DBInterface* __DBInterface = NULL;
|
||||
int DBVerbose;
|
||||
|
||||
extern void __DBExceptionStart();
|
||||
extern void __DBExceptionEnd();
|
||||
extern void __DBExceptionSetNumber();
|
||||
|
||||
void DBInit(void) {
|
||||
__DBInterface = (DBInterface*)OSPhysicalToCached(OS_DBINTERFACE_ADDR);
|
||||
__DBInterface->ExceptionDestination = (void (*)())OSCachedToPhysical(__DBExceptionDestination);
|
||||
DBVerbose = TRUE;
|
||||
}
|
||||
|
||||
void __DBExceptionDestinationAux(void) {
|
||||
u32* contextAddr = (void*)0x00C0;
|
||||
OSContext* context = (OSContext*)OSPhysicalToCached(*contextAddr);
|
||||
|
||||
OSReport("DBExceptionDestination\n");
|
||||
OSDumpContext(context);
|
||||
PPCHalt();
|
||||
}
|
||||
|
||||
/* clang-format off */
|
||||
asm void __DBExceptionDestination(void) {
|
||||
nofralloc
|
||||
mfmsr r3
|
||||
ori r3, r3, 0x10|0x20
|
||||
mtmsr r3
|
||||
|
||||
b __DBExceptionDestinationAux
|
||||
}
|
||||
/* clang-format on */
|
||||
|
||||
BOOL __DBIsExceptionMarked(__OSException exception) {
|
||||
u32 mask = 1 << exception;
|
||||
|
||||
return (BOOL)(__DBInterface->exceptionMask & mask);
|
||||
}
|
||||
|
||||
void DBPrintf(char* format, ...) {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue